hdspm.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. /* 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 _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
  53. /* ------------ CONFIG block IOCTL ---------------------- */
  54. struct hdspm_config_info {
  55. unsigned char pref_sync_ref;
  56. unsigned char wordclock_sync_check;
  57. unsigned char madi_sync_check;
  58. unsigned int system_sample_rate;
  59. unsigned int autosync_sample_rate;
  60. unsigned char system_clock_mode;
  61. unsigned char clock_source;
  62. unsigned char autosync_ref;
  63. unsigned char line_out;
  64. unsigned int passthru;
  65. unsigned int analog_out;
  66. };
  67. #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdspm_config_info)
  68. /* get Soundcard Version */
  69. struct hdspm_version {
  70. unsigned short firmware_rev;
  71. };
  72. #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
  73. /* ------------- get Matrix Mixer IOCTL --------------- */
  74. /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */
  75. /* organisation is 64 channelfader in a continous memory block */
  76. /* equivalent to hardware definition, maybe for future feature of mmap of them */
  77. /* each of 64 outputs has 64 infader and 64 outfader:
  78. Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
  79. #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
  80. struct hdspm_channelfader {
  81. unsigned int in[HDSPM_MIXER_CHANNELS];
  82. unsigned int pb[HDSPM_MIXER_CHANNELS];
  83. };
  84. struct hdspm_mixer {
  85. struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
  86. };
  87. struct hdspm_mixer_ioctl {
  88. struct hdspm_mixer *mixer;
  89. };
  90. /* use indirect access due to the limit of ioctl bit size */
  91. #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
  92. /* typedefs for compatibility to user-space */
  93. typedef struct hdspm_peak_rms hdspm_peak_rms_t;
  94. typedef struct hdspm_config_info hdspm_config_info_t;
  95. typedef struct hdspm_version hdspm_version_t;
  96. typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
  97. typedef struct hdspm_mixer hdspm_mixer_t;
  98. #endif /* __SOUND_HDSPM_H */