alsa-pcm: only disable IRQ when not batch

For batch devices we want to keep the IRQ so that the pointers are
updated with the period-size. Brings my UMC404HD to 4.8ms roundtrip
times with IRQ at 6 sample and batch enabled.
This commit is contained in:
Wim Taymans 2021-03-11 18:37:13 +01:00
parent b4cf78b5a6
commit 9cd9339c2a

View file

@ -559,9 +559,6 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
} }
} }
/* disable ALSA wakeups, we use a timer */
if (snd_pcm_hw_params_can_disable_period_wakeup(params))
CHECK(snd_pcm_hw_params_set_period_wakeup(hndl, params, 0), "set_period_wakeup");
/* set the sample format */ /* set the sample format */
spa_log_debug(state->log, NAME" %p: Stream parameters are %iHz fmt:%s access:%s-%s channels:%i", spa_log_debug(state->log, NAME" %p: Stream parameters are %iHz fmt:%s access:%s-%s channels:%i",
@ -616,6 +613,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
period_size /= 2; period_size /= 2;
spa_log_info(state->log, NAME" %s: batch mode, period_size:%ld", spa_log_info(state->log, NAME" %s: batch mode, period_size:%ld",
state->props.device, period_size); state->props.device, period_size);
} else {
/* disable ALSA wakeups, we use a timer */
if (snd_pcm_hw_params_can_disable_period_wakeup(params))
CHECK(snd_pcm_hw_params_set_period_wakeup(hndl, params, 0), "set_period_wakeup");
} }
CHECK(snd_pcm_hw_params_set_period_size_near(hndl, params, &period_size, &dir), "set_period_size_near"); CHECK(snd_pcm_hw_params_set_period_size_near(hndl, params, &period_size, &dir), "set_period_size_near");