alsa-pcm: enable interrupts after alsa recovery

Interrupts are disabled in alsa_irq_wakeup_event -> playback_ready method
to not produce another wakeups when waiting for a new data. Interrupts are
enabled again when a new data arrives in a method spa_alsa_write.
In rare cases, when there is multiple streams providing data and one of
them is disconnected, a new data fails to be delivered and the spa_alsa_write
is not called. Not providing data produces underrun and alsa-pcm invokes
recovery process. Recovery process starts a new playback, but without interrupts
enabled is graph not triggered and new data are not delivered (to enable
interrupts). Recovery process keeps running in loop.
Now the interrupts are enabled again after the recovery and the starvation
should not occur.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
This commit is contained in:
Martin Geier 2024-04-16 09:28:49 +02:00
parent c2e539b780
commit 9afa0cd270

View file

@ -2601,6 +2601,7 @@ static inline int do_start(struct state *state)
} }
static inline int check_position_config(struct state *state, bool starting); static inline int check_position_config(struct state *state, bool starting);
static void update_sources(struct state *state, bool active);
static int alsa_recover(struct state *state) static int alsa_recover(struct state *state)
{ {
@ -2680,6 +2681,8 @@ recover:
if (follower != driver && follower->linked) if (follower != driver && follower->linked)
do_start(follower); do_start(follower);
} }
update_sources(state, true);
return 0; return 0;
} }