FS#12747 - Archos Ondio panic on starting FM Radio

Attached to Project: Rockbox
Opened by Daithi O'Cuinn (depoch) - Tuesday, 04 September 2012, 16:21 GMT
Last edited by Dominik Riebeling (bluebrother) - Monday, 09 September 2013, 16:22 GMT
Task Type Bugs
Category FM Tuner
Status Closed
Assigned To No-one
Operating System Archos Ondio
Severity Low
Priority Normal
Reported Version Release 3.10
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I get a problem on my Archos Ondio FM with both the latest dev build and the last official load. When I try to start the FM Radio player, I get "PANIC Recfile:-1"
I have a workaround where if I start the recorder beforehand and make a recording, the radio can then be started. (I must actually make a recording, it is not enough just to enter the screen).
This task depends upon

Closed by  Dominik Riebeling (bluebrother)
Monday, 09 September 2013, 16:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with g#614
Comment by Dominik Riebeling (bluebrother) - Tuesday, 04 September 2012, 16:39 GMT
Could this be related to  FS#12743 ?
Comment by Dominik Riebeling (bluebrother) - Tuesday, 04 September 2012, 18:19 GMT
Ok, after bisecting  FS#12743  it doesn't look related anymore (the offending change / file isn't compiled for Ondio).
Comment by Ludovic Jacques (lebellium) - Monday, 26 August 2013, 16:19 GMT
I also have this issue on my Ondio FM (old PCB v2.2 with Samsung FM chip)
I finally found the 1st bad commit: f78bcb1 (r31038) dated 21 nov 2011;a=commit;h=f78bcb165f7be0459ac951d7d71e24907febc32b
I hope it helps :)

Comment by Dominik Riebeling (bluebrother) - Monday, 26 August 2013, 19:31 GMT
Playing a bit around revealed the following workaround to "fix" the issue:

diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index fd8381e..df1c9c0 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -172,7 +172,7 @@ void settings_apply_skins(void)
skins[i][j].gui_wps.display = &screens[j];
- if (skin_helpers[i].load_on_boot)
+ //if (skin_helpers[i].load_on_boot)
skin_get_gwps(i, j);

This somewhat revert the intention of r31038, so it's obvious that this doesn't address the real cause. I'm not familiar enough with that code to see what's the problem right now. It would be interesting to check if this also affects the recorderfm, right now it seems to affect only b&w devices.
Comment by Jonathan Gordon (jdgordon) - Wednesday, 28 August 2013, 09:49 GMT
OK, the problem looks like mpeg.c is setting up the radio/recording buffers before the skin is loaded and not being reinintalised correctly (the audiobuffer pointer will move around when the skin is loaded). So the fix is to rearrange the radio init code to swap the order, or set the radio load_on_boot flag to true on HWCODEC