From: Jaroslav Kysela Date: Tue, 23 Feb 2010 09:58:00 +0000 (+0100) Subject: Fix snd_pcm_sw_params_set_period_event() implementation X-Git-Tag: v1.0.23~5 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=f1713475087027925358c3f9dd3db70723ed8d11;p=alsa-lib.git Fix snd_pcm_sw_params_set_period_event() implementation Fix the PCM timer open subdevice number in the pcm_hw plugin. Signed-off-by: Jaroslav Kysela --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index b5579128..265335cb 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -355,9 +355,9 @@ static int snd_pcm_hw_change_timer(snd_pcm_t *pcm, int enable) if (enable) { snd_timer_params_alloca(¶ms); - 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) {