hdspm.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef __SOUND_HDSPM_H /* -*- linux-c -*- */
  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. typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t;
  26. /* peam rms level structure like we get from hardware
  27. maybe in future we can memory map it so I just copy it
  28. to user on ioctl call now an dont change anything
  29. rms are made out of low and high values
  30. where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
  31. (i asume so from the code)
  32. */
  33. struct _snd_hdspm_peak_rms {
  34. unsigned int level_offset[1024];
  35. unsigned int input_peak[64];
  36. unsigned int playback_peak[64];
  37. unsigned int output_peak[64];
  38. unsigned int xxx_peak[64]; /* not used */
  39. unsigned int reserved[256]; /* not used */
  40. unsigned int input_rms_l[64];
  41. unsigned int playback_rms_l[64];
  42. unsigned int output_rms_l[64];
  43. unsigned int xxx_rms_l[64]; /* not used */
  44. unsigned int input_rms_h[64];
  45. unsigned int playback_rms_h[64];
  46. unsigned int output_rms_h[64];
  47. unsigned int xxx_rms_h[64]; /* not used */
  48. };
  49. struct sndrv_hdspm_peak_rms_ioctl {
  50. hdspm_peak_rms_t *peak;
  51. };
  52. /* use indirect access due to the limit of ioctl bit size */
  53. #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct sndrv_hdspm_peak_rms_ioctl)
  54. /* ------------ CONFIG block IOCTL ---------------------- */
  55. typedef struct _snd_hdspm_config_info hdspm_config_info_t;
  56. struct _snd_hdspm_config_info {
  57. unsigned char pref_sync_ref;
  58. unsigned char wordclock_sync_check;
  59. unsigned char madi_sync_check;
  60. unsigned int system_sample_rate;
  61. unsigned int autosync_sample_rate;
  62. unsigned char system_clock_mode;
  63. unsigned char clock_source;
  64. unsigned char autosync_ref;
  65. unsigned char line_out;
  66. unsigned int passthru;
  67. unsigned int analog_out;
  68. };
  69. #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdspm_config_info_t)
  70. /* get Soundcard Version */
  71. typedef struct _snd_hdspm_version hdspm_version_t;
  72. struct _snd_hdspm_version {
  73. unsigned short firmware_rev;
  74. };
  75. #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, hdspm_version_t)
  76. /* ------------- get Matrix Mixer IOCTL --------------- */
  77. /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */
  78. /* organisation is 64 channelfader in a continous memory block */
  79. /* equivalent to hardware definition, maybe for future feature of mmap of them */
  80. /* each of 64 outputs has 64 infader and 64 outfader:
  81. Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
  82. #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
  83. typedef struct _snd_hdspm_channelfader snd_hdspm_channelfader_t;
  84. struct _snd_hdspm_channelfader {
  85. unsigned int in[HDSPM_MIXER_CHANNELS];
  86. unsigned int pb[HDSPM_MIXER_CHANNELS];
  87. };
  88. typedef struct _snd_hdspm_mixer hdspm_mixer_t;
  89. struct _snd_hdspm_mixer {
  90. snd_hdspm_channelfader_t ch[HDSPM_MIXER_CHANNELS];
  91. };
  92. struct sndrv_hdspm_mixer_ioctl {
  93. hdspm_mixer_t *mixer;
  94. };
  95. /* use indirect access due to the limit of ioctl bit size */
  96. #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct sndrv_hdspm_mixer_ioctl)
  97. #endif /* __SOUND_HDSPM_H */