• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System Sansa e200
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by MartinR - 2009-03-12
Last edited by fg - 2009-09-09

FS#10011 - The USB disconnect feature disconnects without prior ejecting or savely removing in Windows

The USB disconnect feature introduced in r20244 disconnects even if the drives are currently in use by Windows. Unlike said in the manual, no eject or savely remove is needed. When pressing Select while copying a file from DAP to PC, it immediately leaves the USB screen and I can browse the menu while the copy operation still goes on. Right after the file has finished (no corruption), the drives get inaccessible.

Also, this feature doesn’t respect the ‘First Keypress Enables Backlight Only’ option. I used to press Select to turn on the backlight to see how far the charging is (or to test the backlight fading). This now kicks me out of MSC mode every time.

Closed by  fg
2009-09-09 18:34
Reason for closing:  Fixed
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Disconnect was removed a while ago

fg commented on 2009-03-12 21:31

The current code releases locks when a bus reset occurs. That's probably not a very smart thing to do (I'll fix). For some reason some people are seeing those again… The second issue is because I just check for button status in the USB screen event loop, I don't actually get a button press from the button queue. I wouldn't mind (someone) doing this differently, but I definitely don't know much about UI code

fg commented on 2009-03-13 21:15

Can you check if this patch fixes the locking issue?

Unfortunately, your patch doesn't change anything for me. I investigated a bit and found out that Windows uses SCSI_ALLOW_MEDIUM_REMOVAL only during write operations. So, the code actually behaves as intended, but Windows doesn't.

Some thoughts about this. Windows seems to put the device in suspend mode on "safely removing". USBSTS_SUSPEND is set and USBINTR_DEVICE_SUSPEND is fired then.
IIUC, we should be able to automatically leave MSC mode if either all LUNs are ejected or the USB controller enters suspend mode. But Linux usually doesn't suspend the device on dismounting. We would still have to use the button there. But as Windows doesn't lock the LUNs properly, the button has to be blocked with Windows. So we would need to distinguish between Windows and Linux within Rockbox, which I think is somehow fishy.


Available keyboard shortcuts


Task Details

Task Editing