linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ice1712: fix: lock samplerate when samplerate locking is enabled.
@ 2010-02-03 20:45 Sebastien Alaiwan
  2010-02-04  8:30 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastien Alaiwan @ 2010-02-03 20:45 UTC (permalink / raw)
  To: LKML

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.


diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index c7cff6f..4775626 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -1181,6 +1181,8 @@ static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *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))
+		snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, PRO_RATE_DEFAULT, PRO_RATE_DEFAULT);
 	if (ice->spdif.ops.open)
 		ice->spdif.ops.open(ice, substream);
 
@@ -1197,6 +1199,9 @@ 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))
+		snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, PRO_RATE_DEFAULT, PRO_RATE_DEFAULT);
+
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-05  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-02-04 21:20     ` Sebastien Alaiwan
2010-02-05  8:02       ` Takashi Iwai

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