]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix snd_pcm_sw_params_set_period_event() implementation
authorJaroslav Kysela <perex@t61.perex-int.cz>
Tue, 23 Feb 2010 09:58:00 +0000 (10:58 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 23 Feb 2010 09:58:00 +0000 (10:58 +0100)
Fix the PCM timer open subdevice number in the pcm_hw plugin.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_hw.c

index b55791280026e27d1e4b75544b29cfa50abe42ea..265335cb4e4a7291ac317221ca3dc28e95d0aee0 100644 (file)
@@ -355,9 +355,9 @@ static int snd_pcm_hw_change_timer(snd_pcm_t *pcm, int enable)
        
        if (enable) {
                snd_timer_params_alloca(&params);
-               err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, hw->subdevice, SND_TIMER_OPEN_NONBLOCK | SND_TIMER_OPEN_TREAD);
+               err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, (hw->subdevice << 1) | (pcm->stream & 1), SND_TIMER_OPEN_NONBLOCK | SND_TIMER_OPEN_TREAD);
                if (err < 0) {
-                       err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, hw->subdevice, SND_TIMER_OPEN_NONBLOCK);
+                       err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, (hw->subdevice << 1) | (pcm->stream & 1), SND_TIMER_OPEN_NONBLOCK);
                        return err;
                }
                if (snd_timer_poll_descriptors_count(hw->period_timer) != 1) {