Commit f5e09ef0 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Takashi Iwai

[ALSA] at73c213: Add constraints for periods value

The interrupt handler always provide runtime->period_size data, so it
works correctly only if buffer_size was a multiple of period_size.

This patch fixes periodic click noise.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b32300a4
...@@ -210,7 +210,13 @@ static int snd_at73c213_pcm_open(struct snd_pcm_substream *substream) ...@@ -210,7 +210,13 @@ static int snd_at73c213_pcm_open(struct snd_pcm_substream *substream)
{ {
struct snd_at73c213 *chip = snd_pcm_substream_chip(substream); struct snd_at73c213 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
int err;
/* ensure buffer_size is a multiple of period_size */
err = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
return err;
snd_at73c213_playback_hw.rate_min = chip->bitrate; snd_at73c213_playback_hw.rate_min = chip->bitrate;
snd_at73c213_playback_hw.rate_max = chip->bitrate; snd_at73c213_playback_hw.rate_max = chip->bitrate;
runtime->hw = snd_at73c213_playback_hw; runtime->hw = snd_at73c213_playback_hw;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment