[alsa-devel] usb-audio: Correct way to do a mixer quirk?

Mark Hills mark at pogo.org.uk
Fri Feb 24 13:26:20 CET 2012

On Mon, 20 Feb 2012, Clemens Ladisch wrote:

> Mark Hills wrote:
> > On Mon, 20 Feb 2012, Clemens Ladisch wrote:
> >> Mark Hills wrote:
> >>> The Electrix Ebox-44 is a new USB interface, but the MIXER_UNIT descriptor
> >>> is broken and refers to a non-existing unit_id.
> >>
> >> I'd suggest to change the code to not abort if a unit doesn't exist.
> >
> > It would seem a little strange to skip over the error for one specific
> > condition to accomodate a specific device -- when the rest of the code
> > does not generally do this?
> It's still possible to complain about the broken firmware, but there is
> no reason to prevent the user from accessing the PCM streams and all
> other mixer controls just because one descriptors happens to be wrong.

The patch for this is relatively simple, I put it below for reference. The 
device can then be used; audio streams and a mixer are available.

But I'm not sure the resulting mixer is correct or complete so I'm in the 
process of getting access to one of these devices -- will allow me to 
check everything. I'll post more information when I have it.



 sound/usb/mixer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ab23869..c374c72 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1388,7 +1388,7 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *r
 	for (pin = 0; pin < input_pins; pin++) {
 		err = parse_audio_unit(state, desc->baSourceID[pin]);
 		if (err < 0)
-			return err;
+			continue;
 		err = check_input_term(state, desc->baSourceID[pin], &iterm);
 		if (err < 0)
 			return err;

More information about the Alsa-devel mailing list