From: Daniel Mack <zonque@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Daniel Mack <zonque@gmail.com>
Subject: [PATCH 1/5] ALSA: snd-usb: don't fail hard if mixer creation fails
Date: Wed, 13 Jul 2011 02:13:25 +0200 [thread overview]
Message-ID: <1310516009-4387-1-git-send-email-zonque@gmail.com> (raw)
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
next reply other threads:[~2011-07-13 0:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 0:13 Daniel Mack [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310516009-4387-1-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.