|
Torna all'indice
Telecomandi
Terratec Cinercy T2
La mia scheda digitale terrestre è dotata di un telecomando. Normalmente i telecomandi vengono identificati dal kernel come periferiche di input (/class/input/input*).
Il numero di input non è detto sia sempre lo stesso, potrebbe cambiare con un sucessivo riavvio del pc.
Dato che però il telecomando non è quasi mai una tastiera standard è necessario dargli un nome ben chiaro ed univoco e controllarlo per mezzo di Lirc.
Per fare questo creerò una regola udev.
Prima di tutto vediamo come esso viene identificato dal kernel:
dmesg
input: TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control as /class/input/input3
Ecco la regola:
KERNEL=="event[0-9]*", SYSFS{../name}=="TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control", NAME="input/terrateccinergyt2"
che scriverò in un file chiamato 003-TerraTecGmbH.rules e lo collocherò in /etc/udev/rules.d. Infine riavvierò il pc. In questo modo quel medesimo telecomando verrà sempre associato al nome input/terrateccinergyt2.
fatto questo apt-get install lirc dopodiché sistemiamo i file di lirc come segue:
/etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false
#Don't start irexec, even if a good config file seems to exist.
#START_IREXEC=false
#Try to load appropriate kernel modules
LOAD_MODULES=true
# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="dev/input"
# If DEVICE is set to /dev/lirc and udev is in use /dev/lirc0 will be
# automatically used instead
DEVICE="/dev/input/terrateccinergyt2"
MODULES=""
# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
/etc/lirc/lircd.conf (questo file vale solo per il mio telecomando)
####### UNCONFIGURED
#
# To find out how to get a proper configuration file please read:
#
# /usr/share/doc/lirc/README.Debian
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.0(userspace) on Sun Dec 24 19:55:24 2006
#
# contributed by
#
# brand: Terratec
# model no. of remote control: Cinercy T2
# devices being controlled by this remote:
#
begin remote
name Terrater_Cinergy_T2
bits 16
eps 30
aeps 100
one 0 0
zero 0 0
pre_data_bits 16
pre_data 0x8001
gap 135844
toggle_bit 0
begin codes
ESC 0x0074
1 0x0002
2 0x0003
3 0x0004
4 0x0005
5 0x0006
6 0x0007
7 0x0008
8 0x0009
9 0x000A
0 0x000B
AV 0x0189
RELOAD 0x00AD
OSD 0x0161
EPG 0x016D
UP 0x0067
DOWN 0x006C
LEFT 0x0069
RIGHT 0x006A
RETURN 0x0160
TXT 0x0184
INFO 0x0166
CLOCK 0x018E
FULLSCREEN 0x018F
AUDIO 0x0190
TELETEX 0x0191
VOL+ 0x0073
VOL- 0x0072
CH+ 0x0192
CH- 0x0193
MUTE 0x0071
PAUSE 0x0077
PLAY 0x00CF
REC 0x00A7
STOP 0x0080
FORWARD 0x0197
REWIND 0x019C
end codes
end remote
Inseriamo poi nella cartella /home/mythtv/.mythtv/ il file con le corrisoindenze. Permetterà a MythTV ed a Mplyer di essere controllati con il telecomando:
Ecco il file lircrc /home/mythtv/.mythtv/lircrc
# ~/.mythtv/lircrc
#
# MythTV native LIRC config file for
# the Terratec Cinergy T2 Remote Control
#
# By Denis Gottardello 26.12.2006
#
begin
prog = mythtv
button = ESC
config = Esc
end
begin
prog = mythtv
button = 1
config = 1
end
begin
prog = mythtv
button = 2
config = 2
end
begin
prog = mythtv
button = 3
config = 3
end
begin
prog = mythtv
button = 4
config = 4
end
begin
prog = mythtv
button = 5
config = 5
end
begin
prog = mythtv
button = 6
config = 6
end
begin
prog = mythtv
button = 7
config = 7
end
begin
prog = mythtv
button = 8
config = 8
end
begin
prog = mythtv
button = 9
config = 9
end
begin
prog = mythtv
button = 0
config = 0
end
# Manca AV
# Manca Reload
begin
prog = mythtv
button = OSD
config = I
end
begin
prog = mythtv
button = EPG
config = M
end
begin
prog = mythtv
button = UP
config = Up
end
begin
prog = mythtv
button = DOWN
config = Down
end
begin
prog = mythtv
button = LEFT
config = Left
end
begin
prog = mythtv
button = RIGHT
config = Right
end
begin
prog = mythtv
button = RETURN
config = Return
end
begin
prog = mythtv
button = INFO
config = F1
end
begin
prog = mythtv
button = TXT
config = y
end
begin
prog = mythtv
button = CLOCK
config = F8
end
# Manca Rosso (Clock)
# Manca Verde (Fullscreen)
# Manca Giallo (Audio)
begin
prog = mythtv
button = TELETEXT
config = t
end
begin
prog = mythtv
button = VOL+
config = ]
end
begin
prog = mythtv
button = VOL-
config = [
end
begin
prog = mythtv
button = MUTE
config = |
end
begin
prog = mythtv
button = CH+
config = z
end
begin
prog = mythtv
button = CH-
config = q
end
begin
prog = mythtv
button = PAUSE
config = p
end
begin
prog = mythtv
button = PLAY
config = p
end
begin
prog = mythtv
button = RECORD
config = r
end
begin
prog = mythtv
button = FORWARD
config = Right
end
begin
prog = mythtv
button = STOP
config = p
end
begin
prog = mythtv
button = REWIND
config = Left
end
###############################################################################################################
###############################################################################################################
###############################################################################################################
###############################################################################################################
###############################################################################################################
begin
prog = mplayer
button = ESC
config = quit
end
# Manca 1
# Manca 2
# Manca 3
# Manca 4
# Manca 5
# Manca 6
# Manca 7
# Manca 8
# Manca 9
# Manca 0
# Manca AV
begin
prog = mplayer
button = RELOAD
config = speed_set 1
end
begin
prog = mplayer
button = OSD
config = osd
end
# Manca EPG
begin
prog = mplayer
button = UP
config = seek +60
end
begin
prog = mplayer
button = DOWN
config = seek -60
end
begin
prog = mplayer
button = LEFT
config = seek -10
end
begin
prog = mplayer
button = RIGHT
config = seek +10
end
# Manca Return
begin
prog = mplayer
button = INFO
config = osd_show_text
end
# Manca TXT
# Manca Rosso (Clock)
# Manca Verde (Fullscreen)
# Manca Giallo (Audio)
# Manca Blu (Teletext)
begin
prog = mplayer
button = VOL+
config = Volume 1
end
begin
prog = mplayer
button = VOL-
config = Volume -1
end
begin
prog = mplayer
button = MUTE
config = mute
end
begin
prog = mplayer
button = CH+
config = speed_incr 1
end
begin
prog = mplayer
button = CH-
config = speed_incr -1
end
begin
prog = mplayer
button = PAUSE
config = p
end
begin
prog = mplayer
button = PLAY
config = p
end
# Manca RECORD
begin
prog = mplayer
button = FORWARD
config = seek +600
end
begin
prog = mplayer
button = STOP
config = quit
end
begin
prog = mplayer
button = REWIND
config = seek -600
end
###############################################################################################################
###############################################################################################################
###############################################################################################################
###############################################################################################################
###############################################################################################################
begin
prog = xine
button = ESC
config = quit
end
# Manca 1
# Manca 2
# Manca 3
# Manca 4
# Manca 5
# Manca 6
# Manca 7
# Manca 8
# Manca 9
# Manca 0
# Manca AV
begin
prog = xine
button = RELOAD
config = speed_set 1
end
begin
prog = xine
button = OSD
config = osd
end
# Manca EPG
begin
prog = xine
button = UP
config = seek +60
end
begin
prog = xine
button = DOWN
config = seek -60
end
begin
prog = xine
button = LEFT
config = seek -10
end
begin
prog = xine
button = RIGHT
config = seek +10
end
# Manca Return
begin
prog = xine
button = INFO
config = osd_show_text
end
# Manca TXT
# Manca Rosso (Clock)
# Manca Verde (Fullscreen)
# Manca Giallo (Audio)
# Manca Blu (Teletext)
begin
prog = xine
button = VOL+
config = Volume 1
end
begin
prog = xine
button = VOL-
config = Volume -1
end
begin
prog = xine
button = MUTE
config = mute
end
begin
prog = xine
button = CH+
config = speed_incr 1
end
begin
prog = xine
button = CH-
config = speed_incr -1
end
begin
prog = xine
button = PAUSE
config = p
end
begin
prog = xine
button = PLAY
config = p
end
# Manca RECORD
begin
prog = xine
button = FORWARD
config = seek +600
end
begin
prog = xine
button = STOP
config = quit
end
begin
prog = xine
button = REWIND
config = seek -600
end
Torna all'indice
|