This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10218 - USB HID keymaps - please test
Attached to Project:
Rockbox
Opened by Tomer Shalev (tomers) - Tuesday, 19 May 2009, 09:01 GMT+2
Last edited by Frank Gevaerts (fg) - Saturday, 23 May 2009, 16:43 GMT+2
Opened by Tomer Shalev (tomers) - Tuesday, 19 May 2009, 09:01 GMT+2
Last edited by Frank Gevaerts (fg) - Saturday, 23 May 2009, 16:43 GMT+2
|
DetailsPlease test my latest work on having Rockbox identify as a Human Interface Device when it is connected through USB.
It suppose to act as a Multimedia Keyboard, sending key codes to the OS, such as volume and track control. I created keymaps for all platforms, but not all of them have drivers that know how to configure USB interrupt transfers in the USB controller. Please try it and post your feedback. Thanks! |
This task depends upon
Closed by Frank Gevaerts (fg)
Saturday, 23 May 2009, 16:43 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r21054
Saturday, 23 May 2009, 16:43 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r21054
$ svn co svn://svn.rockbox.org/rockbox/trunk rockbox
$ wget http://www.rockbox.org/tracker/task/10218?getfile=19454 -O hid.patch
$ cd rockbox
$ patch -p0 -i ../hid.patch
$ mkdir build && cd build/ && ../tools/configure
$ make
...
Should this work on the H300? I see you've defined a keymap, but I guess that the hardware USB support won't allow this.
For whatever it's worth, I'd find more use for the opposite (i.e. USB input to control Rockbox) - I guess this is HID host support?
Unfortunately, the H300 does not uses Rockbox's USB stack (HAVE_USBSTACK is not defined).
Indeed, I defined keymaps for all platforms, regardless of whether they use the Rockbox stack. These keymaps should be removed.
> For whatever it's worth, I'd find more use for the opposite (i.e. USB input to control Rockbox) - I guess this is HID host support?
You are right. A custom driver should be implemented and used on the host side, and Rockbox should be set to send messages, possible using the USB HID protocol.
Read more here: http://www.edn.com/article/CA243218.html
Removed platforms without HAVE_USBSTACK defined.
Also I think you should set the touchscreen mode to grid mode on a touchscreen target when entering usb_handler and set it back to the original mode when leaving it, otherwise the emulated touch buttons won't work when a user has set it to absolute point mode. In the end there should be a better solution for touchscreen targets IMO involving visual confirmation so you know what action happens when you press something on the screen.
Haven't tested this patch (yet) though.
Fixed Onda VX747 key mappings
Set the touchscreen mode to grid mode on a touchscreen target when entering usb_handler and set it back to the original mode when leaving it
> In the end there should be a better solution for touchscreen targets IMO involving visual confirmation so you know what action happens when you press something on the screen.
Agreed. The should be a visual buttons on screen for buttons mode, and there should be an option in the menu to switch to tablet mode, when the device acts as a touchpad that moves the mouse cursor on the host's screen.
This is call for developers - please confirm the keymapping are working for your platform.
I've tested this patch on Sansa E200.
To test it, just compile this patch, reboot RB, and attach it to USB. Open media software on your OS, and verify you can control the volume and tracks played according to your keymap (apps/keymaps/keymap-XXX)
Thanks!
This of course disables the emulated touch buttons, but I'm not sure how to fix this issue..
I'd really love to see someone go all out on the usb interface in rockbox for those targets that have full support like a PC->rockbox display interface and usb audio support.
Platforms status:
Works: e200
Other issues: ondavx747 (unrelated to this patch)
Not tested:
c100, c200, clip, creativezv, creativezvm, gigabeat-s, h10, hdd1630, ipod, mr100, ondavx767, sa9200
Please test with your platform. Thanks!
Regarding the ondavx767: this has the same USB driver as the ondavx747, but it doesn't have a working LCD driver (yet); so there's no real way of testing it (and the only tester with one is wpyh AFAIK); but the patch should probably work.
edit:
targets with emulated touchscreen buttons only (no physical buttons) won't work with this patch as it'll always ask for the target context mapping and so skipping the touchscreen context mapping; IMO somehow the keymap driver should get adjusted to handle both emulated touchscreen buttons and physical buttons -> this should probably go in another Flyspray item.
edit2:
never mind the above comment, I didn't fully understand how the keymap driver works.
@tomers:
you should replace LAST_ITEM_IN_LIST with LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_USB_HID) in keymap-touchscreen.c (and revert my previous keymap-touchscreen.c suggestion)
~~~~~~~~~~~
- Fixed more remarks by mcuelenaere (thanks!)
- Removed Creative platforms
- Remove Onda VX767
Platforms status
~~~~~~~~~~~~
Needs testing:
- c100
- c200
- clip
- gigabeat-s
- h10
- hdd1630
- ipod
- mr100
- sa9200
Works:
- e200
Have issues:
- ondavx747 (unrelated to this patch)
Please test with your platform. Thanks!
The followings are instructions to download, apply, and compile the patch:
$ svn co svn://svn.rockbox.org/rockbox/trunk rockbox && cd rockbox
# Download hid.patch
$ patch -p0 -i ../hid.patch
$ mkdir build && cd build/ && ../tools/configure
$ make
To test it, just compile this patch, reboot RB, and attach it to USB. Open media software on your OS, and verify you can control the volume and tracks played according to your keymap (apps/keymaps/keymap-XXX)
Tomer
Platforms status
~~~~~~~~~~~~
Needs testing:
- c100
- c200
- clip
- gigabeat-s
- h10
- hdd1630
- mr100
- sa9200
Works:
- e200
- ipod
Have issues:
- ondavx747 (unrelated to this patch)