Skip to content

Commit c99f080

Browse files
Jorge Sanjuantiwai
authored andcommitted
ALSA: usb-audio: Use Class Specific EP for UAC3 devices.
bmAtributes offset doesn't exist in the UAC3 CS_EP descriptor. Hence, checking for pitch control as if it was UAC2 doesn't make any sense. Use the defined UAC3 offsets instead. Fixes: 9a2fe9b ("ALSA: usb: initial USB Audio Device Class 3.0 support") Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk> Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 2f0d520 commit c99f080

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sound/usb/stream.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
576576

577577
if (protocol == UAC_VERSION_1) {
578578
attributes = csep->bmAttributes;
579-
} else {
579+
} else if (protocol == UAC_VERSION_2) {
580580
struct uac2_iso_endpoint_descriptor *csep2 =
581581
(struct uac2_iso_endpoint_descriptor *) csep;
582582

@@ -585,6 +585,13 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
585585
/* emulate the endpoint attributes of a v1 device */
586586
if (csep2->bmControls & UAC2_CONTROL_PITCH)
587587
attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
588+
} else { /* UAC_VERSION_3 */
589+
struct uac3_iso_endpoint_descriptor *csep3 =
590+
(struct uac3_iso_endpoint_descriptor *) csep;
591+
592+
/* emulate the endpoint attributes of a v1 device */
593+
if (le32_to_cpu(csep3->bmControls) & UAC2_CONTROL_PITCH)
594+
attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
588595
}
589596

590597
return attributes;

0 commit comments

Comments
 (0)