diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-09-16 23:16:05 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-20 08:57:00 +0200 |
commit | 5495ffbd7b56d8bffebc5e30f03ea374590f1bb4 (patch) | |
tree | ef265f6de4b7c4e64a53f6618b129583d3ae6b0b | |
parent | 57e5c63007955838043e34c732d224b2cbbb128f (diff) |
ALSA: via82xx: allow to disable the SRC
Add the PCM rule to allow disabling the PCM playback SRC.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/via82xx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 35d5f4313d99..c3656fffdb50 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -1175,6 +1175,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev, struct snd_pcm_runtime *runtime = substream->runtime; int err; struct via_rate_lock *ratep; + bool use_src = false; runtime->hw = snd_via82xx_hw; @@ -1196,6 +1197,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev, SNDRV_PCM_RATE_8000_48000); runtime->hw.rate_min = 8000; runtime->hw.rate_max = 48000; + use_src = true; } else if (! ratep->rate) { int idx = viadev->direction ? AC97_RATES_ADC : AC97_RATES_FRONT_DAC; runtime->hw.rates = chip->ac97->rates[idx]; @@ -1212,6 +1214,12 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev, if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) return err; + if (use_src) { + err = snd_pcm_hw_rule_noresample(runtime, 48000); + if (err < 0) + return err; + } + runtime->private_data = viadev; viadev->substream = substream; |