History

ALSA: usb-audio: UAC3. Add support for mixer unit.

This adds support for the MIXER UNIT in UAC3. All the information is obtained from the (HIGH CAPABILITY) Cluster's header. We don't read the rest of the logical cluster to obtain the channel config as that wont make any difference in the current mixer behaviour. The name of the mixer unit is not yet requested as there is not support for the UAC3 Class Specific String requests. Tested in an UAC3 device working as a HEADSET with a basic mixer unit (same as the one in the BADD spec) with no controls.

Jorge Sanjuan committed 8 years ago

Commit 6cfd8391 parent 8def12d2 files · +97 −10Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/usb/audio.h+16−3
@@ -285,9 +285,22 @@ static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor · 284 unmodified lines
285285 static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
286286 int protocol)
287287 {
288− return (protocol == UAC_VERSION_1) ?
289− &desc->baSourceID[desc->bNrInPins + 4] :
290− &desc->baSourceID[desc->bNrInPins + 6];
288+ switch (protocol) {
289+ case UAC_VERSION_1:
290+ return &desc->baSourceID[desc->bNrInPins + 4];
291+ case UAC_VERSION_2:
292+ return &desc->baSourceID[desc->bNrInPins + 6];
293+ case UAC_VERSION_3:
294+ return &desc->baSourceID[desc->bNrInPins + 2];
295+ default:
296+ return NULL;
297+ }
298+}
299+
300+static inline __u16 uac3_mixer_unit_wClusterDescrID(struct uac_mixer_unit_descriptor *desc)
301+{
302+ return (desc->baSourceID[desc->bNrInPins + 1] << 8) |
303+ desc->baSourceID[desc->bNrInPins];
291304 }
292305
293306 static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)