LinuxPedia

Wiki libre et indépendant dédié à GNU-Linux et BSD.

Outils pour utilisateurs

Outils du site


opensuse:ati_remote

Télécommande ATI REMOTE controlé par LIRC

Détection de la télécommande

lsusb

lsusb
...
Bus 003 Device 003: ID 0bc7:0004 X10 Wireless Technology, Inc. X10 Receiver
...

hwinfo --usb

10: USB 00.0: 0000 Unclassified device
  [Created at usb.122]
  UDI: /org/freedesktop/Hal/devices/usb_device_bc7_4_noserial_if0
  Unique ID: mZxt.qOeD3ZptZSE
  Parent ID: uIhY.uKUOxbrVf46
  SysFS ID: /devices/pci0000:00/0000:00:10.1/usb3/3-2/3-2:1.0
  SysFS BusID: 3-2:1.0
  Hardware Class: unknown
  Model: "X10 Wireless USB Receiver"
  Hotplug: USB
  Vendor: usb 0x0bc7 "X10 Wireless Technology Inc"
  Device: usb 0x0004 "USB Receiver"
  Revision: "1.00"
  Driver: "lirc_atiusb"
  Speed: 1.5 Mbps
  Module Alias: "usb:v0BC7p0004d0100dc00dsc00dp00icFFisc00ip00"
  Driver Info #0:
    Driver Status: lirc_atiusb is active
    Driver Activation Cmd: "modprobe lirc_atiusb"
  Driver Info #1:
    Driver Status: ati_remote is active
    Driver Activation Cmd: "modprobe ati_remote"
  Config Status: cfg=no, avail=yes, need=no, active=unknown
  Attached to: #8 (Hub)

RPM

Installer le package lirc par Yast ou Apt

Compilation

Compiler si le RPM n'existe pas ou lors d'un bug

Remarque : Cette méthode marche a condition de mettre –with-devdir=/dev/lirc

Allez sur http://www.lirc.org/ recuperer le dernier lirc.x.x.x.tar.bz2

Le Décompresser

Ouvrez votre Terminal :

tar -xvjf lirc-x.x.x.tar.bz2

Remarque : remplacer linux-2.6.*.* par votre uname -a

Compilation

./configure 
--with-devdir=/dev/lirc   
--with=/usr
--with-driver=atiusb 
--with-x 
--with-kerneldir=/usr/src/linux-2.6.*.*  (facultatif)
--with-moduledir=/lib/modules/2.6.*.*/misc (facultatif)

make 
su root
make install 
modprobe lirc_atiusb

Configuration du device

su root
cd /dev
rm lirc 
mkdir lirc
chmod 755 lirc
cd /lirc
chown root:video lircm
chown root:video lircd

Configuration de udev

Créer le fichier ou modifier le fichier : /etc/udev/rules.d/10-lirc.rules

KERNEL="lirc[0-9]*",    NAME="lirc/%n"

Configuration du Deamon

Modifier le fichier : /etc/sysconfig/lirc

## Path:           Hardware/Lirc
## Description:    lirc (infrared remote control) configuration
## Type:           string
## Default:        "660"
## ServiceRestart: lirc
#
# permissions for /dev/lircd
#
LIRCD_DEV_PERMISSIONS="666"

## Type:        string
## Default:     "root:video"
#
# owner and group for /dev/lircd
#
LIRCD_DEV_OWNER="root:video"

## Type:        string
## Default:     ""
#
# use given driver 
#
LIRCD_DRIVER=""

## Type:        string
## Default:     ""
#
# read from given device  
# votre--with-devdir
#
LIRCD_DEVICE="/dev/lirc"

## Type:        string(lirc_bt829,lirc_gpio,lirc_i2c,lirc_it87,lirc_parallel,lirc_sir,ir-kbd-i2c,ir-kbd-gpio)
## Default:     ""
#
# load given lirc driver module
#
LIRC_MODULE="lirc_atiusb"

## Type:        string
## Default:     ""
#
# listen for network connections on specified port.
# WARNING: don't use this on a machine with an internet
# connection as lircd is running as root!
#
LIRCD_LISTENPORT=""

## Type:        string
## Default:     ""
#
# connect lircd to specified host
#
LIRCD_CONNECT=""

Fichier de configuration /etc/lircd.conf

Trouver sa télécommande dans /usr/share/lirc/remotes/atiusb/lircd.conf est la parti le plus difficile pour moi c'est l'usb et non le numéro derriére la télécommande qui la caractérise :

Mon lsusb :
Bus 003 Device 003: ID 0bc7:0004 X10 Wireless Technology, Inc. X10 Receiver

Dans le fichier /usr/share/lirc/remotes/atiusb/lircd.conf.atiusb il faut trouver quelque chose de semblabe à ceci :
# P: Vendor=0bc7 ProdID=0004 Rev= 1.00
# S: Manufacturer=X10 Wireless Technology Inc

Copier la configuration de votre télécommande dans le fichier /etc/lirc.conf comme ci-dessous :

linux:/etc # cat lircd.conf
# this config file was automatically generated
# using lirc-0.7.0pre7(atiusb) on Tue Aug 31 21:16:31 2004
#
# contributed by Martin Tomasek <mtd@centrum.cz>
#
# brand: ATI Remote Wonder
# model no. of remote control:
# devices being controlled by this remote: ATI USB Receiver (X10).
#
# * remote is set to channel 1, driver reports channel 16. don't know
# which is true.

#
# P:  Vendor=0bc7 ProdID=0004 Rev= 1.00
# S:  Manufacturer=X10 Wireless Technology Inc
# S:  Product=USB Receiver
#

begin remote

  name  atiusb_ch1
  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          227933
  toggle_bit      0


      begin codes
          A                        0x000000000000D500
          B                        0x000000000000D601
          C                        0x000000000000EE19
          D                        0x000000000000F01B
          E                        0x000000000000F621
          F                        0x000000000000F823
          POWER                    0x000000000000D702
          TV                       0x000000000000D803
          DVD                      0x000000000000D904
          WEB                      0x000000000000DA05
          BOOK                     0x000000000000DB06
          HAND                     0x000000000000DC07
          MOUSE_LEFT_BTN           0x0000000000004D78
          MOUSE_RIGHT_BTN          0x000000000000517C
          MOUSE_LEFT               0x0000000000004570
          MOUSE_RIGHT              0x0000000000004671
          MOUSE_UP                 0x0000000000004772
          MOUSE_DOWN               0x0000000000004873
          VOL_UP                   0x000000000000DD08
          VOL_DOWN                 0x000000000000DE09
          MUTE                     0x000000000000DF0A
          CH_UP                    0x000000000000E00B
          CH_DOWN                  0x000000000000E10C
          1                        0x000000000000E20D
          2                        0x000000000000E30E
          3                        0x000000000000E40F
          4                        0x000000000000E510
          5                        0x000000000000E611
          6                        0x000000000000E712
          7                        0x000000000000E813
          8                        0x000000000000E914
          9                        0x000000000000EA15
          0                        0x000000000000EC17
          LIST                     0x000000000000EB16
          CHECK                    0x000000000000ED18
          UP                       0x000000000000EF1A
          DOWN                     0x000000000000F722
          LEFT                     0x000000000000F21D
          RIGHT                    0x000000000000F41F
          OK                       0x000000000000F31E
          TIMER                    0x000000000000F11C
          MAXIMIZE                 0x000000000000F520
          REW                      0x000000000000F924
          FFWD                     0x000000000000FB26
          PLAY                     0x000000000000FA25
          STOP                     0x000000000000FD28
          RECORD                   0x000000000000FC27
          PAUSE                    0x000000000000FE29
      end codes
end remote

Le deamon LIRC

Mettre le deamon en service pour chaque démarrage

chkconfig -add lirc default

Mettre le deamon en marche

cd /etc/init.d/
lircd start

Vérifier que le deamon est en marche

ps x | grep lirc
doit donner quelque chose comme ça
4337 ?        Ss     0:00 /usr/local/sbin/lircd

Tester que la télécommande fonctionne

Lancer dans un console irw et appuyer sur des touches de la télécommande. Voila ce que ça donne quand ça marche :

linux:/ # irw
00000014f9240000 00 REW atiusb_ch1
00000014fa250000 00 PLAY atiusb_ch1
00000014fa250000 01 PLAY atiusb_ch1
00000014fe290000 00 PAUSE atiusb_ch1
00000014fd280000 00 STOP atiusb_ch1
00000014fe290000 00 PAUSE atiusb_ch1
00000014f7220000 00 DOWN atiusb_ch1
00000014f7220000 01 DOWN atiusb_ch

Fichier de raccourcis /etc/lircrc

Pré requis : si vous utlisez les commandes osdcat et reglerson du fichier de raccourcis

Script osdcat /usr/local/bin/osdcat (facultatif)

#!/bin/bash
ps_osd=$(ps -A | grep osd_cat)
if test -n "$ps_osd" ; then
        killall -9 osd_cat 2>&1 >/dev/null
fi
osd_cat --delay=2 -A center -p middle -o 5 -f -adobe-helvetica-bold-r-normal-*-34-*-*-*-*-*-* 2>&1 >/dev/null

chmod +x /usr/local/bin/osdcat

Script pour regler le son /usr/local/bin/reglerson (facultatif)

Fichier de raccourcis /etc/lircrc

Correspond a mon fichier pour télécommander Amarok, Mplayer et Kaffeine, la radio, le son, une chaine d'info

#osd

begin 
	prog = irexec
        button = PLAY
        config = echo "PLAY" | osdcat 
end 

begin 
	prog = irexec
        button = DVD
        config = echo "DVD" | osdcat 
end 

begin
        prog = irexec
        button = PAUSE 
        config = echo "PAUSE" | osdcat 
end

begin
        prog = irexec
        button = STOP
        config = echo "STOP" | osdcat 
end

begin
        prog = irexec
        button = FFWD
        config = echo ">>" |  osdcat  
end

begin
        prog = irexec
	button = REW
        config = echo "<<" | osdcat 
end

begin
        prog = irexec
	button = RIGHT
        config = echo "PISTE SUIVANTE" | osdcat 
end

begin
        prog = irexec
	button = LEFT
        config = echo "PISTE PRECEDENTE" | osdcat 
end

begin
        prog = irexec
        button = MUTE
        config = echo "MUTE" | osdcat 
end

#amarok

begin
        prog = irexec
        button = A
        config = amarok 
end

begin
	prog = irexec
	button = PLAY
	config = dcop amarok player play
end

begin
        prog = irexec
        button = PAUSE
        config = dcop amarok player pause
end

begin
        prog = irexec
        button = STOP
        config = dcop amarok player stop
end

begin
        prog = irexec
        button = FFWD
        config = dcop amarok player seekRelative 15
end

begin
        prog = irexec
	button = REW
        config = dcop amarok player seekRelative -5
end

begin
        prog = irexec
	button = RIGHT
        config = dcop amarok player next
end

begin
        prog = irexec
	button = LEFT
        config = dcop amarok player prev
end

begin
        prog = irexec
        button = VOL_UP
        config = dcop amarok player volumeUp
end

begin
        prog = irexec
        button = MUTE
        config = dcop amarok player mute
end

begin
        prog = irexec
        button = VOL_DOWN
        config = dcop amarok player volumeDown
end

begin
        prog = irexec
        button = LIST
        config = dcop amarok playlist togglePlaylist
end

begin
        prog = irexec
        button = CHECK
        config = toggleRandomAmarok
end

begin
        prog = irexec
        button = MAXIMIZE
        config = dcop amarok player showOSD 
end

begin
        prog = irexec
	button = A
        button = POWER
        config = dcop amarok MainApplication-Interface quit && echo "QUITTER AMAROK" | osdcat 
end

# tv

begin
        prog = irexec
        button = TV
        config = mplayer-bin -af volume=-20 http://vipmms9.yacast.net/bfm_bfmtv &
end

#radio

begin
        prog = irexec
	button = 1
	config = gmplayer -af volume=-20 http://ogg.tv-radio.fr:1441/encoderfinter.ogg  &
end

begin
        prog = irexec
        button = 1
        config = echo "France inter" | osdcat
end

begin
        prog = irexec
        button = 2
        config = gmplayer -af volume=-20 mms://vip2.yacast.fr/encoderrtl &
end

begin
        prog = irexec
        button = 2
        config = echo "RTL" | osdcat &
end
			
begin
        prog = irexec
        button = 3 
        config = gmplayer -af volume=-20 mms://vip8.yacast.fr/encodereurope1 &
end

begin
        prog = irexec
        button = 3
        config = echo "Europe 1" | osdcat &
end


#kaffeine
begin
        prog = irexec
        button = B
        config = kaffeine
end
			
begin
        prog = irexec
        button = DVD
        config = dcop kaffeine KaffeineIface playDVD
end

begin
        prog = irexec
        button = PLAY
        config = dcop kaffeine KaffeineIface play
end

begin
        prog = irexec
        button = PAUSE
        config = dcop kaffeine KaffeineIface pause
end

begin
        prog = irexec
        button = STOP
        config = dcop kaffeine KaffeineIface stop
end

begin
        prog = irexec
        button = FFWD
        config = dcop kaffeine KaffeineIface posPlus
end

begin
        prog = irexec
        button = REW
        config = dcop kaffeine KaffeineIface posMinus
end

begin
        prog = irexec
        button = RIGHT
        config = dcop kaffeine KaffeineIface next
end

begin
        prog = irexec
        button = LEFT
        config = dcop kaffeine KaffeineIface previous
end

begin
        prog = irexec
	button = B
        button = POWER
        config = dcop kaffeine KaffeineIface quit && echo "QUITTER KAFFEINE" | osdcat 
end

begin
        prog = irexec
        button = VOL_UP
        config = dcop kaffeine KaffeineIface volUp
end

begin
        prog = irexec
        button = MUTE
        config = dcop kaffeine KaffeineIface mute
end

begin
        prog = irexec
        button = VOL_DOWN
        config = dcop kaffeine KaffeineIface volDown
end

begin
        prog = irexec
        button = MAXIMIZE
        config = dcop kaffeine KaffeineIface fullscreen
end

begin
        prog = irexec
        button = UP
        config = dcop kaffeine KaffeinePartIface zoomIn
end

begin
        prog = irexec
        button = DOWN
        config = dcop kaffeine KaffeinePartIface zoomOut
end

#SON

begin
        prog = irexec
        button = CH_UP
	config = reglerson + 10
end

begin
        prog = irexec
        button = CH_DOWN
	config = reglerson - 10
end

begin
        prog = irexec
        button = E
	config = reglerson 0 
end

begin
        prog = irexec
        button = D
	config = reglerson = 70
end

### MPlayer lirc setup

# Show OSD
begin
	prog = mplayer
	button = BOOK
	repeat = 0
	config = osd
end

begin
	prog = mplayer
	button = CHECK
	repeat = 0
	config = vo_ontop
end

# Pause playback
begin
	prog = mplayer
	button = PAUSE
	repeat = 0
	config = pause
end

# Skip ahead a minute if playing
# If paused, resume playing
begin
	prog = mplayer
	button = PLAY
	repeat = 0
	config = seek +1
end

# Stop playback and exit
begin
	prog = mplayer
	button = STOP
	repeat = 0
	config = quit
end

# Mute
begin
	prog = mplayer
	button = MUTE
	repeat = 3
	config = mute
end

# Seek back 10 seconds
begin
	prog = mplayer
	button = REW
	repeat = 0
	config = seek -10
end

# Seek forward 30 seconds
begin
	prog = mplayer
	button = FFWD
	repeat = 0
	config = seek +30
end

# Quit
begin
	prog = mplayer
	button = C
	button = POWER
	repeat = 0
	config = quit && echo "QUITTER MPLAYER" | osdcat
end

begin
	prog = irexec
	button = C
	button = POWER
	repeat = 0
	config = killall mplayer-bin && echo "QUITTER MPLAYER" | osdcat
end


# Seek forward 10 minutes
begin
	prog = mplayer
	button = RIGHT
	repeat = 0
	config = seek +600
end

# Seek backward 10 minutes
begin
	prog = mplayer
	button = LEFT
	repeat = 0
	config = seek -600
end

# Toggle full-screen
begin
	prog = mplayer
	button = MAXIMIZE
	repeat = 0
	config = vo_fullscreen
end

begin
	button = VOL_UP
     	prog = mplayer
	config = volume 1
     	repeat = 1
end

begin
	button = VOL_DOWN
	prog = mplayer
	config = volume -1
	repeat = 1
end

Pour KDE

Permet de lancer au démarrage
Créer un fichier /home/mickael/.kde/Autostart/ir
chmod +x ir

#!/bin/bash
killall irexec
irexec -d /etc/lircrc

Débugage

cat /var/log/messages | grep lirc

Chargement des modules

Mar  3 18:45:27 localhost lirc_dev: IR Remote Control driver registered, at major 61
Mar  3 18:45:27 localhost lirc_atiusb: no version for "lirc_unregister_plugin" found: kernel tainted.
Mar  3 18:45:27 localhost lirc_atiusb: USB remote driver for LIRC v0.5
Mar  3 18:45:27 localhost lirc_atiusb: Paul Miller <pmiller9@users.sourceforge.net>
Mar  3 18:45:27 localhost lirc_dev: lirc_register_plugin: sample_rate: 0
Mar  3 18:45:27 localhost lirc_atiusb[3]: X10 Wireless Technology Inc USB Receiver on usb3:3
Mar  3 18:45:27 localhost usbcore: registered new driver lirc_atiusb

Mise en route du deamon

Mar  3 18:45:35 localhost lircd-0.8.0[10909]: lircd(atiusb) ready
Mar  3 18:46:11 localhost lircd-0.8.0[10909]: accepted new client on /dev/lirc/lircd
Mar  3 18:46:16 localhost lircd-0.8.0[10909]: removed client

micke_suse :)

opensuse/ati_remote.txt · Dernière modification : 2018/11/17 12:54 de 127.0.0.1