[Bugfix] Autoscan when radio off hangs player, record static

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sat, 20 Jun 2026 11:43:15 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit ad64336e69b94f915fc12ebf8171879148557213
Author: William Wilgus <[email protected]>
Date:   Sat Jun 20 02:36:36 2026 -0400

    [Bugfix] Autoscan when radio off hangs player, record static
    
    Clipzip, ClipPlus other devices may be similar
    Autoscan from the main menu and the device hangs at scanning 88.1
    
    try to record with no station set and it just records static
    
    Change-Id: I59fe17dde80736e4fae8445c0aea7fcf5e476317

diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c
index eda11bce93..f4de98d60e 100644
--- a/apps/menus/radio_menu.c
+++ b/apps/menus/radio_menu.c
@@ -39,6 +39,9 @@ static int fm_recording_screen(void)
 {
     bool ret;
 
+    if (radio_get_current_frequency() == 0)
+        return 0;
+
     /* switch recording source to FMRADIO for the duration */
     int rec_source = global_settings.rec_source;
     global_settings.rec_source = AUDIO_SRC_FMRADIO;
diff --git a/apps/radio/presets.c b/apps/radio/presets.c
index 244c7e130e..0c80031fe3 100644
--- a/apps/radio/presets.c
+++ b/apps/radio/presets.c
@@ -679,6 +679,17 @@ int presets_scan(void *viewports)
         struct fmstation_buf *presets = presets_get();
         if (presets == NULL)
             return 1;
+        if(get_radio_status() == FMRADIO_OFF)
+        {
+            audio_stop();
+            /* turn on radio */
+            /* This should be done before touching audio settings */
+            while (!pcm_is_initialized())
+               sleep(0);
+
+            audio_set_input_source(AUDIO_SRC_FMRADIO, SRCF_FMRADIO_PLAYING);
+        }
+
         const struct fm_region_data * const fmr =
             &fm_region_data[global_settings.fm_region];
 
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs