2015-09-21, 14:15
Hi All,
Few years ago I bought a Elmak Maxter PC USB remote controller that is MCE compatible.
Here's a picture of it:
and here's the USB IR receiver that comes with it:
It works out of the box on my Linux Mint 17.2.
But recently I got myself a nicely looking XBox One media controller (let's call it XBOMC):
I'd like to get it working with that USB IR receiver but I can't get my head around it.
ir-keytable tells me that this receiver supports "NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ" IR protocols.
Which is great, because according to this post http://forum.kodi.tv/showthread.php?tid=...pid1794017 Xbox One remote is using NEC protocol.
Strangely "ir-keytable" doesn't show what IR protocols this device supports:
But somehow this receiver doesn't recognise any codes sent from the XBox's remote.
I know this because:
* red LED on the IR receiver doesn't blink when I press any button (but it happens when I use the original Maxter remote).
* evtest and irrecord doesn't show anything when I press any of the buttons on XBOMC but print all the event generated by the original Maxter remote.
irrecord says:
Below is the full output:
IR receiver is recognised as "Petalynx Maxter Remote Control"
and is visible as "/dev/input/eventXX" device. XX changes with every reboot.
To get a static name for it I had to add a new rule to the "/etc/udev/rules.d" directory
Thanks to this /dev/lirc0 always points at the proper input device.
Below are my various config files:
"etc/lirc/hardware.conf"
~/.config/lircd.conf for Xbox's One media controller that I found here: http://forum.kodi.tv/showthread.php?tid=...pid2037968
And here are the device details given by lsusb:
Few years ago I bought a Elmak Maxter PC USB remote controller that is MCE compatible.
Here's a picture of it:
and here's the USB IR receiver that comes with it:
It works out of the box on my Linux Mint 17.2.
But recently I got myself a nicely looking XBox One media controller (let's call it XBOMC):
I'd like to get it working with that USB IR receiver but I can't get my head around it.
ir-keytable tells me that this receiver supports "NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ" IR protocols.
Code:
sudo ir-keytable --device=/dev/lirc0 -r
scancode 0x10081 = KEY_POWER (0x74)
.... lots of scancodes
Enabled protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ
Which is great, because according to this post http://forum.kodi.tv/showthread.php?tid=...pid1794017 Xbox One remote is using NEC protocol.
Strangely "ir-keytable" doesn't show what IR protocols this device supports:
Code:
sudo ir-keytable -d /dev/lirc0 -v
Name: ELMAK.pl irMAKbd pl
bus: 3, vendor/product: 18b1:0037, version: 0x0100
But somehow this receiver doesn't recognise any codes sent from the XBox's remote.
I know this because:
* red LED on the IR receiver doesn't blink when I press any button (but it happens when I use the original Maxter remote).
* evtest and irrecord doesn't show anything when I press any of the buttons on XBOMC but print all the event generated by the original Maxter remote.
Code:
sudo evtest /dev/lirc0
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x18b1 product 0x37 version 0x100
Input device name: "ELMAK.pl irMAKbd pl"
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)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 12 (KEY_MINUS)
Event code 13 (KEY_EQUAL)
Event code 14 (KEY_BACKSPACE)
Event code 15 (KEY_TAB)
Event code 16 (KEY_Q)
Event code 17 (KEY_W)
Event code 18 (KEY_E)
Event code 19 (KEY_R)
Event code 20 (KEY_T)
Event code 21 (KEY_Y)
Event code 22 (KEY_U)
Event code 23 (KEY_I)
Event code 24 (KEY_O)
Event code 25 (KEY_P)
Event code 26 (KEY_LEFTBRACE)
Event code 27 (KEY_RIGHTBRACE)
Event code 28 (KEY_ENTER)
Event code 29 (KEY_LEFTCTRL)
Event code 30 (KEY_A)
Event code 31 (KEY_S)
Event code 32 (KEY_D)
Event code 33 (KEY_F)
Event code 34 (KEY_G)
Event code 35 (KEY_H)
Event code 36 (KEY_J)
Event code 37 (KEY_K)
Event code 38 (KEY_L)
Event code 39 (KEY_SEMICOLON)
Event code 40 (KEY_APOSTROPHE)
Event code 41 (KEY_GRAVE)
Event code 42 (KEY_LEFTSHIFT)
Event code 43 (KEY_BACKSLASH)
Event code 44 (KEY_Z)
Event code 45 (KEY_X)
Event code 46 (KEY_C)
Event code 47 (KEY_V)
Event code 48 (KEY_B)
Event code 49 (KEY_N)
Event code 50 (KEY_M)
Event code 51 (KEY_COMMA)
Event code 52 (KEY_DOT)
Event code 53 (KEY_SLASH)
Event code 54 (KEY_RIGHTSHIFT)
Event code 55 (KEY_KPASTERISK)
Event code 56 (KEY_LEFTALT)
Event code 57 (KEY_SPACE)
Event code 58 (KEY_CAPSLOCK)
Event code 59 (KEY_F1)
Event code 60 (KEY_F2)
Event code 61 (KEY_F3)
Event code 62 (KEY_F4)
Event code 63 (KEY_F5)
Event code 64 (KEY_F6)
Event code 65 (KEY_F7)
Event code 66 (KEY_F8)
Event code 67 (KEY_F9)
Event code 68 (KEY_F10)
Event code 69 (KEY_NUMLOCK)
Event code 70 (KEY_SCROLLLOCK)
Event code 71 (KEY_KP7)
Event code 72 (KEY_KP8)
Event code 73 (KEY_KP9)
Event code 74 (KEY_KPMINUS)
Event code 75 (KEY_KP4)
Event code 76 (KEY_KP5)
Event code 77 (KEY_KP6)
Event code 78 (KEY_KPPLUS)
Event code 79 (KEY_KP1)
Event code 80 (KEY_KP2)
Event code 81 (KEY_KP3)
Event code 82 (KEY_KP0)
Event code 83 (KEY_KPDOT)
Event code 85 (KEY_ZENKAKUHANKAKU)
Event code 86 (KEY_102ND)
Event code 87 (KEY_F11)
Event code 88 (KEY_F12)
Event code 89 (KEY_RO)
Event code 90 (KEY_KATAKANA)
Event code 91 (KEY_HIRAGANA)
Event code 92 (KEY_HENKAN)
Event code 93 (KEY_KATAKANAHIRAGANA)
Event code 94 (KEY_MUHENKAN)
Event code 95 (KEY_KPJPCOMMA)
Event code 96 (KEY_KPENTER)
Event code 97 (KEY_RIGHTCTRL)
Event code 98 (KEY_KPSLASH)
Event code 99 (KEY_SYSRQ)
Event code 100 (KEY_RIGHTALT)
Event code 102 (KEY_HOME)
Event code 103 (KEY_UP)
Event code 104 (KEY_PAGEUP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 107 (KEY_END)
Event code 108 (KEY_DOWN)
Event code 109 (KEY_PAGEDOWN)
Event code 110 (KEY_INSERT)
Event code 111 (KEY_DELETE)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 116 (KEY_POWER)
Event code 117 (KEY_KPEQUAL)
Event code 119 (KEY_PAUSE)
Event code 121 (KEY_KPCOMMA)
Event code 122 (KEY_HANGUEL)
Event code 123 (KEY_HANJA)
Event code 124 (KEY_YEN)
Event code 125 (KEY_LEFTMETA)
Event code 126 (KEY_RIGHTMETA)
Event code 127 (KEY_COMPOSE)
Event code 128 (KEY_STOP)
Event code 129 (KEY_AGAIN)
Event code 130 (KEY_PROPS)
Event code 131 (KEY_UNDO)
Event code 132 (KEY_FRONT)
Event code 133 (KEY_COPY)
Event code 134 (KEY_OPEN)
Event code 135 (KEY_PASTE)
Event code 136 (KEY_FIND)
Event code 137 (KEY_CUT)
Event code 138 (KEY_HELP)
Event code 139 (KEY_MENU)
Event code 140 (KEY_CALC)
Event code 142 (KEY_SLEEP)
Event code 143 (KEY_WAKEUP)
Event code 150 (KEY_WWW)
Event code 152 (KEY_SCREENLOCK)
Event code 158 (KEY_BACK)
Event code 159 (KEY_FORWARD)
Event code 161 (KEY_EJECTCD)
Event code 163 (KEY_NEXTSONG)
Event code 164 (KEY_PLAYPAUSE)
Event code 165 (KEY_PREVIOUSSONG)
Event code 166 (KEY_STOPCD)
Event code 167 (KEY_RECORD)
Event code 168 (KEY_REWIND)
Event code 169 (KEY_PHONE)
Event code 173 (KEY_REFRESH)
Event code 174 (KEY_EXIT)
Event code 176 (KEY_EDIT)
Event code 177 (KEY_SCROLLUP)
Event code 178 (KEY_SCROLLDOWN)
Event code 179 (KEY_KPLEFTPAREN)
Event code 180 (KEY_KPRIGHTPAREN)
Event code 183 (KEY_F13)
Event code 184 (KEY_F14)
Event code 185 (KEY_F15)
Event code 186 (KEY_F16)
Event code 187 (KEY_F17)
Event code 188 (KEY_F18)
Event code 189 (KEY_F19)
Event code 190 (KEY_F20)
Event code 191 (KEY_F21)
Event code 192 (KEY_F22)
Event code 193 (KEY_F23)
Event code 194 (KEY_F24)
Event code 207 (KEY_PLAY)
Event code 208 (KEY_FASTFORWARD)
Event code 209 (KEY_BASSBOOST)
Event code 212 (KEY_CAMERA)
Event code 224 (KEY_BRIGHTNESSDOWN)
Event code 225 (KEY_BRIGHTNESSUP)
Event code 228 (KEY_KBDILLUMTOGGLE)
Event code 240 (KEY_UNKNOWN)
Event code 241 (KEY_VIDEO_NEXT)
Event code 244 (KEY_BRIGHTNESS_ZERO)
Event code 256 (BTN_0)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event code 353 (KEY_SELECT)
Event code 358 (KEY_INFO)
Event code 362 (KEY_PROGRAM)
Event code 366 (KEY_PVR)
Event code 370 (KEY_SUBTITLE)
Event code 372 (KEY_ZOOM)
Event code 376 (KEY_PC)
Event code 377 (KEY_TV)
Event code 378 (KEY_TV2)
Event code 379 (KEY_VCR)
Event code 380 (KEY_VCR2)
Event code 381 (KEY_SAT)
Event code 383 (KEY_CD)
Event code 384 (KEY_TAPE)
Event code 386 (KEY_TUNER)
Event code 388 (KEY_TEXT)
Event code 389 (KEY_DVD)
Event code 396 (KEY_MEMO)
Event code 398 (KEY_RED)
Event code 399 (KEY_GREEN)
Event code 400 (KEY_YELLOW)
Event code 401 (KEY_BLUE)
Event code 402 (KEY_CHANNELUP)
Event code 403 (KEY_CHANNELDOWN)
Event code 405 (KEY_LAST)
Event code 407 (KEY_NEXT)
Event code 408 (KEY_RESTART)
Event code 409 (KEY_SLOW)
Event code 410 (KEY_SHUFFLE)
Event code 416 (KEY_VIDEOPHONE)
Event code 417 (KEY_GAMES)
Event code 418 (KEY_ZOOMIN)
Event code 419 (KEY_ZOOMOUT)
Event code 431 (KEY_DISPLAYTOGGLE)
Event code 439 (KEY_MEDIA_REPEAT)
Event code 582 (?)
Event code 592 (?)
Event code 593 (?)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event code 8 (REL_WHEEL)
Event type 3 (EV_ABS)
Event code 32 (ABS_VOLUME)
Value 0
Min 0
Max 250
Event code 40 (ABS_MISC)
Value 1
Min 0
Max 255
Event code 41 (?)
Value 150
Min 0
Max 255
Event code 42 (?)
Value 0
Min 0
Max 255
Event code 43 (?)
Value 0
Min 0
Max 255
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Event type 17 (EV_LED)
Event code 0 (LED_NUML)
Event code 1 (LED_CAPSL)
Event code 2 (LED_SCROLLL)
Event code 3 (LED_COMPOSE)
Event code 4 (LED_KANA)
Properties:
Property type 20 (EV_REP)
Property code 0 (REP_DELAY)
Value 250
Property code 1 (REP_PERIOD)
Value 33
Testing ... (interrupt to exit)
irrecord says:
Code:
irrecord: gap not found, can't continue
irrecord: closing '/dev/lirc0'
Below is the full output:
Code:
sudo irrecord -H devinput -d /dev/lirc0 ./xboxone.txt
irrecord - application for recording IR-codes for usage with lirc
Copyright (C) 1998,1999 Christoph Bartelmus([email protected])
irrecord: initializing '/dev/lirc0'
This program will record the signals from your remote control
and create a config file for lircd.
Usually it's not necessary to create a new config file for devinput
devices. A generic config file can be found at:
http://www.lirc.org/remotes/devinput/
You should try this config file before creating your own config file.
A proper config file for lircd is maybe the most vital part of this
package, so you should invest some time to create a working config
file. Although I put a good deal of effort in this program it is often
not possible to automatically recognize all features of a remote
control. Often short-comings of the receiver hardware make it nearly
impossible. If you have problems to create a config file READ THE
DOCUMENTATION of this package, especially section "Adding new remote
controls" for how to get help.
If there already is a remote control of the same brand available at
http://www.lirc.org/remotes/ you might also want to try using such a
remote as a template. The config files already contain all
parameters of the protocol used by remotes of a certain brand and
knowing these parameters makes the job of this program much
easier. There are also template files for the most common protocols
available in the remotes/generic/ directory of the source
distribution of this package. You can use a template files by
providing the path of the file as command line parameter.
Please send the finished config files to <[email protected]> so that I
can make them available to others. Don't forget to put all information
that you can get about the remote control in the header of the file.
Press RETURN to continue.
Hold down an arbitrary button.
irrecord: gap not found, can't continue
irrecord: closing '/dev/lirc0'
IR receiver is recognised as "Petalynx Maxter Remote Control"
Code:
lsusb
Bus 004 Device 003: ID 18b1:0037 Petalynx Maxter Remote Control
To get a static name for it I had to add a new rule to the "/etc/udev/rules.d" directory
Code:
KERNEL=="event[0-9]", ATTRS{name}=="ELMAK*", SYMLINK+="lirc0"
Below are my various config files:
"etc/lirc/hardware.conf"
Code:
#Chosen Remote Control
REMOTE="Windows Media Center Transceivers/Remotes (all)"
REMOTE_MODULES="lirc_dev mceusb"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""
#Chosen IR Transmitter
TRANSMITTER="Custom"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
#Disable kernel support.
#Typically, lirc will disable in-kernel support for ir devices in order to
#handle them internally. Set to false to prevent lirc from disabling this
#in-kernel support.
#DISABLE_KERNEL_SUPPORT="true"
#Enable lircd
START_LIRCD="true"
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
#Try to load appropriate kernel modules
LOAD_MODULES="true"
# Default configuration files for your hardware if any
LIRCMD_CONF=""
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
~/.config/lircd.conf for Xbox's One media controller that I found here: http://forum.kodi.tv/showthread.php?tid=...pid2037968
Code:
# this config file was automatically generated
# using lirc-0.9.0(default) on Wed Jun 24 18:25:32 2015
#
# Contributed by YellowLemon
#
# Remote = Xbox One Media Remote (2014)
# with auto backlight function
#
begin remote
name devinput # make it match what already exists in KODI's lircmap.xml
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30 # sets the variation allowed in ms
aeps 100
header 9053 4451 # on-duration and off-duration of header
one 592 1662 # on-duration and off-duration to encode a 1
zero 592 529 # on-duration and off-duration to encode a 0
ptrail 575 # trailing data
repeat 9022 2231 # the sequence when a key is held down
pre_data_bits 16 # data sent before the keycode
pre_data 0x11B
gap 108284 # the length of the entire signal (not just the gap afterwards)
suppress_repeat 3 # I added this to stop single presses on the remote buttons sending double keypresses
toggle_bit_mask 0x0 # some remotes have a toggle bit between separate presses
# The codes below are constant
begin codes
KEY_MEDIA 0x26D9 # Was XboxFancyButton
KEY_ZOOM 0x7689 # Was View
KEY_EPG 0xF609 # Was Menu
KEY_UP 0x7887 # Was Up
KEY_DOWN 0xF807 # Was Down
KEY_LEFT 0x04FB # Was Left
KEY_RIGHT 0x847B # Was Right
KEY_OK 0x44BB # Was Select
KEY_EXIT 0xC43B # Was Back
KEY_INFO 0x649B # Was Guide
KEY_VOLUMEUP 0x08F7 # Was VolumeUp
KEY_VOLUMEDOWN 0x8877 # Was VolumeDown
KEY_MUTE 0x708F # Was Mute
KEY_CHANNELUP 0x48B7 # Was ChannelUp
KEY_CHANNELDOWN 0xC837 # Was ChannelDown
KEY_REWIND 0xA857 # Was Rewind
KEY_FASTFORWARD 0x28D7 # Was FastForward
KEY_PLAY 0x0EF1 # Was Play
KEY_PREVIOUS 0xD827 # Was Previous
KEY_NEXT 0x58A7 # Was Next
KEY_STOP 0x9867 # Was Stop
end codes
end remote
And here are the device details given by lsusb:
Code:
lsusb -v -d 18b1:0037
Bus 004 Device 003: ID 18b1:0037 Petalynx Maxter Remote Control
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x18b1 Petalynx
idProduct 0x0037 Maxter Remote Control
bcdDevice 3.97
iManufacturer 3
iProduct 1
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 40mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 246
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0005 1x 5 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10