Kodi Community Forum

Full Version: [LINUX] HOW-TO to get CyberLink Remote working in Ubuntu 9.10
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi

This is a guide for getting the Cyberlink remote shown below to work in Ubuntu 9.10 Karmic Koala. It may possible to adapt this to other versions, distros etc.

This remote is one of the cheapest remote you can buy here in the UK
Image



This has been become much easier in Ubuntu 9.10 because a patch has been added into kernels after 2.6.30 (Ubuntu 9.10 uses 2.6.31).

Step 1: Check the remote is working and get the event number
Execute the following command on the command line:
Code:
cat /proc/bus/input/devices
This should output information about all the human input devices connected to your machine. If the remote is connected properly this should include two blocks that are similar to mine shown below:
Code:
I: Bus=0003 Vendor=0766 Product=0204 Version=0100
[color=GREEN]N: Name="TopSeed Tech Corp. USB IR Combo Device "[/color]
P: Phys=usb-0000:00:02.0-7/input0
S: Sysfs=/devices/pci0000:00/0000:00:02.0/usb2/2-7/2-7:1.0/input/input5
U: Uniq=
H: Handlers=kbd [color=red][b]event5[/b][/color]
B: EV=120013
B: KEY=1000000000007 ff9f207ac14057ff febeffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=0766 Product=0204 Version=0100
[color=GREEN]N: Name="TopSeed Tech Corp. USB IR Combo Device "[/color]
P: Phys=usb-0000:00:02.0-7/input1
S: Sysfs=/devices/pci0000:00/0000:00:02.0/usb2/2-7/2-7:1.1/input/input6
U: Uniq=
H: Handlers=kbd mouse2 [color=red][b]event6[/b][/color]
B: EV=17
B: KEY=fc112 20d0c0000000000 70000 18000 21f8d001d804 9e004000000000 0
B: REL=103
B: MSC=10
The sections in green are important. If your output does not contain blocks with names like that then either your remote is not the same as mine and this guide is not for you or your remote is not working properly.



Step 2: Install LIRC
This is the
Code:
sudo apt-get install lirc

Step 3: Configure your lircd processes
This unfortunately is extra complicated due to the fact that the Cyberlink remote shows up as two devices. Don't worry though, help is at hand. the clever people that wrote LIRC designed it such that you can start multiple processes and connect them together so the remote acts like one device.
Furthermore Mario Limonciello and the rest of the clever people who integrate LIRC into Ubuntu have made it easy to configure these processes in this setup.

So a Big Thankyou to all of them!!

Stop the lircd deamon:
Code:
sudo /etc/init.d/lirc stop
Perhaps repeat this a couple of time to make sure it worked.

You need to edit the hardware.conf, you will need to do this with root permissions like so:
Code:
sudo vi /etc/lirc/hardware.conf

Edit your file to look like mine below. Don't worry about the fact one says it's a transmitter just go with it.

We're going to use the by id symlinks, this means if the device numbers change it will automatically point to the correct devices.
Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="CYBERLINK"
REMOTE_MODULES=""
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/by-id/usb-TopSeed_Tech_Corp._USB_IR_Combo_Device-event-mouse"
REMOTE_SOCKET="/var/run/lirc/lircd2"
REMOTE_LIRCD_CONF="devinput/lircd.conf.devinput"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="CYBERLINK"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER="devinput"
TRANSMITTER_DEVICE="/dev/input/by-id/usb-TopSeed_Tech_Corp._USB_IR_Combo_Device-event-kbd"
TRANSMITTER_SOCKET="/var/run/lirc/lircd"
TRANSMITTER_LIRCD_CONF="devinput/lircd.conf.devinput"
TRANSMITTER_LIRCD_ARGS="-a "

Restart the lircd deamon:
Code:
sudo /etc/init.d/lirc restart
Perhaps repeat this a couple of time to make sure it worked.

Check if its running:
Code:
ps -ef | grep lircd

Hopefully you will see two instances of lircd similar to mine shown below:
Code:
/usr/sbin/lircd --output=/var/run/lirc/lircd2 --driver=devinput --device=/dev/input/by-id/usb-TopSeed_Tech_Corp._USB_IR_Combo_Device-event-mouse --listen
/usr/sbin/lircd --output=/var/run/lirc/lircd1 --driver=devinput --device=/dev/input/by-id/usb-TopSeed_Tech_Corp._USB_IR_Combo_Device-event-kbd -a --connect=localhost 8765 --pidfile=/var/run/lirc/lircd1.pid

If you do this is the hard bit done.. :-)
Grab a cup of tea or a beer.

Step 4: Test your LIRC daemon
Run the following command:
Code:
irw /var/run/lirc/lircd1
Now press all the buttons on your remote. If all is working well you should get out put similar to the following:

Code:
0000000080010066 00 KEY_HOME devinput
000000008001008e 00 KEY_SLEEP devinput
000000008001018e 00 KEY_RED devinput
000000008001018f 00 KEY_GREEN devinput
0000000080010190 00 KEY_YELLOW devinput
And so on...

If so your remote is working well. Make sure all keys result in output.

Step 5: Link the defualt socket to your socket
This step is optional. With most programs including xbmc it's possible to tell it which socket to connect to. But most programs default to /dev/lircd so we'll make that work here:
Code:
sudo rm -f /dev/lircd
sudo ln -s /var/run/lirc/lircd1 /dev/lircd

Step 6: Configure xbmc with your remote
In this step we'll simply copy my config to your xbmc profile.

Quote:wget http://www.protazoa.com/cyberlink-remote/Lircmap.xml -O ~/.xbmc/userdata/Lircmap.xml
mkdir -p ~/.xbmc/userdata/kemaps
wget http://www.protazoa.com/cyberlink-remote/remote.xml -O ~/.xbmc/userdata/keymaps/remote.xml
Hi

Thanks, nice guide - I got further than I did with the other cyberlink guide. I think I'm nearly there but it doesn't quite work - irw /var/run/lirc/lircd1 doesn't output anything in a ssh and refuses to run in a Ctrl/Alt Fx shell. Completing the remaining steps regardless the Cyberlink Remote still only has the same limited number of keys that were working before. I'm running the latest alpha Live installed onto the HD of a Dual Core Revo.

I did spot what I think maybe a couple of simple typos.

Code:
TRANSMITTER_SOCKET="/var/run/lirc/lircd"
should it be:
Code:
TRANSMITTER_SOCKET="/var/run/lirc/lircd1"

Code:
mkdir -p ~/.xbmc/userdata/kemaps
should it be:
Code:
mkdir -p ~/.xbmc/userdata/keymaps
This post helped a lot to understanding what was happening with the event number, I finally got it working by using the setup instructions in the other thread http://forum.xbmc.org/showthread.php?tid=61219 but I sftped the various files into the xbmc root and sudo mv'd the files into the correct places.
Hi guys,
Has anyone with this remote managed to get it to wake up their PC's from S3 sleep?
Ahhh just noticed I dont seem to have got the notification for this thread.

Is anyone still having a problem with this?

The two ways of doing it are slightly different.
One half of this device acts like a keyboard and has basic buttons like left, right etc. This functionality pretty much works on its own. But the other device does not work my

My way sends all output via LIRC which potentially makes the mapping easier. The other way while easier to set up only uses lirc for the more complicated half of the remote. Swings,roundabouts...

Is anyone still having a problem with this
zubs Wrote:Hi guys,
Has anyone with this remote managed to get it to wake up their PC's from S3 sleep?

I cant say I've tried, I never shut down my media center/server.

Sorry
Slate Wrote:Hi

Thanks, nice guide - I got further than I did with the other cyberlink guide. I think I'm nearly there but it doesn't quite work - irw /var/run/lirc/lircd1 doesn't output anything in a ssh and refuses to run in a Ctrl/Alt Fx shell. Completing the remaining steps regardless the Cyberlink Remote still only has the same limited number of keys that were working before. I'm running the latest alpha Live installed onto the HD of a Dual Core Revo.

I did spot what I think maybe a couple of simple typos.

Code:
TRANSMITTER_SOCKET="/var/run/lirc/lircd"
should it be:
Code:
TRANSMITTER_SOCKET="/var/run/lirc/lircd1"

Code:
mkdir -p ~/.xbmc/userdata/kemaps
should it be:
Code:
mkdir -p ~/.xbmc/userdata/keymaps

Some are typos some are not. Sounds like you got it working with the other method but if your still interested reply. I think I missed a notification at some point and the forum does not do notifications until you read the thread again. I would normally reply to posts like this.
It would be handy if you could state which were typos and which aren't.

Thanks for this post I've still not got my Cyberlink working very close though, like Slate I get stuck at
Code:
irw /var/run/lirc/lircd1
and I have the same set up as him :confused2:
Update got it working Smile

But the DVD MUSIC PICTURES coloured buttons at the top don't work - should they?

Thanks for your help Smile
The guide was corrected after there were typos

tail the xbmc log and press those buttons so we can check that there actually registering as buttons.

also try adding the following to the keymap file in userdata keymaps

Code:
<global>
    <remote>
      <power>ActivateWindow(shutdownmenu)</power>
      <yellow>XBMC.ActivateWindow(MyPictures)</yellow>
      <green>XBMC.ActivateWindow(MyMusic)</green>
      <blue>XBMC.ActivateWindow(MyVideos)</blue>
      <menu>ContextMenu</menu>
    </remote>
</global>
Hi I can't get

Code:
irw /var/run/lirc/lircd1

to work on my machine (Revo dual core with XBMC Live 9.11 RC1).

It says directory does not exist.

Also in File Manager, with the Wii remote I used to be able to mark files and move/copy etc but I can't do that now... I can only delete using the clear key.

I am actually using this guide and have used their Keymap... but yours was a lot of help too!
beebul Wrote:Hi I can't get

Code:
irw /var/run/lirc/lircd1

to work on my machine (Revo dual core with XBMC Live 9.11 RC1).

It says directory does not exist.

Also in File Manager, with the Wii remote I used to be able to mark files and move/copy etc but I can't do that now... I can only delete using the clear key.

I am actually using this guide and have used their Keymap... but yours was a lot of help too!

Ok cool, please can you give us the output of the following command
Quote:ps -ef | grep -i lirc

For me this looks like this:
Code:
root      1375     1  0 Dec17 ?        00:00:00 /usr/sbin/lircd --output=[u]/var/run/lirc/lircd2[/u] --driver=devinput --device=/dev/input/event6 --listen
root      1379     1  0 Dec17 ?        00:00:00 /usr/sbin/lircd --output=[u]/var/run/lirc/lircd1[/u] --driver=devinput --device=/dev/input/event5 -a --connect=localhost 8765 --pidfile=/var/run/lirc/lircd1.pid

I have two instances of lirc but you will probably only have one, this is because the device splits into two separate devices and my method routes every thing via lirc and connects them together so the one with --listen in the command line receives all the events from the other.

The underlined section represents where your output is feeding to. This is what you want to use as the argument for irw.

If it still does not work post back including the output of
Quote:ps -ef | grep -i lirc
and
Code:
grep -i lirc ~/..xbmc/temp/xbmc.log
Hi - I'm confused.

If I'm not mistaken, your remote control emulates 2 devices (an HID keyboard and an HID mouse).

I can't find any documentation on hardware.conf, but I assume that all the parameters for the TRANSMIT device are for an IR device that actually transmits IR signals. But I notice that in your example, you have filled-in the TRANSMIT section with the parameters from your HID mouse. Why is this done?

Thanks
This confused me at first too

One thing to note is the the hardware.conf file is part of ubuntu/debian's implmentation/integration of lirc so the the fact that it says Transmitter at all is there doing

This is done because the way you connect a transmitter is exactly the same as the way you connect a second device. As most people don't have a transmitter this is the easiest way to set up multiple lirc devices and join them together.

If however you actually have a transmitter and or need more than two devices you'll probably have to use a more complicated init script than the one that comes with ubuntu.

My suggestion is just try it and see for yourself that it works
Slate Wrote:This post helped a lot to understanding what was happening with the event number, I finally got it working by using the setup instructions in the other thread http://forum.xbmc.org/showthread.php?tid=61219 but I sftped the various files into the xbmc root and sudo mv'd the files into the correct places.

I also used the alternative setup above with success on Ubuntu 9.10.
Pages: 1 2