This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12344 - Sansa Clip+: PANIC occurred when dircache is enabled
Attached to Project:
Rockbox
Opened by Akio Idehara (idak) - Saturday, 22 October 2011, 02:09 GMT+2
Last edited by MichaelGiacomelli (saratoga) - Sunday, 04 November 2012, 18:38 GMT+2
Opened by Akio Idehara (idak) - Saturday, 22 October 2011, 02:09 GMT+2
Last edited by MichaelGiacomelli (saratoga) - Sunday, 04 November 2012, 18:38 GMT+2
|
DetailsSansa Clip+: *PANIC* occurred when dircache is enabled. This occurred the simulator and the real target in r30819.
-- (1) Go "Settings" ->"General Settings" ->"System"->"Disk"->"Directory Cache" (2) Select "No" (3) Then Select "Yes" -- The simulator outputs the following. -- audio_reset_buffer_noalloc(): EOM (3960 > 3912) -- |
This task depends upon
Closed by MichaelGiacomelli (saratoga)
Sunday, 04 November 2012, 18:38 GMT+2
Reason for closing: Fixed
Additional comments about closing: Looks like this is fixed and just left open. If i'm wrong, please reopen.
Sunday, 04 November 2012, 18:38 GMT+2
Reason for closing: Fixed
Additional comments about closing: Looks like this is fixed and just left open. If i'm wrong, please reopen.
I bisecting this bug and I found this bug was introduced in r 30393.
The patch below does several things to improve the interaction between dircache / buflib / playback. It adds some code to buflib.c which tries to find the best match for the requested size instead of the first available. (i.e. it won't return a megabyte for core_alloc_max() when 6 megs contiguous are available in a higher block.) It resets the audio file buffer when playback is stopped to claim the largest hunk of memory for the file buffer. It shows size of val in the buflib debug menu. Finally, it updates some additional pointers during the buflib move callback for dircache. Unfortunately, you still have to stop playback after the initial dircache build is done to have fully compacted memory.
But I have one question about this patch.
Is "Please reboot to enable" message intentional?
(r30393 comment is "Allow dircache to be enabled without reboot.")
Applying 5.debug.patch, and
Splash message is "dircache memory allocation failed"
(2)
Applying 6.patch and Splash message is nothing.
# But playback is stopped.
(3)
Dircache Info is the following.
---
Cache initialized: Yes
Cache size: 1070835 B
Last size: 1070835 B
Limit: 6291456 B
Reserve: 3/65536 B
Scanning took: 0 s
Entry count: 12514
---
But in my opinion, resuming playback after stopping is more acceptable.
Please see
FS#12279and r30900http://www.rockbox.org/tracker/task/12279
http://svn.rockbox.org/viewvc.cgi?view=rev;revision=30900
Thank you very much for all your hard work.
On the iPod Video simulator: creating dircache after boot leaves a hole of ~6 megabytes for ~8000 files. Disabling the dircache after that leaves a hole of about 7 megs.
On the Sansa Fuzev1 target: First off, dircache has to be modified to work at all because audio_buffer_available gives a number about 256k too big to allocate. After that, dircache after boot leaves a hole of ~3.7 megs for ~7500 files. Disabling dircache after that leaves a hole of ~4.1 megs. That leaves about 930k for audio buffer which is just barely enough for the pcm buffer (i.e. almost nothing for file buffer). Inserting or removing cards causes a complete rebuild of the cache which fails.
I really think we need to force recompaction after freeing big hunks of memory as dircache does.
I'm preparing a patch that makes core_available() smarter, to count free space before the allocation end (and return the best contiguous size, if there's any unmovable alloc). I don't want to just compact in that function, I would rather keep that compaction can only happen at alloc-time (although that's an implementation detail).
1. Fix audio_buffer_available() to consider the 256K reserve buffer (trivial).
2. Make buflib_compact_and_shrink() smarter in that it considers free space before or after the alloc to be shrinked before shrinking, so that if something allocs 3MB and 2.5MB is free before the audio buffer only 0.5MB will be taken from it (implemented that already).
3. Make buflib_available() smarter to return the best contiguous free space, and not only the one at the end (I'm now considering doing a compaction here, since that'll simplify finding best, as it makes holes as contiguous as possible). Shrinkable allocs not going to be considered here, as it's not currently possible to peek what they are able to give. So this would return the maximum size that's guaranteed to be allocatable (again, without considering shrinking).
4. Make playback.c reclaim unused space on rebuffering or other times where it needn't to stop playback. I've done that a while ago locally but it's not as trivial as I thought. Will pick up the patch, hopefully.
What will still be problematic is how to make it possible to alloc the maximum buffer available (including parts from the audio buffer). Buflib can't peek into the audio buffer to see what can be shrinked, and playback can't look into buflib to see what's free right before its buffer. I tend to think an approach of trial and error (e.g try to allocate a lot, and retry with less until it succeeds) could work, however I would like to avoid it since means to stop playback more often.
Point 4) makes sure no memory is left unused.
For 4 I'm still exploring the best solution (so that reclaiming doesnt need stopping playback). Implementing that is not critical yet so I'm doing it separately.
The entire mechanism to shrink a buffer is a special case.
Did you gave that patch a test?
What about your dircache move callback fixes? will you commit them?
Why should I object?
*PANIC*
audio_reset_buffer_noalloc() : EOM (655 36 > 0)
and the screen is stucked there. I'm only able to shutdown, to start with the OF, that's all.
I'm not able to go to the menu. Somebody know what I could do ?
Thanks.