2012-06-11, 23:32
Glad you got it working
![Big Grin Big Grin](https://forum.kodi.tv/images/smilies/grin.png)
(2012-06-25, 19:01)Pintglass Wrote: Hello
Sorry to barge in here but I've been going through most of the setups mentioned in this thread, i have a few things i just can't get my head around.
If lirc is no loner needed as the kernel is loading the key tables what is the point of having keytables with commands that neither linux or xbmc can not understand for example why not have keytables that have the appropriate keyboard key mapped for a certain action ie, P for play instead of play for play?
The other issue i have is that ir-keytable doesn't have the ability to use modifier keys for example Ctrl+m which seems strange?
Regards Pintglass
(2012-06-10, 21:20)brando56894 Wrote: It may look like it's working correctly but actually it isn't. What you see from ir-keytable is just the commands that the remote is sending, Linux nor XBMC understand those except for volume, mute and up/down/left/right. All that proves is that your receiver is communicating with the remote successfully, which is the first step (obviously!)The first thing you should do is remove lirc, you're not going to need it, ir-keytable is the new replacement for lirc. I know it's a little time consuming but you may want to run ir-keytable -t and go through each button sequentially and write down it's offset (only the last two digits should change per key so you shouldn't have to write down the whole offset, at least that's how mine was) and corresponding function on the remote since all the functions listed in the keymap probably aren't included on the remote, you don't want to be mapping functions to non-existent keys and wondering why the hell they don't work, do you?
Found /sys/class/rc/rc0/ (/dev/input/event4) with:
Driver imon, table rc-imon-pad
Supported protocols: RC-6 other
Enabled protocols:
Repeat delay = 500 ms, repeat period = 125 ms
Found /sys/class/rc/rc1/ (/dev/input/event13) with:
Driver it913x, table rc-kworld-315u
Supported protocols: NEC
Enabled protocols:
Repeat delay = 500 ms, repeat period = 125 ms
1340660117.505888: event MSC: scancode = 1007f00
1340660117.505892: event key down: KEY_DOWN (0x006c)
1340660117.505893: event sync
1340660117.756826: event key up: KEY_DOWN (0x006c)
1340660117.756828: event sync
1340660120.320709: event MSC: scancode = 2000028
1340660120.320715: event key down: KEY_ENTER (0x001c)
1340660120.320716: event sync
1340660120.568840: event key up: KEY_ENTER (0x001c)
1340660120.568843: event sync
1340660134.594899: event MSC: scancode = 1008000
1340660134.594907: event key down: KEY_UP (0x0067)
1340660134.594909: event sync
1340660134.844834: event key up: KEY_UP (0x0067)
1340660134.844836: event sync
1340660136.841985: event MSC: scancode = 2000028
1340660136.841989: event key down: KEY_ENTER (0x001c)
1340660136.841990: event sync
1340660137.092839: event key up: KEY_ENTER (0x001c)
1340660137.092841: event sync
1340660158.681678: event MSC: scancode = 200001e
1340660158.681681: event key down: KEY_NUMERIC_1 (0x0201)
1340660158.681681: event sync
1340660158.932817: event key up: KEY_NUMERIC_1 (0x0201)
1340660158.932819: event sync
1340660159.281462: event MSC: scancode = 200001e
1340660159.281466: event key down: KEY_NUMERIC_1 (0x0201)
1340660159.281466: event sync
1340660159.532833: event key up: KEY_NUMERIC_1 (0x0201)
1340660159.532835: event sync
1340660159.825256: event MSC: scancode = 200001f
1340660159.825259: event key down: KEY_NUMERIC_2 (0x0202)
1340660159.825260: event sync
1340660160.076812: event key up: KEY_NUMERIC_2 (0x0202)
1340660160.076813: event sync
1340660160.153165: event MSC: scancode = 2000020
1340660160.153171: event key down: KEY_NUMERIC_3 (0x0203)
1340660160.153172: event sync
1340660160.404811: event key up: KEY_NUMERIC_3 (0x0203)
1340660160.404812: event sync
1340660161.969480: event MSC: scancode = 288795b7
1340660161.969484: event key down: KEY_CHANNELDOWN (0x0193)
1340660161.969485: event sync
1340660162.220834: event key up: KEY_CHANNELDOWN (0x0193)
1340660162.220837: event sync
1340660162.673251: event MSC: scancode = 289395b7
1340660162.673257: event key down: KEY_CHANNELUP (0x0192)
1340660162.673259: event sync
1340660162.924826: event key up: KEY_CHANNELUP (0x0192)
1340660162.924828: event sync
ir-keytable -c -p NEC,RC-5,RC-6,JVC,SONY,LIRC -t
# table imon_pad, type: OTHER
0x2a8195b7 KEY_REWIND
0x298315b7 KEY_REWIND
0x2b8115b7 KEY_FASTFORWARD
0x2b8315b7 KEY_FASTFORWARD
0x2b9115b7 KEY_PREVIOUS
0x298195b7 KEY_NEXT
0x2a8115b7 KEY_PLAY
0x2a8315b7 KEY_PLAY
0x2a9115b7 KEY_PAUSE
0x2b9715b7 KEY_STOP
0x298115b7 KEY_RECORD
0x01008000 KEY_UP
0x01007f00 KEY_DOWN
0x01000080 KEY_LEFT
0x0100007f KEY_RIGHT
0x2aa515b7 KEY_UP
0x289515b7 KEY_DOWN
0x29a515b7 KEY_LEFT
0x2ba515b7 KEY_RIGHT
0x0200002c KEY_SPACE
0x2a9315b7 KEY_SPACE
0x02000028 KEY_ENTER
0x28a195b7 KEY_ENTER
0x288195b7 KEY_EXIT
0x02000029 KEY_ESC
0x2bb715b7 KEY_ESC
0x0200002a KEY_BACKSPACE
0x28a115b7 KEY_BACKSPACE
0x2b9595b7 KEY_MUTE
0x28a395b7 KEY_VOLUMEUP
0x28a595b7 KEY_VOLUMEDOWN
0x289395b7 KEY_CHANNELUP
0x288795b7 KEY_CHANNELDOWN
0x0200001e KEY_NUMERIC_1
0x0200001f KEY_NUMERIC_2
0x02000020 KEY_NUMERIC_3
0x02000021 KEY_NUMERIC_4
0x02000022 KEY_NUMERIC_5
0x02000023 KEY_NUMERIC_6
0x02000024 KEY_NUMERIC_7
0x02000025 KEY_NUMERIC_8
0x02000026 KEY_NUMERIC_9
0x02000027 KEY_NUMERIC_0
0x28b595b7 KEY_NUMERIC_1
0x2bb195b7 KEY_NUMERIC_2
0x28b195b7 KEY_NUMERIC_3
0x2a8595b7 KEY_NUMERIC_4
0x299595b7 KEY_NUMERIC_5
0x2aa595b7 KEY_NUMERIC_6
0x2b9395b7 KEY_NUMERIC_7
0x2a8515b7 KEY_NUMERIC_8
0x2aa115b7 KEY_NUMERIC_9
0x2ba595b7 KEY_NUMERIC_0
0x02200025 KEY_NUMERIC_STAR
0x28b515b7 KEY_NUMERIC_STAR
0x02200020 KEY_NUMERIC_POUND
0x29a115b7 KEY_NUMERIC_POUND
0x2b8515b7 KEY_VIDEO
0x299195b7 KEY_AUDIO
0x2ba115b7 KEY_IMAGES
0x28a515b7 KEY_TV
0x29a395b7 KEY_DVD
0x29a295b7 KEY_DVD
0x2ba385b7 KEY_MENU
0x2ba395b7 KEY_MENU
0x288515b7 KEY_BOOKMARKS
0x2ab715b7 KEY_CAMERA
0x298595b7 KEY_SUBTITLE
0x2b8595b7 KEY_LANGUAGE
0x29a595b7 KEY_ZOOM
0x2aa395b7 KEY_SCREEN
0x299115b7 KEY_KEYBOARD
0x299135b7 KEY_KEYBOARD
ir-keytable -c -w /etc/rc_keymaps/imon_pad
(2012-06-10, 21:20)brando56894 Wrote: It may look like it's working correctly but actually it isn't. What you see from ir-keytable is just the commands that the remote is sending, Linux nor XBMC understand those except for volume, mute and up/down/left/right. All that proves is that your receiver is communicating with the remote successfully, which is the first step (obviously!thank you very much for posting your config, it helps me to make my remote works with xbmc.)The first thing you should do is remove lirc, you're not going to need it, ir-keytable is the new replacement for lirc. I know it's a little time consuming but you may want to run ir-keytable -t and go through each button sequentially and write down it's offset (only the last two digits should change per key so you shouldn't have to write down the whole offset, at least that's how mine was) and corresponding function on the remote since all the functions listed in the keymap probably aren't included on the remote, you don't want to be mapping functions to non-existent keys and wondering why the hell they don't work, do you?
You need to take a look at XBMC's keyboard.xml (mentioned in the first post) and make those keys match your rc_rc6_mce file. For example, to get Channel - to scroll down a page while in your library, but to have it decrease channels in something like PseudoTV your rc_rc6_mce file should say 0x800f0413 KEY_PAGEDOWN instead of 0x800f0413 KEY_CHANNELDOWN since your remote is actually emulating your keyboard, you want XBMC to see it as a keyboard not a remote.
You should copy /lib/udev/keymaps/rc_rc6_mce to /etc/rc_keymaps and name it something like rc_rc6_xbmc and edit that file, not the original one in /lib, you also need to place your custom keymaps (the XML file not the one from /lib) for XBMC (for example, if you want to make one button do multiple actions depending on the window you're at) in ~/.xbmc/userdata/keymaps
Here's my ~/.xbmc/userdata/keymaps/rc6-remote.xml and here's my /etc/rc_keymaps/rc6_mce_xbmc
To set your mappings and see if they're set correctly run sudo ir-keytable -c -w /etc/rc_keymaps/whatever you named your file; ir-keytable -t if everything is set correctly the buttons should show what you have them mapped to (channel - would show KEY_PAGEDOWN instead of KEY_CHANNELDOWN)
I know it's a little wordy, but this is how it's exactly explained in the "let the kernel do everything" sectionHope that cleared a lot up for you, I'm a huge geek and it took me a good 30-45 minutes to even figure out what the hell I was doing. Once you understand what's actually going on it's pretty simple. Essentially, your remote sends an offset (0x4357348), ir-keytable corresponds that offset to whatever you have set in the keymap, then XBMC does the corresponding action that's set to the ir-keytable keymap. You can even use it outside of XBMC and it will print things just like you're using a keyboard. It's actually pretty nifty. Once you have everything setup the way you want it to, you need to have it autoload the keymap from /etc I put mine in /etc/bash.bashrc
I hope I've included everything I learned, I must have edited this damn post about ten times! lol If this helped please +Rep it!
<h>XBMC.ActivateWindow(Home)</h>
<h>ActivateWindow(Home)</h>
(2011-07-10, 13:46)teeedubb Wrote: One thing worth mentioning is that to resume from the remote with newer kernels you need to enable wake up on the actual receiver device aswell as the usb port.Thanks for this, but it's not quite working for me.
lsusb will list your attached usb devices:
Code:$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[b]Bus 004 Device 002: ID 1934:[u]5168[/u] Feature Integration Technology Inc. (Fintek) F71610A or F71612A Consumer Infrared Receiver/Transceiver[/b]
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 0b38:0010 Gear Head 107-Key Keyboard
Bus 002 Device 005: ID 046d:c049 Logitech, Inc. G5 Laser Mouse
Bus 002 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)
Bus 002 Device 002: ID 1a40:0101 TERMINUS TECHNOLOGY INC. USB-2.0 4-Port HUB
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The bold line of text is my usb mce ir receiver. Use the device id (5168 in my case) with the following command to find your device in /sys/bus/usb/devices
Code:$ grep 5168 /sys/bus/usb/devices/*/idProduct
/sys/bus/usb/devices/4-2/idProduct:5168
Now use that location to check if wakeup from the device is enabled with:
Code:$ cat /sys/bus/usb/devices/4-2/power/wakeup
disabled
The following command will change this setting to enabled:
Code:$ sudo sh -c 'echo "enabled" > /sys/bus/usb/devices/4-2/power/wakeup'
This setting will be reset on boot so to enable it on every boot I added the following line to my /etc/rc.local file (the first line is to enable wake up on the usb port, as per this wiki article.)
Code:echo USB1 > /proc/acpi/wakeup
echo enabled > /sys/bus/usb/devices/4-2/power/wakeup
Make sure /etc/rc.local is executable with the command
Code:sudo chmod +x /etc/rc.local
This got wake from the remote working for me, and after some testing it seems to work more reliably than on lucid...
xbmc@htpc:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver
Bus 002 Device 003: ID 04f2:0963 Chicony Electronics Co., Ltd
xbmc@htpc:~$ grep 0815 /sys/bus/usb/devices/*/idProduct
/sys/bus/usb/devices/2-3/idProduct:0815
xbmc@htpc:~$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo USB2 > /proc/acpi/wakeup
echo enabled > /sys/bus/usb/devices/2-3/power/wakeup
exit 0
xbmc@htpc:~$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
SMB0 S4 *disabled pci:0000:00:03.2
USB0 S3 *disabled pci:0000:00:04.0
USB2 S3 *enabled pci:0000:00:04.1
NMAC S5 *enabled pci:0000:00:0a.0
PBB0 S4 *disabled pci:0000:00:09.0
HDAC S4 *disabled pci:0000:00:08.0
XVR0 S4 *disabled pci:0000:00:0c.0
XVR1 S4 *disabled
P0P5 S4 *disabled
P0P6 S4 *disabled pci:0000:00:15.0
P0P7 S4 *disabled pci:0000:00:16.0
P0P8 S4 *disabled pci:0000:00:17.0
P0P9 S4 *disabled pci:0000:00:18.0
xbmc@htpc:~$ cat /sys/bus/usb/devices/2-3/power/wakeup
enabled
root@xbmc:~# uname -a
Linux xbmc 3.5.0-15-generic #22-Ubuntu SMP Fri Sep 21 00:39:52 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
root@xbmc:~# sudo apt-get purge lirc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lirc is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@xbmc:~# ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event2) with:
Driver nuvoton-cir, table rc-rc6-mce
Supported protocols: NEC RC-5 RC-6 JVC SONY LIRC other
Enabled protocols: RC-6
Repeat delay = 500 ms, repeat period = 125 ms
cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
ir-keytable -c -w /etc/rc_keymaps/rc6_mce
exit 0
#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.
#Configuration for the Linux input layer (/dev/input/eventX) remote:
include "/usr/share/lirc/remotes/devinput/lircd.conf.devinput"
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Linux input layer (/dev/input/eventX)"
REMOTE_MODULES=""
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/by-id/usb-15c2_0036-event-if00"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="devinput/lircd.conf.devinput"
REMOTE_LIRCD_ARGS=""
#Chosen IR Transmitter
TRANSMITTER="None"
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=""
# table imon_mce, type: RC6
0x800ff415 KEY_R #Rewind
0x800ff414 KEY_F #FastForward
0x800ff41b KEY_, #Previous button
0x800ff41a KEY_. #Next button
0x800ff416 KEY_PLAY #Play
0x800ff418 KEY_PLAYPAUSE #Pause
0x800ff419 KEY_X #Stop
0x800ff417 KEY_RECORD #Record
0x02000052 KEY_UP #Up Direction
0x02000051 KEY_DOWN #Down Direction
0x0200004f KEY_RIGHT #Right Direction
0x02000050 KEY_LEFT #Left Direction
0x02000028 KEY_ENTER #OK/Enter
0x0200002a KEY_BACK #Back/Exit
0x02000029 KEY_BACKSPACE #Delete button - Backspace
0x800ff40e KEY_MUTE #Mute
0x800ff410 KEY_VOLUMEUP #Volume Up
0x800ff411 KEY_VOLUMEDOWN #Volume Down
0x800ff412 KEY_PAGEUP #ChannelUp button - PageUp
0x800ff413 KEY_PAGEDOWN #ChannelDown button - PageDown
0x0200001e KEY_1 #Numeric_1 button
0x0200001f KEY_2 #Numeric_2 button
0x02000020 KEY_3 #Numeric_3 button
0x02000021 KEY_4 #Numeric_4 button
0x02000022 KEY_5 #Numeric_5 button
0x02000023 KEY_6 #Numeric_6 button
0x02000024 KEY_7 #Numeric_7 button
0x02000025 KEY_8 #Numeric_8 button
0x02000026 KEY_9 #Numeric_9 button
0x02000027 KEY_0 #Numeric_0 button
0x02200025 KEY_NUMERIC_STAR #* button
0x02200020 KEY_NUMERIC_POUND ## button
0x800ff446 KEY_TV #Unknown button on remote control handset
0x800ff447 KEY_AUDIO #Not Working Music button
0x800ff448 KEY_PVR #Not Working Record TV button
0x800ff449 KEY_CAMERA #Not Working Pictures button
0x800ff44a KEY_VIDEO #Not Working Videos button
0x800ff424 KEY_DVD #Not Working DVD Menu button
0x800ff425 KEY_TUNER #Not Working Live TV button
0x800ff450 KEY_RADIO #Not Working Radio button
0x800ff44c KEY_LANGUAGE #Unknown button on remote control handset
0x800ff427 KEY_ZOOM #Unknown button on remote control handset
0x800ff45b KEY_RED #Red button
0x800ff45c KEY_GREEN #Green button
0x800ff45d KEY_YELLOW #Yellow button
0x800ff45e KEY_BLUE #Blue button
0x800ff40f KEY_I #Info button - Information
0x800ff426 KEY_C #EPG/Guide button - Context Menu
0x800ff45a KEY_T #Subtitle button - Toggle Subtitles
0x800ff44d KEY_TITLE #Not Assigned
0x800ff40c KEY_POWER #Power - Brings up Shutdown menu
0x800ff40d KEY_ESC #MCE Green button - Home
<!-- Added by Stuart -->
<f1>SkipNext</f1> <!-- Skip -->
<f2>SkipPrevious</f2> <!-- Replay -->
</keyboard>
</global>
0x800ff41b KEY_F2 #Previous button
0x800ff41a KEY_F1 #Next button
<suspend>XBMC.ShutDown()</suspend>
0x800ff40c KEY_POWER
0x800ff40c KEY_SUSPEND
(2011-09-15, 23:29)koekiemonster Wrote: so now my problem:
when i'm in plain ubuntu (nautilus for instance) the resonse is perfect: tapping down once steps 1 down, tapping 3 times steps down 3 items, holding the button starts scrolling a little faster.
however when i'm inside XBMC, it gets messy. pressing a button once works, pressing it two times sometimes works, sometimes steps down only 1. but when pressing a button 3 times fast, it jumps a lot of items (something between 4 to 10 or more).
i've tried all sort of things with the interkey delay in the harmony software: no difference.
also fiddeling with the repeat delay and repeat period in the ir-keytable doesn't change anything. (not strange, ubuntu is working fine, its XBMC that's acting funny)
I was hoping that your remote controller knowledge also extends a bit into XBMC itself, can you help me with this anoying problem?