From 896cceee2413d72515c03e5a95b045063048e423 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Sun, 16 Nov 2025 15:17:47 +0000 Subject: [PATCH] usbaudio: triage panic from splash() Do the check in gui_wps_show() to avoid calling splash() from anything other than the main thread Change-Id: Icc1c6f287d82dc6e73b7cae9c75c18be73b82d48 --- apps/gui/wps.c | 11 +++++++++++ apps/playback.c | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 530307cb50..416653cf18 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -65,6 +65,10 @@ #include "skin_engine/wps_internals.h" #include "open_plugin.h" +#ifdef USB_ENABLE_AUDIO +#include "usbstack/usb_audio.h" +#endif + #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ /* 3% of 30min file == 54s step size */ #define MIN_FF_REWIND_STEP 500 @@ -713,6 +717,13 @@ static inline int action_wpsab_single(long button) */ long gui_wps_show(void) { +/* NOTE: if USBAudio ever gets its own DSP channel, this block can go away! */ +#ifdef USB_ENABLE_AUDIO + if (usb_audio_get_active()) + { + splash(HZ*2, ID2P(LANG_USB_DAC_ACTIVE)); + } +#endif long button = 0; bool restore = true; bool exit = false; diff --git a/apps/playback.c b/apps/playback.c index c81db5cc3c..f8971cca8c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2984,11 +2984,14 @@ static void audio_on_track_changed(void) static void audio_start_playback(const struct audio_resume_info *resume_info, unsigned int flags) { -/* NOTE: if USBAudio ever gets its own DSP channel, this block can go away! */ +/* + * Refuse to start playback if usb audio is active. See gui_wps_show() for + * a splash message to the user. + * NOTE: if USBAudio ever gets its own DSP channel, this block can go away! + */ #ifdef USB_ENABLE_AUDIO if (usb_audio_get_active()) { - splash(HZ*2, ID2P(LANG_USB_DAC_ACTIVE)); queue_reply(&audio_queue, 0); return; }