aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorRaymond Yau <superquad.vortex2@gmail.com>2011-04-25 00:05:45 -0400
committerTakashi Iwai <tiwai@suse.de>2011-04-27 11:00:00 -0400
commit54a96dadaa2bbe81006c66447517b57534d80e7f (patch)
treea715ff6d1c192758bbb9472e92638e5718e49971 /sound
parent6a9a6f233baad76b67a448b39bb55fc064755ba4 (diff)
ALSA - au88x0 - Add buffer bytes constraints
This allow application such as gstreamer and wine which use snd_pcm_hw_params_set_buffer_time_near() won't fail any more since sound chips require special containt power 2 period bytes Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/au88x0/au88x0_pcm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 33f0ba5559a7..62e959120c44 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -44,10 +44,10 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
44 .channels_min = 1, 44 .channels_min = 1,
45 .channels_max = 2, 45 .channels_max = 2,
46 .buffer_bytes_max = 0x10000, 46 .buffer_bytes_max = 0x10000,
47 .period_bytes_min = 0x1, 47 .period_bytes_min = 0x20,
48 .period_bytes_max = 0x1000, 48 .period_bytes_max = 0x1000,
49 .periods_min = 2, 49 .periods_min = 2,
50 .periods_max = 32, 50 .periods_max = 1024,
51}; 51};
52 52
53#ifndef CHIP_AU8820 53#ifndef CHIP_AU8820
@@ -140,6 +140,9 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
140 SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0) 140 SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0)
141 return err; 141 return err;
142 142
143 snd_pcm_hw_constraint_step(runtime, 0,
144 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 64);
145
143 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { 146 if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
144#ifndef CHIP_AU8820 147#ifndef CHIP_AU8820
145 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) { 148 if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) {