usb audio: Fix another Dallas quirk

Previous thread: usb audio: make quirk handling more readable, and fix commented-out code by Pavel Machek on Saturday, March 29, 2008 - 3:35 pm. (2 messages)

Next thread: [PATCH] es1968: fix jitter on some maestro cards by Andreas Mueller on Saturday, March 29, 2008 - 4:49 pm. (4 messages)
From: Pavel Machek
Date: Saturday, March 29, 2008 - 3:32 pm

Dallas USB speakers are buggy in more than one way. One of configs
they offer does not work at all.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 257a4e1..b6b2490 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
 	int format;
 	struct audioformat *fp;
 	unsigned char *fmt, *csep;
+	int num;
 
 	dev = chip->dev;
 
 	/* parse the interface's altsettings */
 	iface = usb_ifnum_to_if(dev, iface_no);
-	for (i = 0; i < iface->num_altsetting; i++) {
+	num = iface->num_altsetting;
+
+	/* Dallas DS4201 workaround: It presents 5 altsettings, but the last
+	   one misses syncpipe, and does not produce any sound. */
+	if (chip->usb_id == USB_ID(0x04fa, 0x4201))
+		num = 4;
+	
+	for (i = 0; i < num; i++) {
 		alts = &iface->altsetting[i];
 		altsd = get_iface_desc(alts);
 		/* skip invalid one */

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

From: Andrew Morton
Date: Tuesday, April 1, 2008 - 12:20 pm

On Sat, 29 Mar 2008 23:32:41 +0100

This is not a patch - something munched the "@@ -2676,12 +2676,23 @@"
line.

I typed it in again.
--

From: Pavel Machek
Date: Wednesday, April 2, 2008 - 5:49 am

Thanks a lot. I guess I did something wrong when hand-editing it.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

From: Takashi Iwai
Date: Monday, April 14, 2008 - 3:21 am

At Sat, 29 Mar 2008 23:32:41 +0100,

Applied this to ALSA tree, too.  Thanks.


--

Previous thread: usb audio: make quirk handling more readable, and fix commented-out code by Pavel Machek on Saturday, March 29, 2008 - 3:35 pm. (2 messages)

Next thread: [PATCH] es1968: fix jitter on some maestro cards by Andreas Mueller on Saturday, March 29, 2008 - 4:49 pm. (4 messages)