From e677895e29ba5bbe517f92980941c570fb92a932 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 29 Mar 2026 18:02:09 -0400 Subject: [PATCH] xrick: Fix a race condition that could result in audio stopping get_more() can disable audio when there's nothing more to genreate but that can get called (and "fail") _before_ we set the flag that audio is turned on. If this occurs, we will incorrecly set the "audio on" flag after the failure which will prevent the mixer from being re-started. (We're at the mercy of thread scheduling) Change-Id: I4f6c50a71c7ad685ff45f775e7e4b1c61b8b7777 --- apps/plugins/xrick/system/syssnd_rockbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/plugins/xrick/system/syssnd_rockbox.c b/apps/plugins/xrick/system/syssnd_rockbox.c index afd0766863..74edd98140 100644 --- a/apps/plugins/xrick/system/syssnd_rockbox.c +++ b/apps/plugins/xrick/system/syssnd_rockbox.c @@ -222,8 +222,8 @@ void syssnd_update(void) if (!isAudioPlaying && fillCount > 0) { - rb->mixer_channel_play_data(PCM_MIXER_CHAN_PLAYBACK, get_more, NULL, 0); isAudioPlaying = true; + rb->mixer_channel_play_data(PCM_MIXER_CHAN_PLAYBACK, get_more, NULL, 0); } } }