Re: Frequency Problems with 0d8c:0201 and snd-usb-audio

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

 



Richi Plana wrote:
> On Thu, 2006-11-16 at 18:26 +0100, Clemens Ladisch wrote:
> > What kind of distortion?
> 
> As objectively as I can describe it: the audio played at 48 kHz seems to
> be coming out at the right speed, but the sound itself is played at a
> higher pitch.
> 
> Playback:
>   Status: Running
>     Packet Size = 392
>     Momentary freq = 48000 Hz (0x30.0000)

This device has two configuration that are supposed to support 48 kHz,
but the second one (that is used by the driver) has a packet size that
would be about right for 96 kHz.

Please try the patch below.


HTH
Clemens


--- alsa.orig/alsa-kernel/usb/usbaudio.c	2006-11-14 21:02:42.000000000 +0100
+++ alsa/alsa-kernel/usb/usbaudio.c	2006-11-16 23:04:29.000000000 +0100
@@ -2478,7 +2478,13 @@ static int parse_audio_format_rates(stru
 		fp->nr_rates = nr_rates;
 		fp->rate_min = fp->rate_max = combine_triple(&fmt[8]);
 		for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
-			unsigned int rate = fp->rate_table[r] = combine_triple(&fmt[idx]);
+			unsigned int rate = combine_triple(&fmt[idx]);
+			/* C-Media CM6501 mislabels its 96 kHz altsetting */
+			if (rate == 48000 && nr_rates == 1 &&
+			    chip->usb_id == USB_ID(0x0d8c, 0x0201) &&
+			    fp->altsetting == 5 && fp->maxpacksize == 392)
+				rate = 96000;
+			fp->rate_table[r] = rate;
 			if (rate < fp->rate_min)
 				fp->rate_min = rate;
 			else if (rate > fp->rate_max)

-------------------------------------------------------------------------
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