1 From stable-bounces@linux.kernel.org Tue Feb 6 10:13:42 2007
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Tue, 06 Feb 2007 19:12:11 +0100
4 Subject: USB audio fixes 1
6 Message-ID: <s5h3b5jw3yc.wl%tiwai@suse.de>
8 From: Takashi Iwai <tiwai@suse.de>
10 [PATCH] usbaudio - Fix Oops with broken usb descriptors
12 This is a patch for ALSA Bug #2724. Some webcams provide bogus
13 settings with no valid rates. With this patch those are skipped.
15 Signed-off-by: Gregor Jasny <gjasny@web.de>
16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 Signed-off-by: Jaroslav Kysela <perex@suse.cz>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21 sound/usb/usbaudio.c | 6 ++++++
22 1 file changed, 6 insertions(+)
24 --- linux-2.6.20.1.orig/sound/usb/usbaudio.c
25 +++ linux-2.6.20.1/sound/usb/usbaudio.c
26 @@ -2456,6 +2456,7 @@ static int parse_audio_format_rates(stru
27 * build the rate table and bitmap flags
30 + unsigned int nonzero_rates = 0;
31 /* this table corresponds to the SNDRV_PCM_RATE_XXX bit */
32 static unsigned int conv_rates[] = {
33 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000,
34 @@ -2478,6 +2479,7 @@ static int parse_audio_format_rates(stru
35 fp->altsetting == 5 && fp->maxpacksize == 392)
37 fp->rate_table[r] = rate;
38 + nonzero_rates |= rate;
39 if (rate < fp->rate_min)
41 else if (rate > fp->rate_max)
42 @@ -2493,6 +2495,10 @@ static int parse_audio_format_rates(stru
46 + if (!nonzero_rates) {
47 + hwc_debug("All rates were zero. Skipping format!\n");
51 fp->rates |= SNDRV_PCM_RATE_KNOT;