How to get a seamless remote experience

  Thread Rating:
  • 6 Votes - 4.17 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
LB06 Offline
Fan
Posts: 316
Joined: Aug 2010
Reputation: 10
Location: Europe
Post: #81
Oops, I was replying to a post on page 1. Excusez-moi.
(This post was last modified: 2012-06-30 00:40 by LB06.)
find quote
tammer Offline
Junior Member
Posts: 8
Joined: Jul 2008
Reputation: 0
Post: #82
Thanks so much for this excellent guide! I got mine to work earlier, but I pined for a step-by-step like this one.

Quick question, I don't see anything mentioned about transmitting (as in using an ir-blaster to send signals). I'm assuming I'll need LIRC to communicate with ir-core to do so. Just curious if you knew a way to do so with only ir-core.
find quote
biau Offline
Junior Member
Posts: 4
Joined: Aug 2012
Reputation: 0
Wink  RE: [Linux] How-to get a seamless remote experience Post: #83
(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! Big Grin )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? Wink

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" section Big Grin Hope 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!
thank you very much for posting your config, it helps me to make my remote works with xbmc.
Just a small modification I've made: you can change from
Code:
<h>XBMC.ActivateWindow(Home)</h>
to
Code:
<h>ActivateWindow(Home)</h>
in your keymap file and your home key will work
find quote
HunterZ Offline
Member
Posts: 59
Joined: Dec 2010
Reputation: 0
Location: Seattle
Post: #84
(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.

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...
Thanks for this, but it's not quite working for me.

I have an Acer Revo AR3610 HTPC with XBMCbuntu and a Windows MCE IR remote + USB sensor. The remote worked great out of the box (although I did have to fix the LIRC config at one point, as it got an apt-get update at one point that made it start expecting the wrong device name or something), except that it won't wake the HTPC from suspend/sleep.

I followed your guide, and it did make the LED on the USB IR work when the HTPC is asleep, but the HTPC still doesn't wake up when I press the power button (or any other button) on the MCE remote.

I tried running with the BIOS set to S1 and then with S3, with no success. All "wake on X" options are enabled except for "wake on RTC" (which lets you choose a time to wake up), including "wake on USB keyboard/mouse".


Here is my setup:
Code:
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

As you can see, everything is configured correctly per your guide.

EDIT: Never mind! It turns out I needed to set wakeup enabled on USB0 instead of USB2. Works great now!
(This post was last modified: 2012-09-26 05:35 by HunterZ.)
find quote
Plecebo Offline
Junior Member
Posts: 15
Joined: Jun 2009
Reputation: 0
Post: #85
Thanks for this great guide, i'm almost 100% happy with my remote/xbmc configuration, except for one issue.

Only in xbmc my remote responds to a quick double key press with an unpredictable repetition of the key press. Here is my info.

I have one of these ir recievers: http://shop.inteset.com/Products/28-inte...oards.aspx

but I was having similar issues with my usb ir reciever

Running Ubuntu 12.04 with the stable PPA install of xbmc Eden but I had similar issues running xbmc Eden on 11.10
Code:
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
no lirc
Code:
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.

receiver detected fine
Code:
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

Got the config loading on boot
Code:
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

the file /etc/rc_keymaps/rc6_mce is a copy of the default rc6_mce file, no changes made so far.

Here is a pastebin of the output of ir-keytable -t : http://paste.ubuntu.com/1261418/

Here is a xbmc debug log of the same events : http://paste.ubuntu.com/1261421/ (sorry should have turned off library scans before rebooting, the relevant stuff is near the bottom)

You can see i press the down button key two times, but xbmc registers like 20 presses.

So far the only solution i've seen is to install lirc and it works. I'd rather figure out what is going on then just default to lirc.

Any ideas?
find quote
cw-kid Online
Fan
Posts: 562
Joined: Jun 2012
Reputation: 0
Post: #86
Thank you very much LB06 for taking the time to write this guide, it has made things clearer for me. I am hoping it will help me to finally get my remote control working properly?

I am a Linux and XBMC newbie and have been really struggling to get my MCE remote control working with a Soundgraph iMON receiver. I initially followed this guide here which kinda works but I end up with lots of buttons on the remote control that send double commands / presses so it doesn't work well as all.

I am trying to do part 2.3 Let the kernel cooperate with LIRC. As I intend to later use irexec to launch scripts to run wget commands to control some thing on my home automation system. Anyways..

When I run this command:

xbmc@xbmc01:~$ sudo /usr/bin/ir-keytable -c -w /lib/udev/rc_keymaps/imon_mce -p RC-6,LIRC
Read imon_mce table
Old keytable cleared
Wrote 77 keycode(s) to driver
Protocols changed to RC-6 LIRC

My remote control stops working all together. If I run the command again but take off the LIRC Protocol my remote starts working again.

xbmc@xbmc01:~$ sudo /usr/bin/ir-keytable -c -w /lib/udev/rc_keymaps/imon_mce -p RC-6
Read imon_mce table
Old keytable cleared
Wrote 77 keycode(s) to driver
Protocols changed to RC-6

I also ran this command: sudo modprobe ir-lirc-codec

Any ideas? I have been right through the imon_mce keymap file and checked all the scancodes are correct with ir-keytable -t

I think LIRC is setup correctly.

lircd.conf

Code:
#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"

hardware.conf

Code:
# /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=""

Also ir-keytable -t only seems to work when LIRC is disabled or not configured to use the Linux Input Layer, should both ir-keytable -t and irw work at the same time?

Thanks
find quote
dencrypt Offline
Junior Member
Posts: 2
Joined: Oct 2012
Reputation: 0
Post: #87
Just want to give anyone else struggling with this with Debian Wheezy and median X10.

All worked in ir-keytable and everything was mapped correctly but irw would not take any arguments when using the remote. Turns out I was missing the inputlirc package somehow and as soon as I installed this irw started to work.

Hope it helps anyone. Took me a while Wink
find quote
cw-kid Online
Fan
Posts: 562
Joined: Jun 2012
Reputation: 0
Post: #88
I decided to try the do everything in kernel option, so I uninstalled LIRC.

After making some changes in the imon_mce keymap file most buttons are now working OK and I no longer have the double command / presses problem!

In the keymap file I had to change things like KEY_INFO to KEY_I and KEY_STOP to KEY_X for these buttons to then start working. I was using this page here which list XBMC Keyboard shortcuts.

However some buttons are still not working:

1. All the number buttons 0-9 do not work. FIXED Changing KEY_NUMERIC_1 to KEY_1
2. On the MCE remote control there are buttons that say Pictures / Video / Music etc, I would like these buttons to jump me in to those parts of XBMC but I don't know how to do this ? CTRL+I on the keyboard opens pictures but I can't put in CTRL+I in to the imon_mce keymap file ?
3. The skip and previous buttons don't do anything, shouldnt they skip music tracks back and forth ? I've tried using comma and period

Can anyone help me fix these buttons that are not working?

I haven't really started looking at the keyboard.xml file yet, all I have done is copied the one from here and put it in this folder: :/home/xbmc/.xbmc/userdata/keymaps

Below is my current imon_mce keymap file which is in /etc/rc_keymaps.

Code:
# 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

I am using an OrigenAE M10 HTTP case which has a SoundGraph VF-310 unit.

Bus 002 Device 003: ID 15c2:0036 SoundGraph Inc. LC16M VFD Display/IR Receiver

I am using a Logitech Harmony 895 remote control programmed as a MCE remote. I also have a standard Microsoft MCE remote here for testing as well.

Thanks

EDIT:

I got SkipNext and SkipPrevious working, I added the following in to the keyboard.xml file

Code:
<!-- Added by Stuart -->
      <f1>SkipNext</f1>          <!-- Skip -->
      <f2>SkipPrevious</f2>      <!-- Replay -->
    </keyboard>
  </global>

This then meant I could press F1 on the keyboard to Skip and F2 for Previous.

I then changed the buttons in the imon_mce keymap file

Code:
0x800ff41b KEY_F2               #Previous button
0x800ff41a KEY_F1               #Next button

Now when I am playing music the Skip / Previous buttons are working. Not sure if this was the best way to do it? But at least it works.

One thing I don't like the PowerToggle button on the remote control handset brings up the Shutdown menu in XBMC. Before it would just suspend the PC.

EDIT2:

XBMC.ShutDown() = Shutdown and power off

I just added this line in to the keyboard.xml file

Code:
<suspend>XBMC.ShutDown()</suspend>

I then edited the imon_mce keymap file and changed

Code:
0x800ff40c KEY_POWER

to be

Code:
0x800ff40c KEY_SUSPEND

Now when I press the powertoggle button on the MCE remote control the PC is suspended (S3 Sleep mode). I also have it set to suspend in the XBMC Settings -> System -> Power saving -> Shutdown function = Suspend.
(This post was last modified: 2013-02-27 22:13 by cw-kid.)
find quote
GreatEmerald Offline
Junior Member
Posts: 9
Joined: Mar 2013
Reputation: 1
Post: #89
(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?

Yeap, same issue here. Tapping a button sometimes does not go the required number of steps, and holding an arrow button makes it zoom all over the place extremely fast, it's like 100 presses in a second. While holding the volume buttons does nothing, I have to tap them to slowly change the volume.

I know that if I use it with LIRC, it will work, but I want to find out why it won't work with the pure in-kernel solution. Part of the reason is that I have had problems when resuming LIRC, the remote simply didn't respond, and I can't do anything with wakeup, because it's a PCI remote, not a USB one. (Then again, the whole card used to lock up every time it resumed from sleep, so it might have been related to that - solved by having systemd automatically remove the kernel module for the card before going to sleep, and reinserting it on wakeup. Still, if I took the time to set this up with the in-kernel method, it would be nice to finish the task...)
find quote
teeedubb Offline
Member+
Posts: 741
Joined: Mar 2010
Reputation: 11
Location: Down Under
Post: #90
Have you guys tried changind the repeat and delays? Eg:

sudo ir-keytable --delay 500
sudo ir-keytable --period 50

?

XBMC Steam Launcher - Only available for XBMC.
find quote
Post Reply