Commit 54a96dad authored by Raymond Yau's avatar Raymond Yau Committed by Takashi Iwai

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: default avatarRaymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6a9a6f23
...@@ -44,10 +44,10 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = { ...@@ -44,10 +44,10 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
.channels_min = 1, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.buffer_bytes_max = 0x10000, .buffer_bytes_max = 0x10000,
.period_bytes_min = 0x1, .period_bytes_min = 0x20,
.period_bytes_max = 0x1000, .period_bytes_max = 0x1000,
.periods_min = 2, .periods_min = 2,
.periods_max = 32, .periods_max = 1024,
}; };
#ifndef CHIP_AU8820 #ifndef CHIP_AU8820
...@@ -140,6 +140,9 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) ...@@ -140,6 +140,9 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0) SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0)
return err; return err;
snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 64);
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) { if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
#ifndef CHIP_AU8820 #ifndef CHIP_AU8820
if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) { if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_A3D) {
......
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