9 #ifndef __INCLUDED_UAC_H__ 10 #define __INCLUDED_UAC_H__ 20 #define UAC_ERRMSG printf 22 #define UAC_DBGMSG printf 24 #define UAC_DBGMSG(...) 32 UAC_STATE_DISCONNECTING,
37 #define SUBCLS_UNDEFINED 0x00 38 #define SUBCLS_AUDIOCONTROL 0x01 39 #define SUBCLS_AUDIOSTREAMING 0x02 40 #define SUBCLS_MIDISTREAMING 0x03 43 #define PR_PROTOCOL_UNDEFINED 0x00 46 #define CS_UNDEFINED 0x20 47 #define CS_DEVICE 0x21 48 #define CS_CONFIGURATION 0x22 49 #define CS_STRING 0x23 50 #define CS_INTERFACE 0x24 51 #define CS_ENDPOINT 0x25 54 #define AC_DESCRIPTOR_UNDEFINED 0x00 56 #define INPUT_TERMINAL 0x02 57 #define OUTPUT_TERMINAL 0x03 58 #define MIXER_UNIT 0x04 59 #define SELECTOR_UNIT 0x05 60 #define FEATURE_UNIT 0x06 61 #define PROCESSING_UNIT 0x07 62 #define EXTENSION_UNIT 0x08 65 #define AS_DESCRIPTOR_UNDEFINED 0x00 66 #define AS_GENERAL 0x01 67 #define FORMAT_TYPE 0x02 68 #define FORMAT_SPECIFIC 0x03 71 #define PROCESS_UNDEFINED 0x00 72 #define UP_DOWNMIX_PROCESS 0x01 73 #define DOLBY_PROLOGIC_PROCESS 0x02 74 #define _3D_STEREO_EXTENDER_PROCESS 0x03 75 #define REVERBERATION_PROCESS 0x04 76 #define CHORUS_PROCESS 0x05 77 #define DYN_RANGE_COMP_PROCESS 0x06 80 #define DESCRIPTOR_UNDEFINED 0x00 81 #define EP_GENERAL 0x01 84 #define REQUEST_CODE_UNDEFINED 0x00 98 #define TE_CONTROL_UNDEFINED 0x00 99 #define COPY_PROTECT_CONTROL 0x01 102 #define FU_CONTROL_UNDEFINED 0x00 103 #define MUTE_CONTROL 0x01 104 #define VOLUME_CONTROL 0x02 105 #define BASS_CONTROL 0x03 106 #define MID_CONTROL 0x04 107 #define TREBLE_CONTROL 0x05 108 #define GRAPHIC_EQUALIZER_CONTROL 0x06 109 #define AUTOMATIC_GAIN_CONTROL 0x07 110 #define DELAY_CONTROL 0x08 111 #define BASS_BOOST_CONTROL 0x09 112 #define LOUDNESS_CONTROL 0x0A 115 #define UD_CONTROL_UNDEFINED 0x00 116 #define UD_ENABLE_CONTROL 0x01 117 #define UD_MODE_SELECT_CONTROL 0x02 120 #define DP_CONTROL_UNDEFINED 0x00 121 #define DP_ENABLE_CONTROL 0x01 122 #define DP_MODE_SELECT_CONTROL 0x02 125 #define _3D_CONTROL_UNDEFINED 0x00 126 #define _3D_ENABLE_CONTROL 0x01 127 #define SPACIOUSNESS_CONTROL 0x03 130 #define RV_CONTROL_UNDEFINED 0x00 131 #define RV_ENABLE_CONTROL 0x01 132 #define REVERB_LEVEL_CONTROL 0x02 133 #define REVERB_TIME_CONTROL 0x03 134 #define REVERB_FEEDBACK_CONTROL 0x04 137 #define CH_CONTROL_UNDEFINED 0x00 138 #define CH_ENABLE_CONTROL 0x01 139 #define CHORUS_LEVEL_CONTROL 0x02 140 #define CHORUS_RATE_CONTROL 0x03 141 #define CHORUS_DEPTH_CONTROL 0x04 144 #define DR_CONTROL_UNDEFINED 0x00 145 #define DR_ENABLE_CONTROL 0x01 146 #define COMPRESSION_RATE_CONTROL 0x02 147 #define MAXAMPL_CONTROL 0x03 148 #define THRESHOLD_CONTROL 0x04 149 #define ATTACK_TIME 0x05 150 #define RELEASE_TIME 0x06 153 #define XU_CONTROL_UNDEFINED 0x00 154 #define XU_ENABLE_CONTROL 0x01 157 #define EP_CONTROL_UNDEFINED 0x00 158 #define SAMPLING_FREQ_CONTROL 0x01 159 #define PITCH_CONTROL 0x02 162 #define FORMAT_TYPE_UNDEFINED 0x00 163 #define FORMAT_TYPE_I 0x01 164 #define FORMAT_TYPE_II 0x02 165 #define FORMAT_TYPE_III 0x03 172 typedef struct cs_hdr_t
174 __packed uint8_t bLength;
175 __packed uint8_t bDescriptorType;
176 __packed uint8_t bDescriptorSubtype;
182 uint8_t bDescriptorType;
183 uint8_t bDescriptorSubtype;
191 typedef struct ac_if_header
193 __packed uint8_t bLength;
194 __packed uint8_t bDescriptorType;
195 __packed uint8_t bDescriptorSubtype;
196 __packed uint16_t bcdADC;
197 __packed uint16_t wTotalLength;
200 __packed uint8_t bInCollection;
207 uint8_t bDescriptorType;
208 uint8_t bDescriptorSubtype;
210 uint16_t wTotalLength;
213 uint8_t bInCollection;
222 typedef struct ac_itd_t
224 __packed uint8_t bLength;
225 __packed uint8_t bDescriptorType;
226 __packed uint8_t bDescriptorSubtype;
227 __packed uint8_t bTerminalID;
228 __packed uint16_t wTerminalType;
229 __packed uint8_t bAssocTerminal;
230 __packed uint8_t bNrChannels;
231 __packed uint16_t wChannelConfig;
232 __packed uint8_t iChannelNames;
233 __packed uint8_t iTerminal;
239 uint8_t bDescriptorType;
240 uint8_t bDescriptorSubtype;
242 uint16_t wTerminalType;
243 uint8_t bAssocTerminal;
245 uint16_t wChannelConfig;
246 uint8_t iChannelNames;
255 typedef struct ac_otd_t
257 __packed uint8_t bLength;
258 __packed uint8_t bDescriptorType;
259 __packed uint8_t bDescriptorSubtype;
260 __packed uint8_t bTerminalID;
261 __packed uint16_t wTerminalType;
262 __packed uint8_t bAssocTerminal;
263 __packed uint8_t bSourceID;
264 __packed uint8_t iTerminal;
270 uint8_t bDescriptorType;
271 uint8_t bDescriptorSubtype;
273 uint16_t wTerminalType;
274 uint8_t bAssocTerminal;
284 #define UAC_TT_USB_UNDEFINED 0x0100 285 #define UAC_TT_USB_STREAMING 0x0101 288 #define UAC_TT_USB_VENDOR 0x01FF 291 #define UAC_TT_INPUT_UNDEFINED 0x0200 292 #define UAC_TT_MICROPHONE 0x0201 294 #define UAC_TT_DESKTOP_MICROPHONE 0x0202 296 #define UAC_TT_PERSONAL_MICROPHONE 0x0203 297 #define UAC_TT_OMNI_MICROPHONE 0x0204 300 #define UAC_TT_MICROPHONE_ARRAY 0x0205 304 #define UAC_TT_OUTPUT_UNDEFINED 0x0300 305 #define UAC_TT_SPEAKER 0x0301 308 #define UAC_TT_HEADPHONES 0x0302 309 #define UAC_TT_HEAD_MOUNTED 0x0303 314 #define UAC_TT_DESKTOP_SPEAKER 0x0304 319 #define UAC_TT_ROOM_SPEAKER 0x0305 321 #define UAC_TT_COMM_SPEAKER 0x0306 323 #define UAC_TT_LFE_SPEAKER 0x0307 331 typedef struct ac_mxr_t
333 __packed uint8_t bLength;
334 __packed uint8_t bDescriptorType;
335 __packed uint8_t bDescriptorSubtype;
336 __packed uint8_t bUnitID;
337 __packed uint8_t bNrInPins;
343 uint8_t bDescriptorType;
344 uint8_t bDescriptorSubtype;
354 typedef struct ac_su_t
356 __packed uint8_t bLength;
357 __packed uint8_t bDescriptorType;
358 __packed uint8_t bDescriptorSubtype;
359 __packed uint8_t bUnitID;
360 __packed uint8_t bNrInPins;
366 uint8_t bDescriptorType;
367 uint8_t bDescriptorSubtype;
377 typedef struct ac_fu_t
379 __packed uint8_t bLength;
380 __packed uint8_t bDescriptorType;
381 __packed uint8_t bDescriptorSubtype;
382 __packed uint8_t bUnitID;
383 __packed uint8_t bSourceID;
384 __packed uint8_t bControlSize;
390 uint8_t bDescriptorType;
391 uint8_t bDescriptorSubtype;
394 uint8_t bControlSize;
399 #define FU_CONTROL_UNDEFINED 0x00 400 #define MUTE_CONTROL 0x01 401 #define VOLUME_CONTROL 0x02 402 #define BASS_CONTROL 0x03 403 #define MID_CONTROL 0x04 404 #define TREBLE_CONTROL 0x05 405 #define GRAPHIC_EQUALIZER_CONTROL 0x06 406 #define AUTOMATIC_GAIN_CONTROL 0x07 407 #define DELAY_CONTROL 0x08 408 #define BASS_BOOST_CONTROL 0x09 409 #define LOUDNESS_CONTROL 0x0A 415 typedef struct as_gen_t
417 __packed uint8_t bLength;
418 __packed uint8_t bDescriptorType;
419 __packed uint8_t bDescriptorSubtype;
420 __packed uint8_t bTerminalLink;
421 __packed uint8_t bDelay;
422 __packed uint16_t wFormatTag;
428 uint8_t bDescriptorType;
429 uint8_t bDescriptorSubtype;
430 uint8_t bTerminalLink;
440 typedef struct ac_pu_t
442 __packed uint8_t bLength;
443 __packed uint8_t bDescriptorType;
444 __packed uint8_t bDescriptorSubtype;
445 __packed uint8_t bUnitID;
446 __packed uint16_t wProcessType;
447 __packed uint8_t bNrInPins;
453 uint8_t bDescriptorType;
454 uint8_t bDescriptorSubtype;
456 uint16_t wProcessType;
465 typedef struct cs_ep_t
467 __packed uint8_t bLength;
468 __packed uint8_t bDescriptorType;
469 __packed uint8_t bDescriptorSubtype;
470 __packed uint8_t bmAttributes;
471 __packed uint8_t bLockDelayUnits;
472 __packed uint16_t wLockDelay;
478 uint8_t bDescriptorType;
479 uint8_t bDescriptorSubtype;
480 uint8_t bmAttributes;
481 uint8_t bLockDelayUnits;
490 typedef struct ac_ft1_t
492 __packed uint8_t bLength;
493 __packed uint8_t bDescriptorType;
494 __packed uint8_t bDescriptorSubtype;
495 __packed uint8_t bFormatType;
496 __packed uint8_t bNrChannels;
497 __packed uint8_t bSubframeSize;
498 __packed uint8_t bBitResolution;
499 __packed uint8_t bSamFreqType;
500 __packed uint8_t tSamFreq[16][3];
506 uint8_t bDescriptorType;
507 uint8_t bDescriptorSubtype;
510 uint8_t bSubframeSize;
511 uint8_t bBitResolution;
512 uint8_t bSamFreqType;
513 uint8_t tSamFreq[16][3];
521 typedef struct ac_ft2_t
523 __packed uint8_t bLength;
524 __packed uint8_t bDescriptorType;
525 __packed uint8_t bDescriptorSubtype;
526 __packed uint8_t bFormatType;
527 __packed uint16_t wMaxBitRate;
528 __packed uint16_t wSamplesPerFrame;
529 __packed uint8_t bSamFreqType;
535 uint8_t bDescriptorType;
536 uint8_t bDescriptorSubtype;
538 uint16_t wMaxBitRate;
539 uint16_t wSamplesPerFrame;
540 uint8_t bSamFreqType;
548 typedef struct ac_ft3_t
550 __packed uint8_t bLength;
551 __packed uint8_t bDescriptorType;
552 __packed uint8_t bDescriptorSubtype;
553 __packed uint8_t bFormatType;
554 __packed uint8_t bNrChannels;
555 __packed uint8_t bSubframeSize;
556 __packed uint8_t bBitResolution;
557 __packed uint8_t bSamFreqType;
558 __packed uint8_t tLowerSamFreq[3];
559 __packed uint8_t tUpperSamFreq[3];
565 uint8_t bDescriptorType;
566 uint8_t bDescriptorSubtype;
569 uint8_t bSubframeSize;
570 uint8_t bBitResolution;
571 uint8_t bSamFreqType;
572 uint8_t tLowerSamFreq[3];
573 uint8_t tUpperSamFreq[3];
void *__dso_handle __attribute__((weak))