Rockbox

Tasklist

FS#10623 - Improved accessory support and detection for Ipod

Attached to Project: Rockbox
Opened by Laurent Gautier (Creposucre) - Monday, 28 September 2009, 17:00 GMT
Last edited by Laurent Gautier (Creposucre) - Wednesday, 13 January 2010, 21:31 GMT
Task Type Patches
Category Remote
Status Requires testing
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 80%
Votes 0
Private No

Details

Hi,

this patch, that takes some of the FS10494, improves dock detection and initialization.

It should correct the erratic behaviour on some hardware, and it also adds support for some remote buttons: menu, select, up_arrow and down_arrow.

The buttons arrow are not usable by now, even if they are defined. I tried severals things but i couldn't get it to work.

Any idea of which context I should use to use the button arrow to scroll through the main menu?
This task depends upon

Comment by Tomer Shalev (tomers) - Wednesday, 30 September 2009, 22:13 GMT
Changes for v2 (all in keymap-ipod.c) :

- Reworked all current remote key maps
- Added missing remote key maps
- Fix handling CONTEXT_MAINMENU (did not fallback through CONTEXT_CUSTOM|CONTEXT_TREE
- Added comments for clarity
- Fixed typos in comments
- Remove redundant return statement after switch with 'default' case
Comment by Tomer Shalev (tomers) - Wednesday, 30 September 2009, 22:13 GMT
P.S. I don't have an iPod, so I am unable to test this patch
Comment by Laurent Gautier (Creposucre) - Thursday, 01 October 2009, 12:25 GMT
I just added a few modification on iap.c on this one.

But up and down_arrow still don't work :(
Comment by Tomer Shalev (tomers) - Friday, 02 October 2009, 02:08 GMT
Changes since v2.1:
- Changed remote_button_context_standard to use BUTTON_RC_UP and BUTTON_RC_DOWN
- get_context_mapping_remote() now handles CONTEXT_STD in switch case
- Renamed BUTTON_RC_UP_ARROW to BUTTON_RC_UP, and BUTTON_RC_DOWN_ARROW to BUTTON_RC_DOWN
Comment by Laurent Gautier (Creposucre) - Friday, 02 October 2009, 12:47 GMT
Changes since v3:
-renamed BUTTON_RC_UP_ARROW to BUTTON_RC_UP, and BUTTON_RC_DOWN_ARROW to BUTTON_RC_DOWN in iap.c and two others remaining in button-target.
Comment by Tomer Shalev (tomers) - Monday, 05 October 2009, 06:56 GMT
Once the new remote buttons are supported, we can enable mouse support for iPod's remotes in apps/keymaps/keymap-ipod.c (remove #if 0).
Comment by Laurent Gautier (Creposucre) - Wednesday, 14 October 2009, 21:09 GMT
Synced with 23174.

I attached a log of several hardwares that I tested in a hardware shop.

The buttons work on every accessory that supports it. I forgot to mention that it features a power-off command, tested with success on one target.

Note: Most of the docks put the ipod in sleep mode sending a 2 second "play" command. Rockbox needs a 5~6 second play command.

to resume again, this patch:
- improves accessory detection and passes the authentication
- improves buttons detection
- features a remote power-off
- fetures a remote menu, select

As seen with Tomers, remote up and down are implemented but non funtionnal yet; keymap to refine?
Comment by Tomer Shalev (tomers) - Saturday, 17 October 2009, 05:58 GMT
Once iap_remote_vXX.patch committed, we should commit this keymap patch to use the new supported remote keys in the USB HID feature.
Comment by Tomer Shalev (tomers) - Saturday, 17 October 2009, 14:49 GMT
Please ignore the last patch, as obviously when the iPod is connected to the accessory, it cannot be connected at the same time to a HOST machine through a USB port, therefore the USB HID feature is irrelevant for remote buttons.
Comment by Laurent Gautier (Creposucre) - Wednesday, 11 November 2009, 21:12 GMT
Synced with 23610
Comment by Jonathan Gordon (jdgordon) - Wednesday, 11 November 2009, 23:00 GMT
ok, I'm adding a reminder for me to commit this tonight... (assuming no issues with the patch), if someone beats me to it great :)
Comment by Laurent Gautier (Creposucre) - Thursday, 12 November 2009, 21:24 GMT
I made one patch that includes this one and FM remote to avoid any issues. I posted it in the FM remote task
Comment by Laurent Gautier (Creposucre) - Wednesday, 13 January 2010, 21:19 GMT
synced with FS24225.
Comment by David Hall (Soap) - Thursday, 14 January 2010, 02:05 GMT
With the percent-complete change and status changed to "requires testing" - what needs testing?
Are we looking for verification that this patch does not interfere with non-accessory performance?
Are we looking for verification that this patch does not break existing accessory compatibility?
Or are we looking for verification that this patch improves compatibility? If so is there a list of accessories which should be tested?
Regardless - if this needs broad testing shall I cook up some "Official Test Builds" for the forum and put out a call for testers?
Comment by Laurent Gautier (Creposucre) - Thursday, 14 January 2010, 18:15 GMT
You're right, I should have made this clear.

This patch need testing so we can see if:

* the added remote buttons are working correctly
* the shutdown thing initiated by a remote shutdown button works correctly
* the accessories don't get stuck anymore

All the accessories should be retested with it, excepted the apple fm remote which is fully supported.
Actually, all the accessories could already be retested with the current SVN since the patch for the fm remote that I submitted features the improvement of the accessory detection.

I don't own myself anything else that the ipod fm remote, that's why it's difficult for me to do the debug for the other accessories.

So, an official test build with testers would be really helpful :)
Comment by David Hall (Soap) - Saturday, 16 January 2010, 20:43 GMT Comment by Jonathan Gordon (jdgordon) - Sunday, 17 January 2010, 06:08 GMT
woohoo! I finally fixed my ipod video. I've just put on the 32MB build from Davids thread. Baring in mind I havnt used a recent svn build on this (definetly not since way before support started going in.)

for some reason the dock and remote buttons dont work unless the ipod is off when plugging into the dock. If I plug the ipod in while its in rockbox already it will automatically shut down. and yeah, scroll remote buttons don't work.
and turning off the ipod isnt very reliable. When it doesnt work it stops the music on rockbox (and the dock turns off) but then the dock turns back on (should accessory power be off?).
Comment by Laurent Gautier (Creposucre) - Wednesday, 20 January 2010, 20:26 GMT
glad your ipod's up!

I've tried the build on a JVC microcomponent (UX-GP5): it works quite ok except the up and down buttons that I can't make work.

The problem seems to be the keymap, but if I put another function on theses buttons, it works nicely...

Could you try to apply your patch in FS9951 to log your iap packets please? I'll look at that as soon as possible.
Comment by Jonathan Gordon (jdgordon) - Wednesday, 20 January 2010, 20:38 GMT
if the problem is definitly keymap then it shuoldnt be hard to fix :) ill try to do that and 9951 before the weekend (nag me if i dont :p )
Comment by Laurent Gautier (Creposucre) - Monday, 01 March 2010, 18:59 GMT
There is a way to detect ipod accessories: The pin 20 of the dock connector.

I have made some tests and if you tie together pin 20 and ground, you can see that GPIOs change (I could give you the results later on)

So, pin 20 to ground => you know there is an accessory plugged in

Then you "read the value" of the resistor on pin 10 => you know what kind of accessory
(by the way, I guess in the aim to read the value of this resistor, we need a voltage divider; the input voltage is not here, thought. A GPIO should certainly activate it)

I wanted to add theses findings in this patch, but I lack some time and I am stuck with another problem with key codes, so anybody should feel free to implement it in another patch.

GPIO A and F states:
69 and 06 (no accessories)
39 and 42, then 79 and 46 (pin 20 tied with gnd)
Comment by Bertrik Sikken (bertrik) - Wednesday, 10 November 2010, 09:30 GMT
I have some ideas for IAP that I won't mind working on (I can test though because I don't have the hardware):
* separate the IAP auto-bauding from the serial driver. Currently the IAP auto-bauding is entwined with the serial driver (containing both knowledge about the IAP protocol as well about the specific hardware), this makes it impossible to do IAP auto-bauding on anything other than portalplayer ipods (like the nano 2g for example)
* split up the iap_handlepkt function up a bit, with a function per mode, it's now a gigantic function, nested too deep IMO
* generate the mode 4 cmd ok packet in a function instead of constructing it each time in a slightly different way
* maybe use #defines for all of the magic command number?
Comment by David Hall (Soap) - Wednesday, 10 November 2010, 11:29 GMT
Once again I'm willing to host test builds and to maintain a forum thread discussing the testing.

I don't know why the thread from January of this year is still on the forums, it slipped past me, I'm in the process of killing it.

Regardless, the offer stands to host and parse. I'd offer to build but I've been spend much of my time way out of town where internet access is spotty and I don't want to commit to what I can't promise.
Comment by Laurent Gautier (Creposucre) - Monday, 15 November 2010, 21:39 GMT
I'm sorry I didn't had too much time to work on this lately...

but I think theses are great ideas! I can test some with my radio remote, just need to check if I still can build.

Just noticed that you posted in fs11266, I will try to test this patch too

Comment by Caco (cacona666) - Sunday, 28 August 2011, 17:55 GMT
Guys, I would like to help on this. I am interested in using my remote control in my Ipod 4G (Color) (the official version does not work) because the keyboard of my ipod is broken.

Where should i start? Is the rev 24224+patch working or at least partially?
How do I debug rockbox? If I can write to a log file, which functions can I use to debug from inside iap.c to see what I am receiving in the remote control port?

Thanks,
Caco

Loading...