I've recently rebuilt my MythTV box using Mythbuntu 12.04, to take advantage of newer hardware (Ivy Bridge).
On my previous build I used
lirc to manage the remote, i.e. the mapping of key codes -> keypresses -> application keys; it was quite a journey to learn it all, and I ended up fairly comfortable with how it all worked.
What I have:
- I have a cheap Chinavasion remote and USB dongle, which I've found several articles on; these largely revolve around working with XBMC (interesting, but I don't think directly applicable) and also around getting a Harmony remote to work (it's a Chinavasion CVSB-983 - very useful, since I needed this to get my Harmony 900 working).
- Mythbuntu 12.04 64-bit
- MythTV 0.25 (likely irrelevant)
How it is right now
When I plug this in, it 'just works'. Which is great, except that Ubuntu uses it natively, and prevents some of the button presses from getting through to Myth. For example, I can send a button from the remote that equates to Ctrl-Alt-A (which I assume Ubuntu isn't interested in), and then trap that in Mythfrontend, but the remote's Play button is caught by Ubuntu (which displays a large circle with a line though it, as there's no media player loaded).
I understand that this is because lirc is merged into the kernel now, and I like that.
What I've done so far:
Found the device using
$ lsusb Bus 001 Device 004: ID 073a:2230 Chaplet Systems, Inc. infrared dongle for remote
Found the event device number:
$ cat /proc/bus/input/devices I: Bus=0003 Vendor=073a Product=2230 Version=0110 N: Name="HID 073a:2230" P: Phys=usb-0000:00:1a.0-1.2/input0 S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input5 U: Uniq= H: Handlers=sysrq kbd mouse1 event5 js0 B: PROP=0 B: EV=10001f B: KEY=4c37fff072ff32d bf54445600000000 ffffffffff 30c100b17c007 ffa67bfad951dfff febeffdfffefffff fffffffffffffffe B: REL=343 B: ABS=100030000 B: MSC=10
Tested the input with
evtest (I pressed Play):
$ sudo evtest /dev/input/event5 Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x73a product 0x2230 version 0x110 Input device name: "HID 073a:2230" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 1 (KEY_ESC) Event code 2 (KEY_1) Event code 3 (KEY_2) Event code 4 (KEY_3) Event code 5 (KEY_4) Event code 6 (KEY_5) Event code 7 (KEY_6) <------------snipped lots of 'Event code' lines------------> Testing ... (interrupt to exit) Event: time 1336435683.230656, -------------- SYN_REPORT ------------ Event: time 1336435683.246648, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd Event: time 1336435683.246652, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0 Event: time 1336435683.246655, -------------- SYN_REPORT ------------
showkey, again for the Play key:
$ sudo showkey -s kb mode was RAW [ if you are trying this under X, it might not work since the X server is also reading /dev/console ] press any key (program terminates 10s after last keypress)... 0xe0 0x22 0xe0 0xa2
What I want:
- I'd like a way to scan the incoming button presses, if the above method isn't correct.
- I'd like to either remap each button press to something that Ubuntu/Unity will ignore, or even better pass the keypress directly to Myth (I suspect this later is only possible with lirc, but I could be wrong).
- I would really like to do this with the in-kernel drivers, i.e. without explicitly loading lirc; if that's the way the world is going, I'd rather find a way to map the current behaviour to what I want, rather than forcing the 'old' arrangement of loading lirc outside the kernel. Learning something new is also worthwhile!
I'm assuming that this will require using
setkeycodes, but have had trouble finding enough information to configure this.
Any help greatly appreciated!