Commit df86d114 authored by Heikki Lindholm's avatar Heikki Lindholm Committed by Jaroslav Kysela

[ALSA] add number of periods constraint to snd-aoa

The aoa driver is not specifying constraints on number of periods, and, it
seems, it might end with a non-integer number, which it cannot deal with.
Fix by adding a proper constraint.
Signed-off-by: default avatarHeikki Lindholm  <holindho@cs.helsinki.fi>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 7c7fc2d4
...@@ -194,6 +194,12 @@ static int i2sbus_pcm_open(struct i2sbus_dev *i2sdev, int in) ...@@ -194,6 +194,12 @@ static int i2sbus_pcm_open(struct i2sbus_dev *i2sdev, int in)
hw->period_bytes_max = 16384; hw->period_bytes_max = 16384;
hw->periods_min = 3; hw->periods_min = 3;
hw->periods_max = MAX_DBDMA_COMMANDS; hw->periods_max = MAX_DBDMA_COMMANDS;
err = snd_pcm_hw_constraint_integer(pi->substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0) {
result = err;
goto out_unlock;
}
list_for_each_entry(cii, &sdev->codec_list, list) { list_for_each_entry(cii, &sdev->codec_list, list) {
if (cii->codec->open) { if (cii->codec->open) {
err = cii->codec->open(cii, pi->substream); err = cii->codec->open(cii, pi->substream);
......
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