Difference between revisions of "X10"

From ArchWiki
Jump to: navigation, search
m
(Changes to reflect breakage of lirc_atiusb)
Line 20: Line 20:
 
To blacklist:
 
To blacklist:
 
  MODULES=(... !ati_remote)
 
  MODULES=(... !ati_remote)
 
To load the right one at boot:
 
MODULES=(... !ati_remote lirc_atiusb)
 
  
 
You need to unload the wrong kernel module manually if you attached the receiver before blacklisting the module.
 
You need to unload the wrong kernel module manually if you attached the receiver before blacklisting the module.
Line 31: Line 28:
 
== Create /etc/lircd.conf ==
 
== Create /etc/lircd.conf ==
 
This maps the keys from your remote to strings you can use for programs like mplayer.
 
This maps the keys from your remote to strings you can use for programs like mplayer.
This config was created with "irrecord /tmp/x10".
 
  
begin remote
+
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]].
   name  /tmp/x10
+
 
 +
Here is one for a Medion X10 Remote:
 +
<pre>
 +
# 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
 
   bits          16
 
   eps            30
 
   eps            30
 
   aeps          100
 
   aeps          100
 +
 
   one            0    0
 
   one            0    0
 
   zero            0    0
 
   zero            0    0
Line 44: Line 59:
 
   post_data_bits  16
 
   post_data_bits  16
 
   post_data      0x0
 
   post_data      0x0
   gap          227990
+
   gap          227978
 
   toggle_bit_mask 0x80800000
 
   toggle_bit_mask 0x80800000
 +
 
       begin codes
 
       begin codes
           LIVE_TV                  0x719C
+
           red                      0x87B2
           PHOTO                    0xDA05
+
           yellow                   0x0934
          DVD_MENU                0x5984
+
           blue                    0x8AB5
          REC_TV                   0xED18
+
           green                   0x0833
           MUSIC                    0x5B86
+
           power                   0xD702
           VIDEO                   0x022D
+
           text                    0xEB16
           AUDIO                   0x87B2
+
           tvrecord                0x6D98
           TITLE                    0x0A35
+
           disc                    0xD904
           ANGLE                    0x89B4
+
           table                   0x86B1
           SUBTITLES                0x0833
+
           tvplay                  0xF11C
           POWER                   0xD702
+
           back                     0x75A0
           GUIDE                    0x0631
+
           info                    0x042F
           TEXT                     0x6B96
+
          volume_up               0x5E89
           VOLUME_UP               0xDE09
+
           volume_down             0xDD08
           VOLUME_DOWN             0x5D88
+
           mute                     0x5580
           MUTE                     0xD500
+
           channel_up               0xE00B
           PROGRAM_UP               0x608B
+
           channel_down             0x618C
           PROGRAM_DOWN             0xE10C
+
           cursor_up                0xEF1A
           LEFT                    0x729D
+
           cursor_down              0x77A2
           RIGHT                    0xF41F
+
           cursor_left              0xF21D
           UP                      0x6F9A
+
           cursor_right            0x749F
           DOWN                    0xF722
+
           ok                       0xF31E
           OK                       0x739E
+
           start                    0x709B
           ONE                      0xE20D
+
           track_previous           0xF621
           TWO                      0x638E
+
           track_next              0x78A3
           THREE                    0xE40F
+
           record                  0xFC27
           FOUR                    0x6590
+
           pause                    0x7EA9
           FIVE                    0xE611
+
           stop                    0xFD28
           SIX                      0x6792
+
           seek_backward            0x79A4
           SEVEN                    0xE813
+
           play                     0xFA25
           EIGHT                    0x6994
+
           seek_forward            0x7BA6
           NINE                     0xEA15
+
           1                        0xE20D
           ZERO                    0x6C97
+
           2                        0x638E
           ASTERISK                0x0C37
+
           3                        0xE40F
           HASH_KEY                0x8DB8
+
           4                        0x6590
           BACK                    0xF520
+
           5                        0xE611
           INFO                    0x84AF
+
           6                        0x6792
           PAUSE                    0x7EA9
+
           7                        0xE813
           WORLD                    0xF01B
+
           8                        0x6994
           REWIND                  0x79A4
+
           9                        0xEA15
           REWIND_TO_BEGINNING      0xF621
+
           0                        0x6C97
           PLAY                    0x7AA5
+
           asterisk                0x0C37
           FORWARD                  0xFB26
+
           hash                     0x8DB8
           FORWARD_TO_END          0x78A3
+
           clear                    0x0530
           STOP                     0xFD28
+
          enter                    0x8BB6
           RED_CIRCLE_BUTTON        0x7CA7
+
 
       end codes
 
       end codes
end remote
+
 
 +
end remote
 +
</pre>
 +
 
 +
== 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 ==
 
== Starting lircd ==

Revision as of 17:43, 13 April 2011

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

Erros 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/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/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