From f1521929618315c617e0b5a683400a03a63152cc Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Thu, 25 Jun 2026 22:47:54 -0300 Subject: [PATCH] emulationstation: navigation sounds toggle takes effect without reboot A user reported (and it reproduces on hardware) that turning "ENABLE NAVIGATION SOUNDS" on in Sound Settings does nothing until the device is rebooted. Root cause: Sound::init() loaded the WAV sample only when EnableSounds was already true: if (!Settings::getInstance()->getBool("EnableSounds")) return; mSampleData = Mix_LoadWAV(...); So when the frontend starts with sounds disabled, every Sound keeps a null sample; flipping the menu switch only writes the setting and never reloads the samples, so play() bails on the null sample. Only the next boot re-runs init() with the setting true and finally loads them. Sound::play() already checks the live EnableSounds value, so the init-time gate is redundant for correctness and harmful for runtime toggling. Drop it (new patch, first under this package's patches/) so samples always load and the toggle works immediately, both directions, no reboot. Memory cost is a handful of small navigation WAVs. Pending validation: takes effect after the ES package is rebuilt. Co-Authored-By: Claude Opus 4.8 --- ...av-sounds-regardless-of-EnableSounds.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 projects/ArchR/packages/ui/emulationstation/patches/0001-sound-load-nav-sounds-regardless-of-EnableSounds.patch diff --git a/projects/ArchR/packages/ui/emulationstation/patches/0001-sound-load-nav-sounds-regardless-of-EnableSounds.patch b/projects/ArchR/packages/ui/emulationstation/patches/0001-sound-load-nav-sounds-regardless-of-EnableSounds.patch new file mode 100644 index 0000000000..6e6cc7608e --- /dev/null +++ b/projects/ArchR/packages/ui/emulationstation/patches/0001-sound-load-nav-sounds-regardless-of-EnableSounds.patch @@ -0,0 +1,23 @@ +sound: load navigation sounds regardless of EnableSounds + +Sound::init() loaded the WAV only when EnableSounds was already true, so +toggling "ENABLE NAVIGATION SOUNDS" on in Sound Settings left every Sound +with a null sample until the next reboot (when init() re-ran with the +setting now true). Sound::play() already gates on the live EnableSounds +value, so loading the sample unconditionally is enough and makes the menu +toggle take effect immediately, in both directions, with no reboot. + +Reported by a user and reproduced on hardware. + +--- a/es-core/src/Sound.cpp ++++ b/es-core/src/Sound.cpp +@@ -67,9 +67,6 @@ + if (mPath.empty() || !Utils::FileSystem::exists(mPath)) + return; + +- if (!Settings::getInstance()->getBool("EnableSounds")) +- return; +- + //load wav file via SDL + mSampleData = Mix_LoadWAV(mPath.c_str()); + if (mSampleData == nullptr)