Rockbox

Tasklist

FS#7691 - Improved PP (ipod) USB detection

Attached to Project: Rockbox
Opened by Dave Chapman (linuxstb) - Saturday, 01 September 2007, 18:00 GMT
Last edited by Dave Chapman (linuxstb) - Tuesday, 04 September 2007, 08:03 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System PortalPlayer-based
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch (hopefully) improves the USB detection on PortalPlayer targets, fixing the following bugs:

1) MENU needed to be held for a long time (10 seconds or more) in order to prevent Rockbox rebooting into disk mode.

2) Windows would display an "unknown usb device" message


It also changes the target-tree function usb_detect() on all targets from bool to int, returning USB_INSERTED or USB_EXTRACTED instead of true or false.

This change was made to enable the PP usb_detect() function to check for USB_POWER and return that as a third value.

The PP usb_detect() function also checks for USB_POWER_BUTTON being held, and will not call dr_controller_run if MENU is held.

I've tested this patch on an iPod Color and a Gigabeat F, but would like it to be tested more widely (especially on different PP targets connecting to different host operating systems) before committing.
This task depends upon

View Dependency Graph

This task blocks these from closing
 FS#4762 - Random resets when playing while plugged in (USB) 
Closed by  Dave Chapman (linuxstb)
Tuesday, 04 September 2007, 08:03 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed to SVN. Thanks to all for testing.
Comment by Peter D'Hoye (petur) - Saturday, 01 September 2007, 18:29 GMT
patch is 0 bytes...
Comment by Nick Waterton (Nick_W) - Saturday, 01 September 2007, 18:30 GMT
looks like it would be a useful patch, but your patch (diff) file is empty!
Comment by Dave Chapman (linuxstb) - Saturday, 01 September 2007, 18:32 GMT
Patch attached to first comment should now be fine.
Comment by Nick Waterton (Nick_W) - Saturday, 01 September 2007, 19:10 GMT
Thanks, patch is fine now.
I downloaded, patched with no problems, and compiled fine.
Menu hold and "unknown USB" fix works great.

Tested in iPod nano, Win XP.
Comment by Peter D'Hoye (petur) - Saturday, 01 September 2007, 19:27 GMT
no different behavior seen on H10-5gb
Comment by Xinlu Huang (polygonal) - Saturday, 01 September 2007, 20:59 GMT
Works great on my 60GB ipod. No error message & short menu hold prevents disk mode. Also seems to fix my problem with my external charger (it used to trigger disk mode without menu hold; now rockbox seems to be able to detect that this is a charger, not usb connection).
Comment by Xinlu Huang (polygonal) - Saturday, 01 September 2007, 23:38 GMT
Works great on my 60GB ipod. No error message & short menu hold prevents disk mode. Also seems to fix my problem with my external charger (it used to trigger disk mode without menu hold; now rockbox seems to be able to detect that this is a charger, not usb connection).
Comment by David Hall (Soap) - Sunday, 02 September 2007, 15:04 GMT
"Menu" to prevent entering of disk mode works now with only a momentary push.
iPod still reboots into Apple disk mode when "Menu" not depressed while inserting USB cable.
Tested with an iPod 5th gen and Nano on Ubuntu and Windows 2000.

Only issue which remains (on my 5th gen, not my Nano)(separate bug?) is that booting with a USB cable inserted will successfully boot Rockbox, but Rockbox will freeze at the main menu - disk spinning - forever. Rockbox, in this state, does not respond to any button press except in activating the backlight.
Comment by Peter D'Hoye (petur) - Sunday, 02 September 2007, 15:21 GMT
Freezing on boot when USB was inserted is something that happens on all targets I think. At least my H380 does it too.
Comment by David Hall (Soap) - Sunday, 02 September 2007, 15:27 GMT
I am unable to make my Nano freeze on boot while USB is inserted. It boots normally, 2 seconds later the USB plug image shows and it successfully reboots into Apple disk mode.
Comment by Dave Chapman (linuxstb) - Sunday, 02 September 2007, 22:00 GMT
I forgot to adjust the bootloaders with my first patch - here's an update.

Would someone be able to test the USB detection in the Sansa bootloader (the only PP bootloader that does USB detection) with this patch?
Comment by Jonathan Gordon (jdgordon) - Sunday, 02 September 2007, 23:58 GMT
sansabooloader stll works correctly. with this patch

Loading...