This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6174 - Plugins that use IRAM lock up when loaded while playing
Attached to Project:
Rockbox
Opened by Jared Stafford (jspenguin) - Friday, 13 October 2006, 06:21 GMT+2
Opened by Jared Stafford (jspenguin) - Friday, 13 October 2006, 06:21 GMT+2
|
DetailsSince plugins use the same IRAM space as codecs, whenever a plugin (such as mp3_encoder) copies it's data to IRAM, it overwrites the codec data. To fix this, there needs to be a plugin api function that unloads the codec and copies data to IRAM. This function would look like:
int plugin_copy_iram(void* iramstart, void* iramend, void* iramcopy, void* iedata, void* iend); |
This task depends upon
Calling rb->audio_stop(); by itself rb->sleep(1); seems to make it work on the current version, but it's just a hack.
The problem is that audio_stop() (in playback.c) yields until playing is false, but audio_stop_playback() (which is called from the audio thread) sets playing to false before it calls audio_stop_codec_flush(), which yields again, causing audio_stop to return before the codec is finalized and unloaded.
The solution is to set playing to false after the call to audio_stop_codec_flush().