This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12325 - e200v1 screen corruption after USB connection since r30475
Attached to Project:
Rockbox
Opened by Michael Chicoine (mc2739) - Sunday, 09 October 2011, 01:56 GMT+2
Last edited by Thomas Martitz (kugel.) - Friday, 28 October 2011, 18:55 GMT+2
Opened by Michael Chicoine (mc2739) - Sunday, 09 October 2011, 01:56 GMT+2
Last edited by Thomas Martitz (kugel.) - Friday, 28 October 2011, 18:55 GMT+2
|
DetailsSince r30475, I am seeing screen corruption of the statusbar and/or backdrop on e200v1.
Reproduction procedure: 1. From power off, connect device to computer 2. Safely remove device and disconnect USB cable 3. If corruption does not happen immediately on USB disconnect, press a button or rotate the wheel 4. Attempting to enter the View buflib allocs debug screen at this point causes the device to hardlock The corruption will also occur after connecting USB after device is already powered on, but it happens less often. r30471 does not have this problem. r30475 up to current svn will fail using this procedure. |
This task depends upon
Closed by Thomas Martitz (kugel.)
Friday, 28 October 2011, 18:55 GMT+2
Reason for closing: Fixed
Additional comments about closing: r30845
Friday, 28 October 2011, 18:55 GMT+2
Reason for closing: Fixed
Additional comments about closing: r30845
If theme is changed to cabbiev2, problem is reproduced exactly as Michael described (i.e., corruption occurs when wheel turned, locks up when "View buflib allocs" selected).
The rockbox.map file from a compile of r30764 shows the following at address 000719B4:
.text 0x00071820 0x300 /home/ubuntu/rockbox/build/firmware/libfirmware.a(font_cache.o)
0x0007182c search
0x000718e8 font_cache_get
0x00071a84 font_cache_create
Since r30475 is rather complex *and* both files have been changed since then for further buflib implementation, it can't be fixed by reverting r30475. A skin or font expert (like JD or Freddy) will need to look at it more closely.
FS#12310.FS#12310.Please re-test against latest svn r30812.
That does not help - I still get screen corruption after that change.
Remember, the issue only occurs reliably if the Sansa's power is *OFF* when you insert the USB cable (i.e., Sansa connector). Michael claims to have seen it sometimes with power on, but I've only seen it with power off.
Recent builds do not fail exactly the same as they did when this was first reported. I have an e260 that I use for testing (broken headphone jack) and it will no longer fail on r30835. This device failed consistently on earlier builds. My e280 still fails consistently on r30835. The main difference between the two devices is that the storage on the e260 is nearly empty and the storage on the e280 is approximately 80% full (about 2000 total files).
Hopefully that makes reproducing this in the sim possible. I haven't managed yet, though. Maybe you have more luck.
I was not able to get the sim to fail using the usb-sim.patch
Also, using r30844 with default settings, I have found these additional quirks:
1. clear the backdrop (Settings->Theme Settings->Clear Backdrop) and follow test procedure - it does not fail
2. clear the backdrop and follow test procedure, then go to Files->.rockbox->backdrops and highlight cabbiev2.bmp, access context menu and select Set As Backdrop - device hard locks
3. after clean power-up with no backdrop, go to Files->.rockbox->backdrops and highlight cabbiev2.bmp, access context menu and select Set As Backdrop - the backdrop is not displayed, but after power cycle it is displayed
4. I have not been able to reproduce the problem by connecting USB after device is powered up. I'm wondering now if I ever saw the corruption when connecting after power-up, or if some other change has helped in this situation
#3 reproduces as Michael described with both skins; in addition, it reproduces if you clear the backdrop & then try to set it again manually without powering down. (That's true whether the backdrop matches the skin or not.) However, if you clear the backdrop and then select a theme (same or different), the theme's backdrop loads properly whether you power-cycle or not.
Of course, #4 has been my experience all along; for me the issue *only* appeared when my e280 was powered up by USB connection.
The failure happened after the second simulated USB connection after starting the sim. Here is the console log at the time of the failure:
USB inserted. Waiting for 4632022 acks...
usb: got ack, 4632021 to go...
usb: got ack, 4632020 to go...
usb: got ack, 4632019 to go...
usb: got ack, 4632018 to go...
usb: got ack, 4632017 to go...
usb: got ack, 4632016 to go...
usb: got ack, 4632015 to go...
USB inserted. Waiting for 6 acks...
usb: got ack, 5 to go...
usb: got ack, 4 to go...
usb: got ack, 3 to go...
usb: got ack, 2 to go...
usb: got ack, 1 to go...
All threads have acknowledged the connect.
usb: got ack, 0 to go...
Subsequent tests would fail after various connection attempts, I did get a failure on the first connection, but sometimes up to 5 connections were needed to cause the failure.
Here is some info of the test setup:
1. win32 e200 sim r30844 running on win7 32 bit
2. There is a symlink to my music library in the symdisk folder - library is approx. 21.2GB, 5822 files, 1033 folders
After I disabled dircache, I was not able to reproduce the failure.
I was able to reproduce on the sim using my above patch. The key is to be really fast pressung U, since dircache scan is rather quickly done on a PC (with my SSD even more so).
The problem happens when the USB insertion interrupt the initial dircache scan. The scan is aborted, and the buffer is freed. However, allocated_size isn't set to 0, which makes the re-start of the scan take the first code path in dircache_build() even though no allocation exists.
dircache.c.vc.diff does seem to correct the screen corruption problems.
The problem with setting a backdrop and it not being displayed until reboot still occurs, but is probably not related - I'll open a new bug report for this.
/home/ubuntu/rockbox/firmware/common/dircache.c: In function ‘move_callback’:
/home/ubuntu/rockbox/firmware/common/dircache.c:153: warning: implicit declaration of function ‘_logf’
* * *
/home/ubuntu/rockbox/build/firmware/libfirmware.a(dircache.o): In function `move_callback':
dircache.c:(.text+0x15f0): undefined reference to `_logf'
dircache.c:(.text+0x15fc): undefined reference to `_logf'
dircache.c:(.text+0x1608): undefined reference to `_logf'
dircache.c:(.text+0x1614): undefined reference to `_logf'
dircache.c:(.text+0x1624): undefined reference to `_logf'
/home/ubuntu/rockbox/build/firmware/libfirmware.a(dircache.o):dircache.c:(.text+0x1704): more undefined references to `_logf' follow
collect2: ld returned 1 exit status
make: *** [/home/ubuntu/rockbox/build/rockbox.elf] Error 1
IMO Kugel's patch should be committed for 3.10; the remaining issue should continue in another bug report (as Michael suggested) for more work after 3.10.