You are not logged in.

#1 2013-10-08 19:01:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,733
Website

Streamzap USB remote without using lirc/how to program keys [SOLVED]

I have a Streamzap usb remote which the kernel seems to identify as a keyboard.  I'd like to remap the buttons on it and use it without lirc.  My google-fu failed me; this must be possible.  Any pointers are appreciated.

Upon plugging in the USB receiver, dmesg reports:

[  833.415331] usb 7-2: new low-speed USB device number 2 using xhci_hcd
[  833.436994] usb 7-2: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[  833.492101] Registered IR keymap rc-streamzap
[  833.492189] input: Streamzap PC Remote Infrared Receiver (0e9c:0000) as /devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb7/7-2/7-2:1.0/rc/rc0/input18
[  833.492265] rc0: Streamzap PC Remote Infrared Receiver (0e9c:0000) as /devices/pci0000:00/0000:00:1c.7/0000:07:00.0/usb7/7-2/7-2:1.0/rc/rc0
[  833.493438] IR RC6 protocol handler initialized
[  833.493462] IR JVC protocol handler initialized
[  833.493527] IR NEC protocol handler initialized
[  833.493626] IR Sony protocol handler initialized
[  833.493633] IR SANYO protocol handler initialized
[  833.493637] IR RC5(x) protocol handler initialized
[  833.494783] streamzap 7-2:1.0: Registered Streamzap, Inc. Streamzap Remote Control on usb7:2
[  833.495190] IR RC5 (streamzap) protocol handler initialized
[  833.495267] usbcore: registered new interface driver streamzap
[  833.495393] input: MCE IR Keyboard/Mouse (streamzap) as /devices/virtual/input/input19
[  833.495663] lirc_dev: IR Remote Control driver registered, major 248 
[  833.495808] IR MCE Keyboard/mouse protocol handler initialized
[  833.496138] rc rc0: lirc_dev: driver ir-lirc-codec (streamzap) registered at minor = 0
[  833.496140] IR LIRC bridge handler initialized

I found /usr/lib/udev/rc_keymaps/streamzap which seems to map the IR codes to the keys on the remote... what I can't figure out is how to then map a key on the remote to a key on the keyboard.

Last edited by graysky (2013-10-08 20:05:42)

Online

#2 2013-10-08 20:05:28

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,733
Website

Re: Streamzap USB remote without using lirc/how to program keys [SOLVED]

OK!  Figured this out.  Firstly, extra/v4l-utils provided /usr/lib/udev/rc_keymaps/streamzap which contains errors.  I will file a bugreport.  The first line needs to read:

# table streamzap, type: RC-5-SZ

Secondly, it is best to copy that file to /etc/rc_keymaps/streamzap.local and edit that but that requires a modification to /etc/rc_maps.cfg telling it to use the modified file:

*	rc-streamzap             /etc/rc_keymaps/streamzap.local

One can reload the file after making a change to it with this command:

sudo ir-keytable -s rc2 -a /etc/rc_maps.cfg

...where -s rc2 defines the input controller.  The default is rc0 but if you unplug the USB it increments up one integer per time.

Here is an example changing the mappings to something mplayer friendly (still a work in progress but you get the idea):

# table streamzap, type: RC-5-SZ
# customized by graysky to work with mplayer

0x28c0 KEY_0
0x28c1 KEY_1
0x28c2 KEY_2
0x28c3 KEY_3
0x28c4 KEY_4
0x28c5 KEY_5
0x28c6 KEY_6
0x28c7 KEY_7
0x28c8 KEY_8
0x28c9 KEY_9

#0x28ca KEY_POWER
0x28ca KEY_ESC

#0x28cb KEY_MUTE
0x28cb KEY_M

0x28cc KEY_CHANNELUP

#0x28cd KEY_VOLUMEUP
0x28cd KEY_0

0x28ce KEY_CHANNELDOWN

#0x28cf KEY_VOLUMEDOWN
0x28cf KEY_9

0x28d0 KEY_UP
0x28d1 KEY_LEFT

#0x28d2 KEY_ENTER
0x28d2 KEY_P

0x28d3 KEY_RIGHT
0x28d4 KEY_DOWN

#0x28d5 KEY_MENU
0x28d5 KEY_O

#0x28d6 KEY_EXIT
0x28d6 KEY_ESC

0x28d7 KEY_PLAY
0x28d8 KEY_PAUSE

#0x28d9 KEY_STOP
0x28d9 KEY_X

#0x28da KEY_BACK
0x28da KEY_PAGEDOWN

#0x28db KEY_FORWARD
0x28db KEY_PAGEUP

0x28dc KEY_RECORD

#0x28de KEY_FASTFORWARD
0x28de KEY_UP

#0x28dd KEY_REWIND
0x28dd KEY_DOWN

#0x28e0 KEY_RED
0x28e0 KEY_V

0x28e1 KEY_GREEN
0x28e2 KEY_YELLOW
0x28e3 KEY_BLUE

So there you go: streamzap remote without lirc!

EDIT: See my github for a complete file.[1]

1. https://github.com/graysky2/configs/tre … /streamzap

Last edited by graysky (2013-10-08 22:14:35)

Online

Board footer

Powered by FluxBB