snd-usb-audio: Skip un-parseable mixer units instead of erroring
PATCH 1/2 snd-usb-audio: Skip un-parseable mixer units instead of erroring
Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them.
This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio.
--- sound/usb/mixer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/usb/mixer.c +1 -1
@@ -1388,7 +1388,7 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *rfor (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;
Signature · 1 line
1.7.4.4
PATCH 2/2 snd-usb-audio: Replace mixer for Electrix Ebox-44
The mixer units from the firmware are corrupt, and even where they are valid they presents mono controls as L and R channels of stereo.
--- sound/usb/mixer_maps.c | 13 +++++++++ sound/usb/mixer_quirks.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 0 deletions(-)
sound/usb/mixer_maps.c +13 -0
@@ -288,6 +288,15 @@ static struct usbmix_name_map scratch_live_map[] = { { 0 } /* terminator */ }; +static struct usbmix_name_map ebox44_map[] = { + {4 ,NULL },/* FU */ + {6 ,NULL },/* MU */ + {7 ,NULL },/* FU */ + {10 ,NULL },/* FU */ + {11 ,NULL },/* MU */ + {0 } +}; +/* "Gamesurround Muse Pocket LT" looks same like "Sound Blaster MP3+" * most importand difference is SU[8], it should be set to "Capture Source" * to make alsamixer and PA working properly.
@@ -371,6 +380,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { .map = scratch_live_map, .ignore_ctl_error = 1, }, + { + .id = USB_ID(0x200c, 0x1018), + .map = ebox44_map, + }, { 0 } /* terminator */ };
sound/usb/mixer_quirks.c +67 -0
79 lines not on this page · raw message
Signature · 1 line
1.7.4.4
At Sat, 14 Apr 2012 17:19:23 +0100,
Quoted 6 lines · Mark Hills
Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them.
This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio.
Does the driver warn something? Ignoring silently doesn't sound right...
Takashi
Quoted 22 lines
Signed-off-by Mark Hills <[email protected]>--- sound/usb/mixer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)sound/usb/mixer.c +1
-1@@ -1388,7 +1388,7 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *rfor (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;Signature · 1 line
1.7.4.4
Quoted 11 lines · Takashi Iwai
At Sat, 14 Apr 2012 17:19:23 +0100,
Quoted 6 lines · Mark Hills
Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them.
This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio.
Does the driver warn something? Ignoring silently doesn't sound right...
Yes, parse_audio_unit already reports the error. Though I didn't do an exhaustive check for all cases.
The suggestion to do this came from Clemens (see thread "usb-audio:
Correct way to do a mixer quirk?"). Originally I was hoping to just quirk this for the specific device, but the rest of the driver does also seem to be fairly tolerant of errors if it means more devices can be used.
Quoted 26 lines
Takashi
Quoted 22 lines
Signed-off-by Mark Hills <[email protected]>--- sound/usb/mixer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)sound/usb/mixer.c +1
-1@@ -1388,7 +1388,7 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *rfor (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;Signature · 1 line
1.7.4.4
Signature · 1 line
Mark
At Sat, 14 Apr 2012 21:38:42 +0100 (BST),
Quoted 15 lines · Mark Hills
Quoted 11 lines · Takashi Iwai
At Sat, 14 Apr 2012 17:19:23 +0100,
Quoted 6 lines · Mark Hills
Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them.
This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio.
Does the driver warn something? Ignoring silently doesn't sound right...
Quoted 7 lines
Yes,
parse_audio_unitalready reports the error. Though I didn't do an exhaustive check for all cases.The suggestion to do this came from Clemens (see thread "usb-audio:
Correct way to do a mixer quirk?"). Originally I was hoping to just quirk this for the specific device, but the rest of the driver does also seem to be fairly tolerant of errors if it means more devices can be used.
OK, I merged your patches now to sound git tree topic/misc branch. Thanks!
Takashi
Quoted 31 lines
Quoted 27 lines
Takashi
Quoted 22 lines
Signed-off-by Mark Hills <[email protected]>--- sound/usb/mixer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)sound/usb/mixer.c +1
-1@@ -1388,7 +1388,7 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid, void *rfor (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;Signature · 1 line
1.7.4.4Signature · 1 line
Mark
Quoted 12 lines · Takashi Iwai
At Sat, 14 Apr 2012 17:19:23 +0100,
Quoted 6 lines · Mark Hills
Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them.
This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio.
Does the driver warn something? Ignoring silently doesn't sound right...
I had been looking into UAC2 device side driver. Debugging it, enlightened me of the mess the USB audio implementations are in. IMHO ALSA support usb audio better than AppleUSBAudio ... guess they are too embarrassed of the code that they no longer keep it public :D
Of course, major blame is on buggy implementation/reporting of configuration by the devices.
I was wondering if it would make sense for ALSA to first 'mend' any discrepancies in the reported configuration (say by having optional callbacks registered against vid/pid), and then instantiate the sound card which only refers to the cached sanitized configuration ?
That way, we could write usb-audio core to UAC specification, while keeping vendor specific hacks out separately. Or so do I think.
Regards.
-Jassi