FS#11722 - Runtime statistics data not gathered for first song played after power-on

Attached to Project: Rockbox
Opened by sideral (sideral) - Thursday, 04 November 2010, 17:15 GMT
Last edited by Jonathan Gordon (jdgordon) - Tuesday, 16 November 2010, 22:08 GMT
Task Type Bugs
Category Database
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The reason is that, depending on the thread scheduling, the tagtree_buffer_event function may attempt to access the tagcache before it is initialized.

I could reproduce this problem on my Sansa ClipV2, but not with the simulator, which had a slightly different schedule during startup.

When problem occurs, the debug logfiles shows this:

load track: /PODCASTS/foo.mp3
tc stat: not found: /PODCASTS/foo.mp3
loading tagcache to ram...
tagcache loaded into ram!
Request new track
codec >| audio Q_AUDIO_CHECK_NEW_TRACK
No tagcache index pointer found

As you can see, the tagcache is initialized after the first song is buffered. The "tc stat: not found" message is generated by tagtree_buffer_event, and the "No tagcache index pointer found" message is generated by tagtree_track_finish_event.

The attached patch fixes the problem by deferring the use of the tagcache until it has been initialized.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Tuesday, 16 November 2010, 22:08 GMT
Reason for closing:  Accepted
Additional comments about closing:  r28608: