Skip to content

Commit

Permalink
ALSA: ice1712: fix: lock samplerate when samplerate locking is enabled
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Sebastien Alaiwan authored and Takashi Iwai committed Feb 5, 2010
1 parent c85a400 commit 350a514
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,10 @@ 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);
Expand All @@ -1197,6 +1201,11 @@ 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;
}

Expand Down

0 comments on commit 350a514

Please sign in to comment.