[ALSA] virtuoso: restrict period time to less than 10 s
authorClemens Ladisch <clemens@ladisch.de>
Tue, 13 May 2008 07:26:01 +0000 (09:26 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 19 May 2008 11:19:17 +0000 (13:19 +0200)
Add a constraint for the period time so that there are less than ten
seconds between interrupts so that ALSA does not assume that the device
is dead.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/oxygen/oxygen_pcm.c

index 09a16e459de991cec88675e18afb0add98847312..c4ad65a3406fd61ea6bcb016d8b979def759691a 100644 (file)
@@ -165,6 +165,12 @@ static int oxygen_open(struct snd_pcm_substream *substream,
                if (err < 0)
                        return err;
        }
+       if (channel == PCM_MULTICH) {
+               err = snd_pcm_hw_constraint_minmax
+                       (runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 0, 8192000);
+               if (err < 0)
+                       return err;
+       }
        snd_pcm_set_sync(substream);
        chip->streams[channel] = substream;