From 916896c1cc7452c738ae4593aa9cbae7f14a32b0 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 6 Sep 2025 18:15:29 +0300 Subject: [PATCH] alsa: force IRQ scheduling for firewire in pro-audio profile FireWire ALSA driver latency is determined by the buffer size and not the period. Timer-based scheduling is then not really useful on these devices as the latency is fixed. In pro-audio profile, enable IRQ scheduling unconditionally for these devices, so that controlling the latency works properly. See #4785 --- spa/plugins/alsa/acp/acp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c index ecb017a9f..7fc749a7e 100644 --- a/spa/plugins/alsa/acp/acp.c +++ b/spa/plugins/alsa/acp/acp.c @@ -465,7 +465,14 @@ static int add_pro_profile(pa_card *impl, uint32_t index) } snd_ctl_close(ctl_hndl); - if (n_capture == 1 && n_playback == 1) { + /* FireWire ALSA driver latency is determined by the buffer size and not the + * period. Timer-based scheduling is then not really useful on these devices as + * the latency is fixed. Enable IRQ scheduling unconditionally for these devices, + * so that controlling the latency works properly. + */ + bool is_firewire = spa_streq(pa_proplist_gets(impl->proplist, "device.bus"), "firewire"); + + if ((n_capture == 1 && n_playback == 1) || is_firewire) { PA_IDXSET_FOREACH(m, ap->output_mappings, idx) { pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index); pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);