Rockbox Development > Feature Ideas

not freeze upon ogg playback

<< < (3/3)

linuxstb:
As far as I know, Rockbox supports floor0 vorbis files, but the problem with them is that they need a lot of memory to decode.  This should have improved with a recent commit (which in effect gives more working memory to codecs) - are you running a current version of Rockbox (one later than r18834) ?

The explanation why it's not reasonable for Rockbox to support chained ogg files is simply because Ogg is a badly designed format (for resource-restricted devices).  (This is all just my understanding - and a description of what Rockbox currently does - if it's wrong, I would be very happy to be corrected).

The header of an Ogg file doesn't include the total length of the file.  In order to calculate this length, Rockbox has to seek to the end of the file, and work backwards to find the start of the last "page" in the file.  It then reads the "granule position" of that last page, and uses that to calculate the length of the file.

If that wasn't bad enough, chained ogg files are simply standard Ogg files concatentated together.  There is no extra information at the start of the file to indicate that this file contains multiple Ogg files.  So in order for any player to show you the information on the individual tracks, it needs to read the entire file and walk through it from start to end, to find individual tracks.

Ogg files should contain a unique "serial number" in the page headers, and Rockbox contains code which compares the serial number of the first page in a file with the serial number of the last page.  If these numbers are different, then it assumes it's a chained ogg file, and (should) reject it.

Which I think may be your problem - I remember Rockbox just going into an infinite loop when presented with a playlist where every file is rejected.  Try putting a valid file (e.g. an mp3) in the same directory and see if Rockbox plays that.

Lear:
For chained files, the lack of a real malloc in the Rockbox codec is probably the biggest problem right now. When switching to a new stream, it needs to free the Vorbis (or codec) allocations, but not the Ogg (container/file buffering) allocations. Changing the Ogg code to only use static buffers would work too.

Detecting (valid) chained files, and determine where each part starts (which is needed for seeking to work) does require a bit of searching/reading in the file, which can take a little while (and needs to be done by the metadata code), but it typically doesn't need to read the entire file to do this.

Navigation

[0] Message Index

[*] Previous page

Go to full version