All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Torstein Hegge <hegge@resisty.net>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: usb: Work around CM6631 sample rate change bug
Date: Sat, 02 Mar 2013 14:12:33 +0100	[thread overview]
Message-ID: <5131FAC1.30007@gmail.com> (raw)
In-Reply-To: <20130302130403.GD4452@pvv.ntnu.no>

On 02.03.2013 14:04, Torstein Hegge wrote:
> The C-Media CM6631 USB-to-S/PDIF receiver doesn't respond to changes in
> sampling frequency while the interface is active.
> 
> Reset the interface after setting the sampling frequency, to ensure that the
> sample rate set by snd_usb_init_sample_rate() is used. Otherwise, the device
> will try to use the sample rate of the previous file, causing distorted sound
> on sample rate changes.
> 
> Signed-off-by: Torstein Hegge <hegge@resisty.net>

Acked-by: Daniel Mack <zonque@gmail.com>


Thanks!

Daniel


> ---
>  sound/usb/pcm.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index d82e378..01978a6 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -710,6 +710,16 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
>  		subs->need_setup_ep = false;
>  	}
>  
> +	/* Some devices doesn't respond to sample rate changes while the
> +	 * interface is active. */
> +	switch (subs->stream->chip->usb_id) {
> +	case USB_ID(0x0d8c, 0x0304): /* C-Media - Schiit USB Interface */
> +	case USB_ID(0x0d8c, 0x0309): /* C-Media CM6631 */
> +		usb_set_interface(subs->dev, subs->cur_audiofmt->iface,
> +					subs->cur_audiofmt->altset_idx);
> +		break;
> +	}
> +
>  	/* some unit conversions in runtime */
>  	subs->data_endpoint->maxframesize =
>  		bytes_to_frames(runtime, subs->data_endpoint->maxpacksize);
> 

  reply	other threads:[~2013-03-02 13:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02 13:04 [PATCH] ALSA: usb: Work around CM6631 sample rate change bug Torstein Hegge
2013-03-02 13:12 ` Daniel Mack [this message]
2013-03-03 19:29   ` Torstein Hegge
2013-03-04  8:53     ` Takashi Iwai
2013-03-04 10:31       ` Clemens Ladisch
2013-03-04 21:33         ` Torstein Hegge
2013-03-05  7:55           ` Clemens Ladisch
2013-03-05 10:22             ` Torstein Hegge
2013-03-05 10:35               ` Clemens Ladisch
2013-03-05 21:24                 ` Torstein Hegge
2013-03-05 21:39                   ` Clemens Ladisch
2013-03-04 21:29       ` Torstein Hegge

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=5131FAC1.30007@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=hegge@resisty.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.