Skip to contentSkip to conversation

snd-usb-audio: Skip un-parseable mixer units instead of erroring

RFC New Mark Hills 1 participant 2 messages Apr 9, 2012 Sound

lore
Share & tools
lore

Mark Hills

author
#0 lore raw

RFC 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
index ab23869..c374c72 100644
@@ -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;
Signature · 1 line
1.7.4.4
author
#1 lore raw

RFC 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
index f1324c4..41daaa2 100644
@@ -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