• Status Requires testing
  • Percent Complete
  • Task Type Patches
  • Category Remote
  • Assigned To No-one
  • Operating System iPod 5G
  • 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 Creposucre - 2009-09-28
Last edited by Creposucre - 2010-01-13

FS#10623 - Improved accessory support and detection for Ipod


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?

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

P.S. I don't have an iPod, so I am unable to test this patch

I just added a few modification on iap.c on this one.

But up and down_arrow still don't work :(

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

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.

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).

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?

Once iap_remote_vXX.patch committed, we should commit this keymap patch to use the new supported remote keys in the USB HID feature.

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.

Synced with 23610

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 :)

I made one patch that includes this one and FM remote to avoid any issues. I posted it in the FM remote task

synced with FS24225.

Soap commented on 2010-01-14 02:05

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?

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 :)

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?).

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.

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 )

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)

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?

Soap commented on 2010-11-10 11:29

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.

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

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?



Available keyboard shortcuts


Task Details

Task Editing