Skip to content

Commit a6618f4

Browse files
kmarinushkintiwai
authored andcommitted
ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit
Currently, the offsets in the UAC2 processing unit descriptor are calculated incorrectly. It causes an issue when connecting the device which provides such a feature: ~~~~ [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18) ~~~~ After this patch is applied, the UAC2 processing unit inits w/o this error. Fixes: 23caaf1 ("ALSA: usb-mixer: Add support for Audio Class v2.0") Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e40bdb0 commit a6618f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/uapi/linux/usb/audio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_d
370370
{
371371
return (protocol == UAC_VERSION_1) ?
372372
desc->baSourceID[desc->bNrInPins + 4] :
373-
desc->baSourceID[desc->bNrInPins + 6];
373+
2; /* in UAC2, this value is constant */
374374
}
375375

376376
static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
377377
int protocol)
378378
{
379379
return (protocol == UAC_VERSION_1) ?
380380
&desc->baSourceID[desc->bNrInPins + 5] :
381-
&desc->baSourceID[desc->bNrInPins + 7];
381+
&desc->baSourceID[desc->bNrInPins + 6];
382382
}
383383

384384
static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,

0 commit comments

Comments
 (0)