X10

From ArchWiki
Revision as of 18:24, 13 June 2011 by Smerik (Talk | contribs) (Blacklist not working module: Fixed typo)

Jump to: navigation, search

X10 is a radio remote compatible with lirc

Install lirc

# pacman -S lirc lirc-utils

The package lirc provides the right kernel module.

Blacklist not working module

For some reason udev loads the wrong kernel module for this radio remote, so you need to blacklist it. this is done in /etc/rc.conf

Errors in dmesg with the wrong module:

ati_remote 1-1.1:1.0: Unknown input from channel 0x00: data 72,9d
ati_remote: Weird data, len=5 20 fa 5b 65 b6 20 ...
ati_remote: Weird data, len=5 20 fa db 5d b6 00 ...

To blacklist:

MODULES=(... !ati_remote)

You need to unload the wrong kernel module manually if you attached the receiver before blacklisting the module.

Add the daemon to the daemons array to start it at boot:

DAEMONS="(... lircd)"

Create /etc/lirc/lircd.conf

This maps the keys from your remote to strings you can use for programs like mplayer.

It can automatically generated or copied from one of the provided examples in /usr/share/lirc/remotes. More details are available at Lirc#Making_a_configuration_file.

Here is one for a Medion X10 Remote:

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.2(default) on Sun Aug 12 02:13:30 2007
#
# contributed by Ben Adler @ gmx dot net
#
# brand: Medion / X10 (part of http://www.medion.de/md8824/)
# remote control: RF Vista Remote Control (OR24V)
# P/N: 2003 5335
# devices being controlled by this remote: USB RF remote receiver (CM20E), P/N 2003 1776

begin remote

  name  Medion_X10
  bits           16
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   8
  pre_data       0x14
  post_data_bits  16
  post_data      0x0
  gap          227978
  toggle_bit_mask 0x80800000

      begin codes
          red                      0x87B2
          yellow                   0x0934
          blue                     0x8AB5
          green                    0x0833
          power                    0xD702
          text                     0xEB16
          tvrecord                 0x6D98
          disc                     0xD904
          table                    0x86B1
          tvplay                   0xF11C
          back                     0x75A0
          info                     0x042F
          volume_up                0x5E89
          volume_down              0xDD08
          mute                     0x5580
          channel_up               0xE00B
          channel_down             0x618C
          cursor_up                0xEF1A
          cursor_down              0x77A2
          cursor_left              0xF21D
          cursor_right             0x749F
          ok                       0xF31E
          start                    0x709B
          track_previous           0xF621
          track_next               0x78A3
          record                   0xFC27
          pause                    0x7EA9
          stop                     0xFD28
          seek_backward            0x79A4
          play                     0xFA25
          seek_forward             0x7BA6
          1                        0xE20D
          2                        0x638E
          3                        0xE40F
          4                        0x6590
          5                        0xE611
          6                        0x6792
          7                        0xE813
          8                        0x6994
          9                        0xEA15
          0                        0x6C97
          asterisk                 0x0C37
          hash                     0x8DB8
          clear                    0x0530
          enter                    0x8BB6
      end codes

end remote

Edit /etc/conf.d/lircd.conf

Recent versions of lirc drop support for the lirc_atiusb kernel module and so it is now necessary to use the atilibusb driver.

Simply add "atilibusb" to the LIRC_DRIVER field so that the file looks like this:

# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="atilibusb"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE=""


Starting lircd

# /etc/rc.d/lircd start

Example mplayer config

You need to remove --disable-lirc from mplayers PKGBUILD and recompile it, as it is disabled by default (04.02.09)

You can check if lirc support is compiled in with "mplayer -v someplayablefile.xyz", look for "Setting up LIRC support.

~/.lircrc is the default mplayer filename for the lirc config, see man mplayer to change this.

Change in ~/.lircrc:

begin
     button = VOLUME_UP       #VOLUME_UP is the string defined in /etc/lirc/lircd.conf
     prog = mplayer            
     config = volume 1         #this is mplayers internal command, see "mplayer -input cmdlist" for more
end

begin
    button = VOLUME_DOWN
    prog = mplayer
    config = volume -1
end

begin
	button = RIGHT
	prog = mplayer
	config = seek +1
end

begin
	button = LEFT
	prog = mplayer
	config = seek -1
end

begin
	button = UP
	prog = mplayer
	config = seek +50
end

begin
	button = DOWN
	prog = mplayer
	config = seek -50
end

begin
	button = PLAY
	prog = mplayer
	config = pause
end

begin
	button = PAUSE
	prog = mplayer
	config = pause 
end
#show elapse/total time in the upper left corner
#Source: http://prasinos.eu/articles/mplayer-lirc-elapsed-time
begin
	button = GUIDE
	prog = mplayer
	config = osd_show_property_text "${time_pos} / ${length}"
end

Boxee (and XBMC)

Information about how to get the X10 remote control working in Boxee and XBMC is available: Boxee-source#LIRC_Remote_Controls