PINE64

Full Version: Basic IR Support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I just mounted the IR receiver that came with the basic Pine Remote on my board. After reading the User Manual and checking the schematics, I know now that the A64 has a dedicated IR receiver block that does low level decoding. According to http://linux-sunxi.org/IR there was legacy support for that for the other sunxi SoCs as a keyboard device and there is a newer driver for 4.x Linux. I had a look at the devicetree entries and it's there with the correct base address... Is this something we could enable in the 3.10.x kernel ?
Ok I enabled and built the kernel module sunxi-ir-rx in the latest longsleep kernel and that loads fine and creates /dev/input/event3 :


Code:
[11421.673001] Registered IR keymap rc_map_sunxi
[11421.673523] input: sunxi_ir_recv as /devices/soc.0/1f02000.s_cir/rc/rc0/input3
[11421.673676] rc0: sunxi_ir_recv as /devices/soc.0/1f02000.s_cir/rc/rc0
[11421.683893] lirc_dev: IR Remote Control driver registered, major 249
[11421.771356] IR NEC protocol handler initialized
[11421.772549] IR RC5(x) protocol handler initialized
[11421.775071] input: MCE IR Keyboard/Mouse (sunxi-rc-recv) as /devices/virtual/input/input4
[11421.775310] IR MCE Keyboard/mouse protocol handler initialized
[11421.777204] rc rc0: lirc_dev: driver ir-lirc-codec (sunxi-rc-recv) registered at minor = 0
[11421.777214] IR LIRC bridge handler initialized
[11421.777687] IR JVC protocol handler initialized
[11421.779092] IR RC6 protocol handler initialized
[11421.780438] IR SANYO protocol handler initialized
[11421.781451] IR Sony protocol handler initialized


Using a small tool from https://github.com/elopez/keybinder.git , binding keys from the Pine64 remote seems to work fine:


Code:
ubuntu@pine64:~/build/keybinder$ sudo ./keybinder /dev/input/event3
Reading key input from /dev/input/event3 (sunxi_ir_recv)
Loaded config items
Keycode 1 pressed
Keycode 2 pressed
Keycode 3 pressed
Keycode 5 pressed
Keycode 6 pressed
Keycode 77 pressed
Keycode 31 pressed
Keycode 10 pressed
(06-17-2016, 11:54 AM)xalius Wrote: [ -> ]Ok I enabled and built the kernel module sunxi-ir-rx in the latest longsleep kernel and that loads fine and creates /dev/input/event3 :

I managed to get it working without any hassle after updating the kernel to the latest (3.10.102 at time of writing), with the sunxi_ir_recv being registered as /dev/input/event4 right out of the box! So just have to figure out how to drive the keybinder tool.  Cool

If you haven't come across them yet, the update scripts in /usr/local/sbin are your friends! One script will check for and install updated longsleep kernels, and the other will check for and install uboot image updates...

Edit: Don't seem to be able to get keybinder to work... did you fiddle with any LIRC settings at all? evtest is picking up IR button presses ok, but I can't get irrecord or keybinder to respond. I thought that the 'values' that evtest gives for each key would be the code that keybinder wants, but maybe not?