All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ALSA: snd-usb: don't fail hard if mixer creation fails
@ 2011-07-13  0:13 Daniel Mack
  2011-07-13  0:13 ` [PATCH 2/5] ALSA: snd-usb: use snd_printk() instead of printk() Daniel Mack
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Daniel Mack @ 2011-07-13  0:13 UTC (permalink / raw)
  To: alsa-devel; +Cc: Daniel Mack

There are cards that the mixer code fails to create controls for, and
currently, the whole sound device creation fails in such cases. This
patch changes the code so that it just spits out warnings and continues
looking at other functions of the descriptor set which might work just
fine.

The worst thing that can happen now is that people see soundcards that
don't have all funcions supported, but rejecting the whole device is
not any better.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/usb/card.c  |    5 ++---
 sound/usb/mixer.c |    9 ++++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 220c616..8990b49 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -512,9 +512,8 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
 	if (err > 0) {
 		/* create normal USB audio interfaces */
 		if (snd_usb_create_streams(chip, ifnum) < 0 ||
-		    snd_usb_create_mixer(chip, ifnum, ignore_ctl_error) < 0) {
-			goto __error;
-		}
+		    snd_usb_create_mixer(chip, ifnum, ignore_ctl_error) < 0)
+			snd_printk(KERN_WARNING "snd_usb_create_mixer() failed\n");
 	}
 
 	/* we are allowed to call snd_card_register() many times */
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c22fa76..c43dbea 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1967,7 +1967,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
 			state.oterm.name = desc->iTerminal;
 			err = parse_audio_unit(&state, desc->bSourceID);
 			if (err < 0)
-				return err;
+				snd_printk(KERN_WARNING "Unable to parse terminal with bSourceID %d\n",
+					   desc->bSourceID);
 		} else { /* UAC_VERSION_2 */
 			struct uac2_output_terminal_descriptor *desc = p;
 
@@ -1979,12 +1980,14 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
 			state.oterm.name = desc->iTerminal;
 			err = parse_audio_unit(&state, desc->bSourceID);
 			if (err < 0)
-				return err;
+				snd_printk(KERN_WARNING "Unable to parse terminal with bSourceID %d\n",
+					   desc->bSourceID);
 
 			/* for UAC2, use the same approach to also add the clock selectors */
 			err = parse_audio_unit(&state, desc->bCSourceID);
 			if (err < 0)
-				return err;
+				snd_printk(KERN_WARNING "Unable to parse clock terminal with bCSourceID %d\n",
+					   desc->bCSourceID);
 		}
 	}
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-13 12:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13  0:13 [PATCH 1/5] ALSA: snd-usb: don't fail hard if mixer creation fails Daniel Mack
2011-07-13  0:13 ` [PATCH 2/5] ALSA: snd-usb: use snd_printk() instead of printk() Daniel Mack
2011-07-13  5:31   ` Takashi Iwai
2011-07-13  0:13 ` [PATCH 3/5] ALSA: snd-usb: be more verbose about bogus UAC_FORMAT_TYPE descriptors Daniel Mack
2011-07-13  0:13 ` [PATCH 4/5] ALSA: snd-usb: ignore mixer units of type UAC2_EXTENSION_UNIT_V2 Daniel Mack
2011-07-13  0:13 ` [PATCH 5/5] ALSA: snd-usb: Accept UAC2 FORMAT_TYPE descriptors with bLength > 6 Daniel Mack
2011-07-13  5:29 ` [PATCH 1/5] ALSA: snd-usb: don't fail hard if mixer creation fails Takashi Iwai
2011-07-13 12:06   ` Daniel Mack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.