]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: bcm2835-audio: Add 10ms period constraint
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 15:58:46 +0000 (17:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Sep 2018 09:14:59 +0000 (11:14 +0200)
It seems that the resolution of vc04 callback is in 10 msec; i.e. the
minimal period size is also 10 msec.

This patch adds the corresponding hw constraint.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c

index 9659c25b9f9dddc4ea5f58b6fd3a3ed2b76b0d8d..6d89db6e14e4a82e19479c8401da428c52f35f97 100644 (file)
@@ -145,6 +145,11 @@ static int snd_bcm2835_playback_open_generic(
                                   SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
                                   16);
 
+       /* position update is in 10ms order */
+       snd_pcm_hw_constraint_minmax(runtime,
+                                    SNDRV_PCM_HW_PARAM_PERIOD_TIME,
+                                    10 * 1000, UINT_MAX);
+
        chip->alsa_stream[idx] = alsa_stream;
 
        chip->opened |= (1 << idx);