X10
X10 是一个兼容 LIRC 的无线遥控器。
安装 LIRC
为了支持直接从 Kodi 进行电源操作(例如关机选项),需要安装 upower。
禁用冲突模块
由于某些原因,udev 为此无线遥控器加载了错误的内核模块,因此您需要禁用它。这在 /etc/modprobe.d/
中完成
使用错误模块时 dmesg 中的错误
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 ...
要禁用该模块,请创建以下文件
/etc/modprobe.d/remote_blacklist.conf
# For some reason udev loads the wrong kernel module for the X10 radio remote, so blacklist it blacklist ati_remote
创建 /etc/lirc/lircd.conf
这会将遥控器上的按键映射到字符串,您可以将其用于 mplayer 等程序。
它可以自动生成,也可以从 /usr/share/lirc/remotes
中提供的示例之一复制。
要生成您自己的 lircd.conf
,请使用
# irrecord -H atilibusb --disable-namespace lircd.conf
更多详细信息请参见 LIRC#创建远程配置。
这是一个 Medion X10 遥控器的配置
# 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 https://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 photo 0x5A85 music 0xDB06 video 0x82AD end codes end remote
备用配置文件
begin remote name mceusb 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 suppress_repeat 12 min_repeat 3 toggle_bit_mask 0x80800000 begin codes BDelete 0xF520 BBlue 0x0A35 BChanUp 0xE00B BChanDown 0x618C BChannelList 0x85B0 BDown 0x77A2 BDVD 0xD904 BEight 0xE914 BReneme 0x0B36 BFive 0x6691 BForward 0x7BA6 BFour 0xE510 BGreen 0x88B3 BVideoDesktop 0x0631 BEditImage 0x0D38 BSetup 0x709B BSnapshot 0x6D98 BLeft 0x729D BChannelSearch 0x719C BTvPreview 0x84AF BMute 0xD500 BNine 0x6A95 BOK 0xF31E BOne 0x628D BPause 0xFE29 BPlay 0xFA25 BPower 0xD702 BRecord 0xFC27 BRed 0x87B2 BPrevious 0x76A1 BRewind 0x79A4 BRight 0xF41F BSeven 0x6893 BSix 0xE712 BNext 0xF823 BAcquireImage 0x8CB7 BStop 0x7DA8 BTxt 0x6B96 BThree 0x648F BTwo 0xE30E BUp 0xEF1A BVolDown 0x5D88 BVolUp 0xDE09 BYellow 0x0934 BZero 0xEC17 BTv 0x012C BVcr 0x022D BMusic 0xDB06 BRadio 0x032E BPhoto 0xDA05 BFullscreen 0x0E39 BDvdmenu 0xEE19 BDvdaudio 0x0F3A end codes end remote
编辑 /etc/conf.d/lircd.conf
最近版本的 LIRC 放弃了对 lirc_atiusb
内核模块的支持,因此现在必须使用 atilibusb 驱动程序。
只需将 "atilibusb"
添加到 LIRC_DRIVER
字段,使文件看起来像这样
# Parameters for lirc daemon # LIRC_DEVICE="/dev/lirc0" LIRC_DRIVER="atilibusb" LIRC_EXTRAOPTS="" LIRC_CONFIGFILE=""
启动 lircd
mplayer 配置示例
~/.lircrc
是 MPlayer 的默认 LIRC 配置文件名,请参阅 mplayer(1) 以更改此设置。
在 ~/.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: https://web.archive.org/web/20200808073444/http://prasinos.eu/articles/mplayer-lirc-elapsed-time begin button = GUIDE prog = mplayer config = osd_show_property_text "${time_pos} / ${length}" end
Kodi
请参阅 Kodi#使用遥控器。
以下 ~/.xbmc/userdata/Lircmap.xml
文件示例与上面发布的备用 lircd.conf
兼容。
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml --> <lircmap> <remote device="mceusb"> <pause>BPause</pause> <stop>BStop</stop> <forward>BForward</forward> <reverse>BRewind</reverse> <left>BLeft</left> <right>BRight</right> <up>BUp</up> <down>BDown</down> <select>BOK</select> <pageplus>BChanUp</pageplus> <pageminus>BChanDown</pageminus> <back>BDelete</back> <menu></menu> <title>BChannelSearch</title> <info>BSnapshot</info> <skipplus>BNext</skipplus> <skipminus>BPrevious</skipminus> <display></display> <start>BPlay</start> <record>BRecord</record> <volumeplus>BVolUp</volumeplus> <volumeminus>BVolDown</volumeminus> <mute>BMute</mute> <myvideo>BRed</myvideo> <mymusic>BYellow</mymusic> <mypictures>BGreen</mypictures> <mytv>BBlue</mytv> <one>BOne</one> <two>BTwo</two> <three>BThree</three> <four>BFour</four> <five>BFive</five> <six>BSix</six> <seven>BSeven</seven> <eight>BEight</eight> <nine>BNine</nine> <zero>BZero</zero> <PlayDVD>BDVD</PlayDVD> <ShowVideoMenu>BDvdmenu</ShowVideoMenu> <NextSubtitle>BTxt</NextSubtitle> <AudioNextLanguage>BDvdaudio</AudioNextLanguage> <ContextMenu>BSetup</ContextMenu> </remote> </lircmap>