From e24deccd0062e1485a4d94d218c8cd4984320af3 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 3 Oct 2025 09:54:46 +0100 Subject: [PATCH] sound: fix volume change being reported to %mv tag on boot Setting the last_volume_change time was moved here in commit 2e08b0f82e ("sound: update global volume state in sound_set_volume()"); however this also triggers the %mv tag on boot, as if the user was actively changing the volume. Move the last_volume_change update back to the original call sites to fix this. Change-Id: I895112cea4315f194f67c27839f1082d67c1ffa9 --- apps/gui/option_select.c | 3 +++ apps/misc.c | 1 + firmware/sound.c | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index a50a1c4dc7..c7eab6aba1 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -594,6 +594,9 @@ bool option_screen(const struct settings_list *setting, if (!cb_on_changed || (*variable != oldvalue)) { function(*variable); + /* if the volume is changing we need to let the skins know */ + if (function == sound_get_fn(SOUND_VOLUME)) + global_status.last_volume_change = current_tick; } } diff --git a/apps/misc.c b/apps/misc.c index 244f7c503f..af0cbaf519 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -879,6 +879,7 @@ void setvol(void) volume = global_settings.volume_limit; sound_set_volume(volume); + global_status.last_volume_change = current_tick; status_save(false); } diff --git a/firmware/sound.c b/firmware/sound.c index 798529af3e..6f6a37cca3 100644 --- a/firmware/sound.c +++ b/firmware/sound.c @@ -318,7 +318,6 @@ void sound_set_volume(int value) #ifndef BOOTLOADER global_status.volume = value; - global_status.last_volume_change = current_tick; #endif #if defined(AUDIOHW_HAVE_CLIPPING)