Update on TwinHan remote for Mythbuntu 8.10

twinhan remoteI’ve just upgraded my HTPC to the new Mythbuntu 8.10. I must say that setup is a helluva lot easier than previous versions of Myth although I found my ATI card did not work at all and I had to exhume an ancient nVidia card from my parts box. And I had to hack the xorg.conf file to make the TV output work so the setup is not 100% seamless.

Anyway, onto the odd device, my TwinHan remote control. Setting this up is much easier under Mythbuntu 8.10. Here’s the step-by-step:


Step 1 – Configure LIRC

Plug the IR receiver into a USB port. Wait a moment for it to register and then type the following command:

ls /dev/input/by-id

It should produce output like this. This step is just to verify the correct device name for the remote.

usb-Twinhan_Tech_Remote_Control_1111111-event-kbd
usb-Twinhan_Tech_Remote_Control_1111111-event-mouse
usb-Twinhan_Tech_Remote_Control_1111111-mouse

Now edit the file /etc/lirc/hardware.conf and enter values for REMOTE_DRIVER and REMOTE_DEVICE:

REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/by-id/usb-Twinhan_Tech_Remote_Control_1111111-event-kbd"

Due to a bug in this version of Ubuntu, you will also need to run the following command:

lshal | grep input.product

It will spit out a few lines of text. Verify that it produces a line like this:

  input.product = 'Twinhan Tech Remote Control'  (string)

Then edit the file /usr/share/hal/fdi/preprobe/20thirdparty/lirc.fdi and make it read like so:

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
     <match key="info.product" contains_ncase="Twinhan Tech Remote Control">
        <merge key="info.ignore" type="bool">true</merge>
     </match>
  </device>
</deviceinfo>

Finally, download this file:

lircd.conf

and put it in /etc/lirc/

At this stage, I had to reboot so that everything loaded properly. Once you have rebooted, you can test the remote control by typing:

irw

Now every time you press a key, you should see it printed on the screen. Press Ctrl-C when you are done.

STEP 2 – Configure MythTV commands

We are getting closer now. The next step is to set up a file called ~/.lirc/mythtv which contains the mappings between the keys on the remote and the functions in MythTV. Once again, I have already prepared this file which you can download here:

lircrc-mythtv

Rename this file to mythtv and move it to ~/.lirc/ Once that is done, restart MythTV. Here are the key mappings you will end up with:

Key Function
REC Record
TELETEXT OSD
RECALL MENU
PREVIEW INFO
REW/FFWD Forward/backward in MythMusic
CAPTURE Previous playlist item in MythMusic
RECORDLIST Next playlist item in MythMusic

STEP 3 – Configure MPlayer

The final step is to configure the mapping between the remote and the commands in MPlayer. Since MPlayer is a separate program, it needs to be configured separately to MythTV. To configure it, we need another lircrc file but this time is has to be called ~/.lirc/mplayer. Download it from here:

lircrc-mplayer

Rename it to mplayer and put it in ~/.lirc/ and that should be that! Here are the key mappings for MPlayer:

Key Function
MUTE Mute
VOL+/- Adjust volume
CH+/- Skip fwd/back 60 seconds
REW/FFWD Skip fwd/back 10 seconds
PREVIEW Show/hide subtitles
TELETEXT Show/hide OSD
TAB Cycle through audio tracks

If you do not like the key mappings I have chosen, you may edit the files in ~/.lirc. The format should be fairly easy to follow.

53 thoughts on “Update on TwinHan remote for Mythbuntu 8.10

  1. So I upgraded from 9.04 to 10.10 and unsurprisingly it broke my remote.

    What I did to fix it:

    1. Run: “dpkg-reconfigure lircd”
    2. Select “Linux Input Layer” for the input device, and “none” for the transmitter.
    3. edit /etc/lirc/hardware.conf. Make sure the following lines are correct.
    REMOTE_DRIVER=”devinput”
    REMOTE_DEVICE=”/dev/input/by-id/usb-Twinhan_Tech_Remote_Control_1111111-event-if00″
    Note that the last couple of characters of the device name changed from “kbd” to “if00″, this caught me out.
    4. Now irw picks up codes but the names are all changed. 2 ways around this – replacing /usr/share/lirc/remotes/devinput/lircd.conf.devinput with http://www.doctort.org/adam/files/twinhan/lircd.conf should work, or do what I did and update ~/.lirc/mythtv to match the new names.
    5. sudo service lirc restart
    6. restart mythfrontend
    7. Watch TV, sip beer.

    Hopefully that helps someone.

    With my logitech harmony I use TwinHanVP-1020A

Comments are closed.