FS#12869 - ClipV1 opus file playback: no metadata, and some (low bitrate) files crash the player

Attached to Project: Rockbox
Opened by Ivan Privaci (Epicanis) - Thursday, 06 June 2013, 00:46 GMT
Task Type Bugs
Category Codecs
Status Unconfirmed
Assigned To No-one
Operating System Sansa AMSv1
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


First noticed the issue in the previous dev build, and just confirmed in 15fa7f8.

When playing .opus files, no metadata is displayed. Some files (92kbit stereo music files so far) do play fine otherwise. Others induce crashes upon attempting to play. An example is attached.

First test, I played a couple of music files successfully, then tried to play the attached file. System crashed immediately showing the following:
"Undefined instruction
pc:30000002 sp:300632[display cuts off here]
bt end"

Powered off, restarted, and tried to play the attached file immediately. After a second or so of audio, player crashed again:
"Undefined instruction
pc:08180002 sp:302029[display cuts off here]
bt end"

On the previous dev build, I was getting similar errors if I tried to play the attached file (or several other similar ones) after successfully playing other files, but would get a black-screen crash if I tried to play it immediately on powerup (this is not what is happening on 15fa7f8).

I am NOT experiencing these problems on another AMSv1 player (Sansa c240 ["c200v1"]) with the same dev build, so this may be specific to the Clipv1. On the c240 with both the previous build and 15fa7f8, metadata displays fine and the attached file plays without any apparent error.
This task depends upon

Comment by Nils Wallménius (nls) - Sunday, 09 June 2013, 20:50 GMT
This is caused by a bug in the opus codec where it's not checking if a specific alloc fails, and it does fail on the clipv1 since it has a very small codec buffer.
Memory use is significantly reduced in upstream opus git (what will be released as 1.1) and i'm syncing up the rockbox codec to that so it should get merged into rockbox in the near future. Hopefully this will bring the memory usage down enough to make it work on the clipv1
Comment by Nils Wallménius (nls) - Monday, 25 August 2014, 19:57 GMT
The crashing should be fixed now but files like the attached example will probably not play on the clip v1 due to the small codec buffer. A cleverer allocation scheme and some memory use optimizations would help.