linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ice1712: fix: lock samplerate when samplerate locking is enabled.
Date: Thu, 04 Feb 2010 21:52:11 +0100	[thread overview]
Message-ID: <4B6B337B.2070904@gmail.com> (raw)
In-Reply-To: <s5hzl3p768j.wl%tiwai@suse.de>


Takashi Iwai wrote:
> At Wed, 03 Feb 2010 21:45:34 +0100,
> Sebastien Alaiwan wrote:
>> Hello,
>>
>> I found that the sampling rate locking setting of the ice1712 sound driver was
>> only half-respected : when the driver was locked to, let's say, 44100Hz, and a
>> usermode app was requesting 48000Hz playback, the request was succesful although
>> the soundcard would continue to run at 44100Hz.
>>
>> Here's a patch that will make those requests to fail.
> 
> Thanks, the patch looks OK.  But changing runtime->hw.rate_min and
> rate_max would be cheaper.  It won't involve with kmalloc().
> In theory, snd_pcm_hw_constraint*() can fail.
> 
> Could you fix in that way and give your sign-off to merge to the
> upstream?  (And don't forget to add me to Cc.)

Thank you for reviewing my patch. Here's an updated version according to your
advice. You can merge to the upstream if it's okay.

Sebastien Alaiwan

------
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index c7cff6f..319df17 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -1180,6 +1180,11 @@ static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream)
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
 	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
+	if (is_pro_rate_locked(ice))
+	{
+		runtime->hw.rate_min = PRO_RATE_DEFAULT;
+		runtime->hw.rate_max = PRO_RATE_DEFAULT;
+	}
 
 	if (ice->spdif.ops.open)
 		ice->spdif.ops.open(ice, substream);
@@ -1197,6 +1202,12 @@ static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream)
 	snd_pcm_set_sync(substream);
 	snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
 	snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
+	if (is_pro_rate_locked(ice))
+	{
+		runtime->hw.rate_min = PRO_RATE_DEFAULT;
+		runtime->hw.rate_max = PRO_RATE_DEFAULT;
+	}
+
 	return 0;
 }
 

  reply	other threads:[~2010-02-04 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 20:45 [PATCH] ice1712: fix: lock samplerate when samplerate locking is enabled Sebastien Alaiwan
2010-02-04  8:30 ` Takashi Iwai
2010-02-04 20:52   ` Sebastien Alaiwan [this message]
2010-02-04 21:20     ` Sebastien Alaiwan
2010-02-05  8:02       ` Takashi Iwai

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=4B6B337B.2070904@gmail.com \
    --to=sebastien.alaiwan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).