Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Clemens Ladisch" <cladisch@fastmail.net>
To: Richi Plana <richip@richip.dhs.org>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Frequency Problems with 0d8c:0201 and snd-usb-audio
Date: Fri, 17 Nov 2006 18:26:21 +0100	[thread overview]
Message-ID: <1163784381.27992.276274101@webmail.messagingengine.com> (raw)
In-Reply-To: <1163701408.3406.41.camel@richip.dhs.org>

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

  parent reply	other threads:[~2006-11-17 17:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 18:00 Frequency Problems with 0d8c:0201 and snd-usb-audio Richi Plana
2006-11-16  9:10 ` Clemens Ladisch
2006-11-16 17:08   ` Richi Plana
2006-11-16 17:26     ` Clemens Ladisch
2006-11-16 18:23       ` Richi Plana
2006-11-16 18:29         ` Richi Plana
2006-11-17 17:26         ` Clemens Ladisch [this message]
2006-11-17 18:57           ` Richi Plana
2006-11-20 13:54             ` Clemens Ladisch
2006-11-20 13:55             ` Clemens Ladisch
2006-11-17 19:39 ` Lee Revell
2006-11-20 13:54   ` Clemens Ladisch

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=1163784381.27992.276274101@webmail.messagingengine.com \
    --to=cladisch@fastmail.net \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=richip@richip.dhs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox