Linux How To get a Cyberlink remote working with Suspend & resume on Eden for n00bs
#1
The TopSpeed Cyberlink remote from Jess-Link Product Co also known as a Theatrix from Sapphire.com is a really cheap option in the UK. The problem is that for XBMC-live and XBMCbuntu only a handful of buttons work out of the box. Interestingly, all the buttons work out of the box on OpenElec.

There is also an issue with suspending XBMCbuntu and making the resume work from the remote.

I am by no means a linux expert just quiet proficient with linux and good at research Big Grin This represents all the information I found to enable me to get this remote working on my Shuttle XS35, really as a reminder to myself. I have ensured the original authors are referenced as appropriate.

1. Getting the remote working properly.

The Wiki entry is pretty good but there are a few assumptions made that a n00b user might have problems with:
http://wiki.xbmc.org/index.php?title=HOW...e_on_Linux

First get root access:
Code:
$ sudo -i

Work out which device input your remote is attached to as you will need to select this in the LIRC setup process, unfortunately the LIRC setup lists the devices as listed in the /dev/input/by-path so the method in the wiki didn't work for me, I used evtest instead
Install evtest:
Code:
$ apt-get install evtest

Then have a look in the /dev/input/by-path directory:
Code:
$ cd /dev/input/by-path
$ ls
pci-0000:00:1b.0-event-sndjack         pci-0000:00:1d.0-usb-0:1:1.1-ir
pci-0000:00:1d.0-usb-0:1:1.0-event-ir  pci-0000:01:00.1-event-sndjack
pci-0000:00:1d.0-usb-0:1:1.1-event-ir  platform-i8042-serio-0-event-kbd

The likely culprit will have event-ir at the end, there should be 2 items, the one you need will end xxx.1-event-ir, make a not of this.

run evtest to check your emote is creating events
Code:
$ evtest /dev/input/by-path/pci-0000:00:1d.0-usb-0:1:1.1-event-ir
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x766 product 0x204 version 0x100
Input device name: "TopSeed Tech Corp. USB IR Combo Device "
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 113 (Mute)
    Event code 114 (VolumeDown)
    Event code 115 (VolumeUp)
    Event code 116 (Power)
    Event code 119 (Pause)
    Event code 130 (Props)
    Event code 139 (Menu)
    Event code 140 (Calc)
    Event code 142 (Sleep)
    Event code 143 (WakeUp)
    Event code 144 (File)
    Event code 156 (Bookmarks)
    Event code 158 (Back)
    Event code 159 (Forward)
    Event code 163 (NextSong)
    Event code 164 (PlayPause)
    Event code 165 (PreviousSong)
    Event code 166 (StopCD)
    Event code 167 (Record)
    Event code 168 (Rewind)
    Event code 173 (Refresh)
    Event code 207 (Play)
    Event code 208 (Fast Forward)
    Event code 212 (Camera)
    Event code 226 (Media)
    Event code 272 (LeftBtn)
    Event code 273 (RightBtn)
    Event code 274 (MiddleBtn)
    Event code 362 (Program)
    Event code 363 (Channel)
    Event code 368 (Language)
    Event code 370 (Subtitle)
    Event code 371 (Angle)
    Event code 377 (TV)
    Event code 378 (TV2)
    Event code 385 (Radio)
    Event code 388 (Text)
    Event code 391 (MP3)
    Event code 392 (Audio)
    Event code 393 (Video)
    Event code 402 (ChannelUp)
    Event code 403 (ChannelDown)
  Event type 2 (Relative)
    Event code 0 (X)
    Event code 1 (Y)
    Event code 8 (Wheel)
  Event type 4 (Misc)
    Event code 4 (ScanCode)
Testing ... (interrupt to exit)
If you now press the home key on your remote you should get an output on the screen:
Code:
Event: time 1335679744.469531, type 4 (Misc), code 4 (ScanCode), value ffbc000d
Event: time 1335679744.469549, type 1 (Key), code 226 (Media), value 1
Event: time 1335679744.469554, type 1 (Key), code 226 (Media), value 0
Event: time 1335679744.469621, -------------- Report Sync ------------
exit evtest by pressing ctrl & c
Install LIRC
Code:
$ apt-get install lirc
During the set up you will need to choose which remote you have, select "hauppauge nova-t 500", for the ir transmitter select "none", for the custom event interface select the device you made a not of and tested above. If you get this wrong then you can re-run the set up with this command: dpkg-reconfigure lirc

Now we need to change LIRC configuration:
First edit /etc/lirc/hardware.conf using your favourite text editor - I like nano
Code:
$ nano /etc/lirc/hardware.conf

remove the enitre contents of this file, I find holding down ctrl & k effective, then paste the following:
Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Cyberlink Media Centre"
REMOTE_MODULES=""
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="`cat /proc/bus/input/devices | grep -A4 "TopSeed" | grep event | tail -n1 | sed 's/.*\(event[0-9]\+\).*/\/dev\/input\/\1/'`"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
REMOTE_LIRCD_ARGS="--device=`cat /proc/bus/input/devices | grep -A4 "TopSeed" | grep event | tail -n1 | sed 's/.*\(event[0-9]\+\).*/\/dev\/input\/\1/'` --driver=dev/input"

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#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=""
Exit nano by pressing crtl & x , answer y to saving the file.

Next edit the remote button config file, replace old content in /etc/lirc/lircd.conf:
Code:
$ nano /etc/lirc/lircd.conf
again remove the entire contents and pate the following:
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 Hauppauge Nova-T 500 remote:
#include "/usr/share/lirc/extras/more_remotes/hauppauge/lircd.conf.hauppauge_novat500"

begin remote
    name linux-input-layer
    bits 32
    begin codes
        ESC                  0x10001
        1                    0x10002
        2                    0x10003
        3                    0x10004
        4                    0x10005
        5                    0x10006
        6                    0x10007
        7                    0x10008
        8                    0x10009
        9                    0x1000a
        0                    0x1000b
        MINUS                0x1000c
        EQUAL                0x1000d
        BACKSPACE            0x1000e
        TAB                  0x1000f
        Q                    0x10010
        W                    0x10011
        E                    0x10012
        R                    0x10013
        T                    0x10014
        Y                    0x10015
        U                    0x10016
        I                    0x10017
        O                    0x10018
        P                    0x10019
        LEFTBRACE            0x1001a
        RIGHTBRACE           0x1001b
        ENTER                0x1001c
        LEFTCTRL             0x1001d
        A                    0x1001e
        S                    0x1001f
        D                    0x10020
        F                    0x10021
        G                    0x10022
        H                    0x10023
        J                    0x10024
        K                    0x10025
        L                    0x10026
        SEMICOLON            0x10027
        APOSTROPHE           0x10028
        GRAVE                0x10029
        LEFTSHIFT            0x1002a
        BACKSLASH            0x1002b
        Z                    0x1002c
        X                    0x1002d
        C                    0x1002e
        V                    0x1002f
        B                    0x10030
        N                    0x10031
        M                    0x10032
        COMMA                0x10033
        DOT                  0x10034
        SLASH                0x10035
        RIGHTSHIFT           0x10036
        KPASTERISK           0x10037
        LEFTALT              0x10038
        SPACE                0x10039
        CAPSLOCK             0x1003a
        F1                   0x1003b
        F2                   0x1003c
        F3                   0x1003d
        F4                   0x1003e
        F5                   0x1003f
        F6                   0x10040
        F7                   0x10041
        F8                   0x10042
        F9                   0x10043
        F10                  0x10044
        NUMLOCK              0x10045
        SCROLLLOCK           0x10046
        KP7                  0x10047
        KP8                  0x10048
        KP9                  0x10049
        KPMINUS              0x1004a
        KP4                  0x1004b
        KP5                  0x1004c
        KP6                  0x1004d
        KPPLUS               0x1004e
        KP1                  0x1004f
        KP2                  0x10050
        KP3                  0x10051
        KP0                  0x10052
        KPDOT                0x10053
        103RD                0x10054
        F13                  0x10055
        102ND                0x10056
        F11                  0x10057
        F12                  0x10058
        F14                  0x10059
        F15                  0x1005a
        F16                  0x1005b
        F17                  0x1005c
        F18                  0x1005d
        F19                  0x1005e
        F20                  0x1005f
        KPENTER              0x10060
        RIGHTCTRL            0x10061
        KPSLASH              0x10062
        SYSRQ                0x10063
        RIGHTALT             0x10064
        LINEFEED             0x10065
        HOME                 0x10066
        UP                   0x10067
        PAGEUP               0x10068
        LEFT                 0x10069
        RIGHT                0x1006a
        END                  0x1006b
        DOWN                 0x1006c
        PAGEDOWN             0x1006d
        INSERT               0x1006e
        DELETE               0x1006f
        MACRO                0x10070
        MUTE                 0x10071
        VOLUMEDOWN           0x10072
        VOLUMEUP             0x10073
        POWER                0x10074
        KPEQUAL              0x10075
        KPPLUSMINUS          0x10076
        PAUSE                0x10077
        F21                  0x10078
        F22                  0x10079
        F23                  0x1007a
        F24                  0x1007b
        KPCOMMA              0x1007c
        LEFTMETA             0x1007d
        RIGHTMETA            0x1007e
        COMPOSE              0x1007f
        STOP                 0x10080
        AGAIN                0x10081
        PROPS                0x10082
        UNDO                 0x10083
        FRONT                0x10084
        COPY                 0x10085
        OPEN                 0x10086
        PASTE                0x10087
        FIND                 0x10088
        CUT                  0x10089
        HELP                 0x1008a
        MENU                 0x1008b
        CALC                 0x1008c
        SETUP                0x1008d
        SLEEP                0x1008e
        WAKEUP               0x1008f
        FILE                 0x10090
        SENDFILE             0x10091
        DELETEFILE           0x10092
        XFER                 0x10093
        PROG1                0x10094
        PROG2                0x10095
        WWW                  0x10096
        MSDOS                0x10097
        COFFEE               0x10098
        DIRECTION            0x10099
        CYCLEWINDOWS         0x1009a
        MAIL                 0x1009b
        BOOKMARKS            0x1009c
        COMPUTER             0x1009d
        BACK                 0x1009e
        FORWARD              0x1009f
        CLOSECD              0x100a0
        EJECTCD              0x100a1
        EJECTCLOSECD         0x100a2
        NEXTSONG             0x100a3
        PLAYPAUSE            0x100a4
        PREVIOUSSONG         0x100a5
        STOPCD               0x100a6
        RECORD               0x100a7
        REWIND               0x100a8
        PHONE                0x100a9
        ISO                  0x100aa
        CONFIG               0x100ab
        HOMEPAGE             0x100ac
        REFRESH              0x100ad
        EXIT                 0x100ae
                MOVE                 0x100af
        EDIT                 0x100b0
        SCROLLUP             0x100b1
        SCROLLDOWN           0x100b2
        KPLEFTPAREN          0x100b3
        KPRIGHTPAREN         0x100b4
        INTL1                0x100b5
        INTL2                0x100b6
        INTL3                0x100b7
        INTL4                0x100b8
        INTL5                0x100b9
        INTL6                0x100ba
        INTL7                0x100bb
        INTL8                0x100bc
        INTL9                0x100bd
        LANG1                0x100be
        LANG2                0x100bf
        LANG3                0x100c0
        LANG4                0x100c1
        LANG5                0x100c2
        LANG6                0x100c3
        LANG7                0x100c4
        LANG8                0x100c5
        LANG9                0x100c6
        PLAYCD               0x100c8
        PAUSECD              0x100c9
        PROG3                0x100ca
        PROG4                0x100cb
        SUSPEND              0x100cd
        CLOSE                0x100ce
        PLAY                 0x100cf
        FASTFORWARD          0x100d0
        BASSBOOST            0x100d1
        PRINT                0x100d2
        HP                   0x100d3
        CAMERA               0x100d4
        SOUND                0x100d5
        QUESTION             0x100d6
        EMAIL                0x100d7
        CHAT                 0x100d8
        SEARCH               0x100d9
        CONNECT              0x100da
        FINANCE              0x100db
        SPORT                0x100dc
        SHOP                 0x100dd
        ALTERASE             0x100de
        CANCEL               0x100df
        BRIGHTNESSDOWN       0x100e0
        BRIGHTNESSUP         0x100e1
        MEDIA                0x100e2
        UNKNOWN              0x100f0
        BTN_MISC             0x10100
        BTN_0                0x10100
        BTN_1                0x10101
        BTN_2                0x10102
        BTN_3                0x10103
        BTN_4                0x10104
        BTN_5                0x10105
        BTN_6                0x10106
        BTN_7                0x10107
        BTN_8                0x10108
        BTN_9                0x10109
        BTN_MOUSE            0x10110
        BTN_LEFT             0x10110
        BTN_RIGHT            0x10111
        BTN_MIDDLE           0x10112
        BTN_SIDE             0x10113
        BTN_EXTRA            0x10114
        BTN_FORWARD          0x10115
        BTN_BACK             0x10116
        BTN_TASK             0x10117
        BTN_JOYSTICK         0x10120
        BTN_TRIGGER          0x10120
        BTN_THUMB            0x10121
        BTN_THUMB2           0x10122
        BTN_TOP              0x10123
        BTN_TOP2             0x10124
        BTN_PINKIE           0x10125
        BTN_BASE             0x10126
        BTN_BASE2            0x10127
        BTN_BASE3            0x10128
        BTN_BASE4            0x10129
        BTN_BASE5            0x1012a
        BTN_BASE6            0x1012b
        BTN_DEAD             0x1012f
        BTN_GAMEPAD          0x10130
        BTN_A                0x10130
        BTN_B                0x10131
        BTN_C                0x10132
        BTN_X                0x10133
        BTN_Y                0x10134
        BTN_Z                0x10135
        BTN_TL               0x10136
        BTN_TR               0x10137
        BTN_TL2              0x10138
        BTN_TR2              0x10139
        BTN_SELECT           0x1013a
        BTN_START            0x1013b
        BTN_MODE             0x1013c
        BTN_THUMBL           0x1013d
        BTN_THUMBR           0x1013e

Code:
BTN_DIGI             0x10140
        BTN_TOOL_PEN         0x10140
        BTN_TOOL_RUBBER      0x10141
        BTN_TOOL_BRUSH       0x10142
        BTN_TOOL_PENCIL      0x10143
        BTN_TOOL_AIRBRUSH    0x10144
        BTN_TOOL_FINGER      0x10145
        BTN_TOOL_MOUSE       0x10146
        BTN_TOOL_LENS        0x10147
        BTN_TOUCH            0x1014a
        BTN_STYLUS           0x1014b
        BTN_STYLUS2          0x1014c
        BTN_WHEEL            0x10150
        BTN_GEAR_DOWN        0x10150
        BTN_GEAR_UP          0x10151
        OK                   0x10160
        SELECT               0x10161
        GOTO                 0x10162
        CLEAR                0x10163
        POWER2               0x10164
        OPTION               0x10165
        INFO                 0x10166
        TIME                 0x10167
        VENDOR               0x10168
        ARCHIVE              0x10169
        PROGRAM              0x1016a
        CHANNEL              0x1016b
        FAVORITES            0x1016c
        EPG                  0x1016d
        PVR                  0x1016e
        MHP                  0x1016f
        LANGUAGE             0x10170
        TITLE                0x10171
        SUBTITLE             0x10172
        ANGLE                0x10173
        ZOOM                 0x10174
        MODE                 0x10175
        KEYBOARD             0x10176
        SCREEN               0x10177
        PC                   0x10178
        TV                   0x10179
        TV2                  0x1017a
        VCR                  0x1017b
        VCR2                 0x1017c
        SAT                  0x1017d
        SAT2                 0x1017e
        CD                   0x1017f
        TAPE                 0x10180
        RADIO                0x10181
        TUNER                0x10182
        PLAYER               0x10183
        TEXT                 0x10184
        DVD                  0x10185
        AUX                  0x10186
        MP3                  0x10187
        AUDIO                0x10188
        VIDEO                0x10189
        DIRECTORY            0x1018a
        LIST                 0x1018b
        MEMO                 0x1018c
        CALENDAR             0x1018d
        RED                  0x1018e
        GREEN                0x1018f
        YELLOW               0x10190
        BLUE                 0x10191
        CHANNELUP            0x10192
        CHANNELDOWN          0x10193
        FIRST                0x10194
        LAST                 0x10195
        AB                   0x10196
        NEXT                 0x10197
        RESTART              0x10198
        SLOW                 0x10199
        SHUFFLE              0x1019a
        BREAK                0x1019b
        PREVIOUS             0x1019c
        DIGITS               0x1019d
        TEEN                 0x1019e
        TWEN                 0x1019f
        DEL_EOL              0x101c0
        DEL_EOS              0x101c1
        INS_LINE             0x101c2
        DEL_LINE             0x101c3
    end codes
end remote


Restart LIRC:
Code:
$ /etc/init.d/lirc restart
test your remote with irw:
Code:
$ irw
Press a couple of buttons and you should get some output:
Code:
000000000001009e 00 BackExit NOVA-T500
00000000000100e2 00 Pictures NOVA-T500
00000000000100e2 00 Pictures NOVA-T500

Exit root:
Code:
$ exit

Next configure XBMC to use your remote events and actions.
First edit the remote control button mapping file, ~/.xbmc/userdata/Lircmap.xml
Code:
$ nano ~/.xbmc/userdata/Lircmap.xml
This file might not exist so you will get a blank page with nano otherwise just remove the contents and paste the following:

Code:
<lircmap>
    <remote device="linux-input-layer">
    <altname>cx23885_remote</altname>
    <altname>devinput</altname>
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <select>KEY_ENTER</select>
        <start>MEDIA</start>
        <back>BACK</back>
        <record>RECORD</record>
        <play>PLAY</play>
        <pause>PAUSE</pause>
        <stop>STOPCD</stop>
        <forward>FASTFORWARD</forward>
        <reverse>REWIND</reverse>
        <volumeplus>VOLUMEUP</volumeplus>
        <volumeminus>VOLUMEDOWN</volumeminus>
        <channelplus>CHANNELUP</channelplus>
        <channelminus>CHANNELDOWN</channelminus>
        <skipplus>NEXTSONG</skipplus>
        <skipminus>PREVIOUSSONG</skipminus>
        <title>TEXT</title>
        <subtitle>SUBTITLE</subtitle>
        <language>LANGUAGE</language>
        <mute>MUTE</mute>
        <power>SLEEP</power>
        <myvideo>VIDEO</myvideo>
        <mymusic>MP3</mymusic>
        <mypictures>CAMERA</mypictures>
        <mytv>TV2</mytv>
        <info>PROPS</info>
        <display>ANGLE</display>
        <menu>MENU</menu>
    </remote>
</lircmap>

Next copy the default XBMC remote actions to your user profile:
Code:
$ cp  /usr/share/xbmc/system/keymaps/remote.xml ~/.xbmc/userdata/keymaps/remote.xml

The are 2 changes you need to make:
Code:
$ nano ~/.xbmc/userdata/keymaps/remote.xml

using the search function by pressing crtl & w in nano, find the following line:
Code:
<mytv>XBMC.ActivateWindow(VideoLibrary,TvShows)</mytv>
replace it with:
Code:
<mytv>XBMC.ActivateWindow(MyWeather)</mytv>
then find:
Code:
<subtitle>ShowSubtitles</subtitle>
replace with:
Code:
<subtitle>NextSubtitle</subtitle>
exit nano and check what you have just done:
Code:
$ diff .xbmc/userdata/keymaps/remote.xml /usr/share/xbmc/system/keymaps/remote.xml
The output should look like:
Code:
69c69
<       <mytv>XBMC.ActivateWindow(MyWeather)</mytv>
---
>       <mytv>XBMC.ActivateWindow(VideoLibrary,TvShows)</mytv>
148c148
<       <subtitle>NextSubtitle</subtitle>
---
>       <subtitle>ShowSubtitles</subtitle>
Your remote should now work properly in XBMC


2. Set up the suspend function

Installing LIRC cuaes a bug in the suspend function. This thread solves it:
http://forum.xbmc.org/showthread.php?tid=127293
Edit /etc/pm/sleep.d/99lirc-resume
Code:
$ sudo nano /etc/pm/sleep.d/99lirc-resume

Comment out the following lines but putting a # at the begining:
Code:
rmmod ir-lirc-codec
rmmod lirc_dev


3. Set up resume from USB

There is a german blog to follow to get this working:
http://translate.google.com/translate?sl...fwecken%2F

For this purpose, we first check whether the USB wake up (in my case USB0, USB1, USB2, USB3...) is activated.
Code:
$ cat /proc/acpi/wakeup
Device    S-state      Status   Sysfs node
USB1      S0    *disabled  pci:0000:00:1d.0
USB2      S0    *disabled  pci:0000:00:1d.1
USB3      S0    *disabled  pci:0000:00:1d.2
USB4      S0    *disabled  pci:0000:00:1a.0
USB5      S0    *disabled  pci:0000:00:1a.1
They will probably be disabled, to enable USB0 use:
Code:
$ echo "USB0" > /proc/acpi/wakeup
and for USB1 use:
Code:
echo "USB1
" > /proc/acpi/wakeup
And so forth, I would enable all the usb devices so it doesn't matter which port you plug the IR receiver into.

And now to enable at start up edit /etc/rc.local:
Code:
sudo nano /etc/rc.local
and add the following:
Code:
status=`cat /proc/acpi/wakeup | grep "USB0" | awk {'print $3}'`  if [ "$status" = "disabled" -o "$status" = "*disabled" ]; then echo "USB0" > /proc/acpi/wakeup
again add as many of these lines each time adjusting USB0 to the other USB ports.

That's it:
Code:
$ sudo reboot
and you should be in business - make sure you set the shutdown action to suspend in the XBMX power saving options.

Please point out any typos, or better ways of doing things - I can't guarantee this will work for you
Reply

Logout Mark Read Team Forum Stats Members Help
How To get a Cyberlink remote working with Suspend & resume on Eden for n00bs0