Re: Need help with patch for #2724 (usbaudio, core)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Takashi Iwai wrote:
This is the right fix, too.  Of course, pcm-core should be more
robust, but the cause of the bug is the bogus entry.

Your patch does not change anything. I've enabled CONFIG_SND_VERBOSE_PRINTK, CONFIG_SND_DEBUG and CONFIG_SND_DEBUG_DETECT in the kernel config.

None of your snd_printd output gets triggered. I've placed a test output in pcm-native, so debugging works.

Note that I've applied your patch to 2.6.19.2.

The patch looks fine to me.  Please provide a proper changelog and a
sign-off for merging.

Done. The patch is against the current hg snapshot of alsa-kernel.

Gregor
From: Gregor Jasny <gjasny@xxxxxx>

This is a patch for ALSA Bug #2724. Some webcams provide bogus
settings with no valid rates. With this patch those are skipped.

Signed-off-by: Gregor Jasny <gjasny@xxxxxx>
diff -r b4265ee02e26 usb/usbaudio.c
--- a/usb/usbaudio.c	Wed Jan 31 10:35:19 2007 +0100
+++ b/usb/usbaudio.c	Wed Jan 31 12:20:29 2007 +0100
@@ -2463,6 +2463,7 @@ static int parse_audio_format_rates(stru
 		 * build the rate table and bitmap flags
 		 */
 		int r, idx, c;
+		unsigned int nonzero_rates = 0;
 		/* this table corresponds to the SNDRV_PCM_RATE_XXX bit */
 		static unsigned int conv_rates[] = {
 			5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000,
@@ -2485,6 +2486,7 @@ static int parse_audio_format_rates(stru
 			    fp->altsetting == 5 && fp->maxpacksize == 392)
 				rate = 96000;
 			fp->rate_table[r] = rate;
+			nonzero_rates |= rate;
 			if (rate < fp->rate_min)
 				fp->rate_min = rate;
 			else if (rate > fp->rate_max)
@@ -2499,6 +2501,10 @@ static int parse_audio_format_rates(stru
 			}
 			if (!found)
 				fp->needs_knot = 1;
+		}
+		if (!nonzero_rates) {
+			hwc_debug("All rates were zero. Skipping format!\n");
+			return -1;
 		}
 		if (fp->needs_knot)
 			fp->rates |= SNDRV_PCM_RATE_KNOT;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux