hdspm.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef __SOUND_HDSPM_H
  2. #define __SOUND_HDSPM_H
  3. /*
  4. * Copyright (C) 2003 Winfried Ritsch (IEM)
  5. * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
  23. #define HDSPM_MAX_CHANNELS 64
  24. /* -------------------- IOCTL Peak/RMS Meters -------------------- */
  25. /* peam rms level structure like we get from hardware
  26. maybe in future we can memory map it so I just copy it
  27. to user on ioctl call now an dont change anything
  28. rms are made out of low and high values
  29. where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
  30. (i asume so from the code)
  31. */
  32. struct hdspm_peak_rms {
  33. unsigned int level_offset[1024];
  34. unsigned int input_peak[64];
  35. unsigned int playback_peak[64];
  36. unsigned int output_peak[64];
  37. unsigned int xxx_peak[64]; /* not used */
  38. unsigned int reserved[256]; /* not used */
  39. unsigned int input_rms_l[64];
  40. unsigned int playback_rms_l[64];
  41. unsigned int output_rms_l[64];
  42. unsigned int xxx_rms_l[64]; /* not used */
  43. unsigned int input_rms_h[64];
  44. unsigned int playback_rms_h[64];
  45. unsigned int output_rms_h[64];
  46. unsigned int xxx_rms_h[64]; /* not used */
  47. };
  48. struct hdspm_peak_rms_ioctl {
  49. struct hdspm_peak_rms *peak;
  50. };
  51. /* use indirect access due to the limit of ioctl bit size */
  52. #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
  53. _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
  54. /* ------------ CONFIG block IOCTL ---------------------- */
  55. struct hdspm_config_info {
  56. unsigned char pref_sync_ref;
  57. unsigned char wordclock_sync_check;
  58. unsigned char madi_sync_check;
  59. unsigned int system_sample_rate;
  60. unsigned int autosync_sample_rate;
  61. unsigned char system_clock_mode;
  62. unsigned char clock_source;
  63. unsigned char autosync_ref;
  64. unsigned char line_out;
  65. unsigned int passthru;
  66. unsigned int analog_out;
  67. };
  68. #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \
  69. _IOR('H', 0x41, struct hdspm_config_info)
  70. /* get Soundcard Version */
  71. struct hdspm_version {
  72. unsigned short firmware_rev;
  73. };
  74. #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
  75. /* ------------- get Matrix Mixer IOCTL --------------- */
  76. /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
  77. * 32768 Bytes
  78. */
  79. /* organisation is 64 channelfader in a continous memory block */
  80. /* equivalent to hardware definition, maybe for future feature of mmap of
  81. * them
  82. */
  83. /* each of 64 outputs has 64 infader and 64 outfader:
  84. Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
  85. #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
  86. struct hdspm_channelfader {
  87. unsigned int in[HDSPM_MIXER_CHANNELS];
  88. unsigned int pb[HDSPM_MIXER_CHANNELS];
  89. };
  90. struct hdspm_mixer {
  91. struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
  92. };
  93. struct hdspm_mixer_ioctl {
  94. struct hdspm_mixer *mixer;
  95. };
  96. /* use indirect access due to the limit of ioctl bit size */
  97. #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
  98. /* typedefs for compatibility to user-space */
  99. typedef struct hdspm_peak_rms hdspm_peak_rms_t;
  100. typedef struct hdspm_config_info hdspm_config_info_t;
  101. typedef struct hdspm_version hdspm_version_t;
  102. typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
  103. typedef struct hdspm_mixer hdspm_mixer_t;
  104. #endif /* __SOUND_HDSPM_H */