FS#9332 - Read audio data directly from flash memory
Opened by Nicolas Pennequin (nicolas_p) - Thursday, 28 August 2008, 12:30 GMT
|
DetailsThis patch provides a replacement for buffering.c, where there is only minimal buffering (one 32K buffer for audio data and some static buffers for metadata). It is a proof of concept for how this could work on targets with very little RAM.
I would be interested in feedback on the kind of impact this has on runtime, so if you have a flash target please consider giving it a try and reporting your results :) Note that you will need to disable album art in your build for this to work. I don't even know what would happen if you don't, but it'd probably be bad. To disable it you need to comment or remove the #define HAVE_ALBUMART line in your target's configuration file (firmware/export/config-[TARGET].h). |
i just wanted to try this code on a m200v4 (only 2MB ram) as we have trouble with the normal buffering code.
Unfortunatly this patch is outdated ( EVENT_HANDLE_FINISHED does not exist anymore), and i am unable to fix it.
Would be very nice if you could sync this to svn.
Except that, the patch works very fine on Clip.
[edit] OK, found te problem : the thread event loop needs to handle SYS_USB_CONNECTED (in the same way as buffering.c)
low-bitrate MP3 and -q5 Vorbis: Mostly works.
AAC: Fails because the AAC codec apparently isn't built for targets with 2MB or less of RAM
FLAC: Fails to play and often leads to a SD RX buffer underrun (don't remember the exact wording and have rockbox uninstalled from my 2 clips)
For what it's worth, I suspect the failures I'm experiencing have more to do with bitrate than codec.
Ogg, mp3, and WAV seem to work and FLAC and SHN throw codec errors when I try to play them.
When I shut down after I try to play FLAC or SHN, I get the following error:
*PANIC*
SD : RX OVERRUN, RXR
FIFO FULL,
* Use an unsigned int thread id for the buffering thread instead of a struct thread_entry pointer
* Fix warnings about unused parameters
* Add return value for functions need to do so (functions returning a size_t return a 0 now)
* Copy SYS_USB_CONNECTED handler from buffering.c
* fixed missing break
* implemented functions buf_handle_offset and buffer_get_debugdata (returns mostly 0)
* changed strncpy to strlcpy as suggested by than0 on IRC
add missing argument to bufopen() : needed for albumart but not implemented