LIRC Setup

LIRC is a standard part of OpenSuse and provided your infrared receiver is supported by LIRC then setup is straight forward.
The example used on this page is for the infrared
receiver integrated onto the Hauppauge Nova-T DVB-T, but should be
similar for any integrated infrared device. Since openSUSE 10.2 these
infrared receivers are handled as generic keyboard input devices and
are recognised as such.
Check your Hardware
Check in YaST to see if hardware is detected.
YaST->Hardware->Hardware Information->keyboard->cx88 IR-(Hauppauge Nova-T DVB-T)
Under the device name you will see /dev/input/event2. This shows us which input device the remote is using.
Now open a terminal window and use the "evtest" command to test that the hardware works. (replace event2 with the device from your system). If you dont have this command you need to install the input-utils RPM from YaST
>evtest /dev/input/event2
======================Heres the Output=============== Input driver version is 1.0.0 Input device ID: bus 0x1 vendor 0x70 product 0x9002 version 0x1 Input device name: "cx88 IR (Hauppauge Nova-T DVB-T" Supported events: Event type 0 (Sync) Event type 1 (Key) Event code 2 (1) Event code 3 (2) Event code 4 (3) Event code 5 (4) Event code 6 (5) Event code 7 (6) Event code 8 (7) Event code 9 (8) Event code 10 (9) Event code 11 (0) Event code 28 (Enter) Event code 103 (Up) Event code 105 (Left) Event code 106 (Right) Event code 108 (Down) Event code 113 (Mute) Event code 114 (VolumeDown) Event code 115 (VolumeUp) Event code 116 (Power) Event code 119 (Pause) Event code 128 (Stop) Event code 139 (Menu) Event code 142 (Sleep) Event code 163 (NextSong) Event code 165 (PreviousSong) Event code 167 (Record) Event code 168 (Rewind) Event code 174 (Exit) Event code 207 (Play) Event code 208 (Fast Forward) Event code 353 (Select) Event code 363 (Channel) Event code 365 (EPG) Event code 367 (MHP) Event code 370 (Subtitle) Event code 372 (Zoom) Event code 377 (TV) Event code 385 (Radio) Event code 388 (Text) Event code 392 (Audio) Event code 393 (Video) Event code 398 (Red) Event code 399 (Green) Event code 400 (Yellow) Event code 401 (Blue) Event code 402 (ChannelUp) Event code 403 (ChannelDown) Event code 412 (Previous) Event type 20 (Repeat) Testing ... (interrupt to exit)
Heres what happens when you press the "OK" key ============================================================ Event: time 1168102711.806774, type 1 (Key), code 28 (Enter), value 0 Event: time 1168102711.806782, -------------- Report Sync ------------ ============================================================
Install LIRC from YaST. Just do a search for LIRC and install both "lirc" as well as "lirc-kmp-default "packages. LIRC consists of three main commands.
lircd
| The lirc daemon catches infrared events | | irrecord
| utility to record remote control keys and maps to names you choose | | irw
| utility to check that infrared events are being translated to keys | |
Check LIRC Works
As root issue this command (replace event2 with your device name)
# /usr/sbin/lircd -H dev/input -d /dev/input/event2 -n
("-H" specifies the driver "-d" specifies the device)
and then press the number keys on your remote ============Heres the output=========================== lircd-0.8.0[14834]: could not open config file '/etc/lircd.conf' lircd-0.8.0[14834]: No such file or directory lircd-0.8.0[14834]: lircd(userspace) ready
0123456789 ===================================================== The non-number keys wont work just yet as they have not been mapped.
You will notice that the output shows that there is no config file called /etc/lircd.conf. We will need to create one.
Create Configuration File
There are quite a few config files installed at /usr/share/lirc/remotes. There are also lots on the MythTV WiKi. You can find lots of config fileshere
The chances are you will not find one that works exactly with your remote, because manufacturers have a habit of changing the underlying hardware. Use "irrecord" to create your own. it can be a bit tedious, but you will have a configuration file exactly for your remote.
Use the following command as root in a terminal (make sure that lircd is NOT running).
#irrecord -H dev/input -d /dev/input/event2 /etc/lircd.conf
Just follow the instructions on the screen step by step and capture each key and give it a name. You will end up with a config file in /etc called lircd.conf
Check Remote Works Open 1 terminal and run this command as root #/usr/sbin/lircd -H dev/input -d /dev/input/event2 -n
Open a second terminal and issue this command >irw
Now press the keys on your remote and check that the output in the irw window is as it should be. ie right names to the right keys.
Heres mine ==================================================== 0000000080010193 00 Down hauppauge_nova_t_uk 0000000080010192 00 Up hauppauge_nova_t_uk 0000000080010072 00 Left hauppauge_nova_t_uk 0000000080010073 00 Right hauppauge_nova_t_uk ====================================================
Autostart LIRC
Now that we have everything working we need to have the system start lirc on boot. We need to set up some items in Yast.
->YaST->System->/etc/sysconfig Editor->Hardware->Lirc Now change the following entries Parameter setting comment LIRCD_DRIVER dev/input (there is no "/" infront of dev) LIRCD_DEVICE name=cx88* (replace cx88* with name of your device, use * wildcard) LIRC_Module lirc_i2c
Save these settings and set lirc to autorun
->YaST->System->System Services (Runlevel) Click on Lirc and click enable.
Reboot and check that lirc is running >ps -e |grep lirc 2759 ? 00:00:00 lircd
Configure applications to use LIRC To have MythTV interpret the keys correcty we need to have a second config file called "lircrc". See my config file below.
Once your lircrc file is complete, you'll need to install it as ~/.mythtv/lircrc in order for mythfrontend to find it. The trouble is, everything else will expect that file in ~/.lircrc so to work around that, we'll link them together with: $ ln -s ~/.mythtv/lircrc ~/.lircrc
Now start mythtv and your are done!
lircrc file
#Edit this as needed. its quite simple. specify application name, button is the name of the button #on your remote as setup in /etc/lircd.conf. config is the name of the key in your application. #begin # prog = mythtv # button = Power # config = #end
# begin # prog = mythtv # button = Go # # Swap the PiP windows # config = N # 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 = Back config = Esc end
begin prog = mythtv button = 0 config = 0 end
begin prog = mythtv button = Menu config = M end
# Below are keys used with the Hauppauge Grey remote
begin prog = mythtv # This is the Red key # We'll use it for "Delete" button = Red config = D end
begin prog = mythtv # This is the Green key # We'll use it for "Information" button = Green config = I end
# Note the "repeat =" strings in the volume and channel. # This means that if you hold down the key, every nth instance will be # passed. This depends on your system, so you may want to increase or # decrease this and see what happens. repeat = 1 is probably too # fast.
begin prog = mythtv button = VolumeUp repeat = 3 config = F11 end
begin prog = mythtv # Use it as a volume key button = VolumeDown repeat = 3 config = F10 end
begin prog = mythtv button = Up # This is the "up" on the central diamond repeat = 3 config = Up end
begin prog = mythtv button = Down # This is the "down" on the central diamond repeat = 3 config = Down end
begin prog = mythtv button = Left # This is the "left" on the central diamond repeat = 3 config = Left end
begin prog = mythtv button = Right # This is the "right" on the central diamond repeat = 3 config = Right end
begin prog = mythtv # Middle button on the diamond button = OK config = Return end
begin prog = mythtv button = Mute config = F9 end
# begin # prog = mythtv # # Change focus for PiP (to change channel in the other window) # button = Blank # config = B # end
begin prog = mythtv # #Bring up the Guide button = Full config = S end
begin prog = mythtv button = Replay config = Left end
begin prog = mythtv button = Play config = P end
begin prog = mythtv button = Skip config = Right end
begin prog = mythtv button = Record config = R end
# begin # prog = mythtv # # Teletext # button = Stop # config = T # end
begin prog = mythtv button = Pause config = P end
begin prog = mythtv button = PreviousTrack # Use for backwards commercial skip config = Q end
begin prog = mythtv button = NextTrack # Use for forward commercial skip config = Z end
## # xine key bindings. # Automatically generated by xine-ui version 0.99.3. ##
# start playback begin button = Play prog = xine repeat = 0 config = Play end
# playback pause toggle begin button = Pause prog = xine repeat = 0 config = Pause end
# stop playback begin button = Stop prog = xine repeat = 0 config = Stop end
# take a snapshot # begin # button = xxxxx # prog = xine # repeat = 0 # config = Snapshot # end
# eject the current medium # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = Eject # end
# select and play next MRL in the playlist # begin # button = NextTrack # prog = xine # repeat = 0 # config = NextMrl # end
# select and play previous MRL in the playlist # begin # button = PreviousTrack # prog = xine # repeat = 0 # config = PriorMrl # end
# loop mode toggle # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleLoopMode # end
# stop playback after played stream # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = PlaylistStop # end
# scan playlist to grab stream infos # begin # button = xxxxx # prog = xine # repeat = 0 # config = ScanPlaylistInfo # end
# add a mediamark from current playback # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = AddMediamark # end
# edit selected mediamark # begin # button = xxxxx # prog = xine # repeat = 0 # config = MediamarkEditor # end
# set position to -60 seconds in current stream begin button = Replay prog = xine repeat = 0 config = SeekRelative-60 end
# set position to +60 seconds in current stream begin button = Skip prog = xine repeat = 0 config = SeekRelative+60 end
# set position to -30 seconds in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative-30 # end
# set position to +30 seconds in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative+30 # end
# set position to -15 seconds in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative-15 # end
# set position to +15 seconds in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative+15 # end
# set position to -7 seconds in current stream # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative-7 # end
# set position to +7 seconds in current stream # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative+7 # end
# set position to beginning of current stream # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = SetPosition0% # end
# set position to 10% of current stream begin button = 1 prog = xine repeat = 0 config = SetPosition10% end
# set position to 20% of current stream begin button = 2 prog = xine repeat = 0 config = SetPosition20% end
# set position to 30% of current stream begin button = 3 prog = xine repeat = 0 config = SetPosition30% end
# set position to 40% of current stream begin button = 4 prog = xine repeat = 0 config = SetPosition40% end
# set position to 50% of current stream begin button = 5 prog = xine repeat = 0 config = SetPosition50% end
# set position to 60% of current stream begin button = 6 prog = xine repeat = 0 config = SetPosition60% end
# set position to 70% of current stream begin button = 7 prog = xine repeat = 0 config = SetPosition70% end
# set position to 80% of current stream begin button = 8 prog = xine repeat = 0 config = SetPosition80% end
# set position to 90% of current stream begin button = 9 prog = xine repeat = 0 config = SetPosition90% end
# increment playback speed # begin # button = xxxxx # prog = xine # repeat = 0 # config = SpeedFaster # end
# decrement playback speed # begin # button = xxxxx # prog = xine # repeat = 0 # config = SpeedSlower # end
# reset playback speed # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = SpeedReset # end
# increment audio volume begin button = VolumeUp prog = xine repeat = 0 config = Volume+ end
# decrement audio volume begin button = VolumeDown prog = xine repeat = 0 config = Volume- end
# increment amplification level # begin # button = xxxxx # prog = xine # repeat = 0 # config = Amp+ # end
# decrement amplification level # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = Amp- # end
# reset amplification to default value # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = ResetAmp # end
# audio muting toggle begin button = Mute prog = xine repeat = 0 config = Mute end
# select next audio channel begin button = Blue prog = xine repeat = 0 config = AudioChannelNext end
# select previous audio channel begin button = Yellow prog = xine repeat = 0 config = AudioChannelPrior end
# select next sub picture (subtitle) channel begin button = Green prog = xine repeat = 0 config = SpuNext end
# select previous sub picture (subtitle) channel begin button = Red prog = xine repeat = 0 config = SpuPrior end
# interlaced mode toggle # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = ToggleInterleave # end
# cycle aspect ratio values begin button = Pictures prog = xine repeat = 0 config = ToggleAspectRatio end
# reduce the output window size by factor 1.2 # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = WindowReduce # end
# enlarge the output window size by factor 1.2 # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = WindowEnlarge # end
# set video output window to 50% # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = Window50 # end
# set video output window to 100% # begin # remote = xxxxx # button = xxxxx # prog = xine # repeat = 0 # config = Window100 # end
# set video output window to 200% # begin # button = xxxxx # prog = xine # repeat = 0 # config = Window200 # end
# zoom in # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomIn # end
# zoom out # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomOut # end
# zoom in horizontally # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomInX # end
# zoom out horizontally # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomOutX # end
# zoom in vertically # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomInY # end
# zoom out vertically # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomOutY # end
# reset zooming # begin # button = xxxxx # prog = xine # repeat = 0 # config = ZoomReset # end
# resize output window to stream size # begin # button = xxxxx # prog = xine # repeat = 0 # config = Zoom1:1 # end
# fullscreen toggle # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleFullscreen # end
# Xinerama fullscreen toggle # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleXineramaFullscr # end
# jump to media Menu begin button = Menu prog = xine repeat = 0 config = Menu end
# jump to Title Menu begin button = Back prog = xine repeat = 0 config = TitleMenu end
# jump to Root Menu begin button = Go prog = xine repeat = 0 config = RootMenu end
# jump to Subpicture Menu begin button = TV prog = xine repeat = 0 config = SubpictureMenu end
# jump to Audio Menu begin button = Music prog = xine repeat = 0 config = AudioMenu end
# jump to Angle Menu # begin # button = xxxxx # prog = xine # repeat = 0 # config = AngleMenu # end
# jump to Part Menu # begin # button = xxxxx # prog = xine # repeat = 0 # config = PartMenu # end
# menu navigate up begin button = Up prog = xine repeat = 0 config = EventUp end
# menu navigate down begin button = Down prog = xine repeat = 0 config = EventDown end
# menu navigate left begin button = Left prog = xine repeat = 0 config = EventLeft end
# menu navigate right begin button = Right prog = xine repeat = 0 config = EventRight end
# menu select begin button = OK prog = xine repeat = 0 config = EventSelect end
# jump to next chapter begin button = NextTrack prog = xine repeat = 0 config = EventNext end
# jump to previous chapter begin button = PreviousTrack prog = xine repeat = 0 config = EventPrior end
# select next angle # begin # button = xxxxx # prog = xine # repeat = 0 # config = EventAngleNext # end
# select previous angle # begin # button = xxxxx # prog = xine # repeat = 0 # config = EventAnglePrior # end
# visibility toggle of help window # begin # button = Text # prog = xine # repeat = 0 # config = HelpShow # end
# visibility toggle of video post effect window # begin # button = xxxxx # prog = xine # repeat = 0 # config = VPProcessShow # end
# toggle post effect usage # begin # button = xxxxx # prog = xine # repeat = 0 # config = VPProcessEnable # end
# visibility toggle of output window # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleWindowVisibility # end
# bordered window toggle of output window # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleWindowBorder # end
# visibility toggle of UI windows # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleVisibility # end
# visibility toggle of control window # begin # button = xxxxx # prog = xine # repeat = 0 # config = ControlShow # end
# visibility toggle of mrl browser window # begin # button = xxxxx # prog = xine # repeat = 0 # config = MrlBrowser # end
# visibility toggle of playlist editor window # begin # button = xxxxx # prog = xine # repeat = 0 # config = PlaylistEditor # end
# visibility toggle of the setup window # begin # button = xxxxx # prog = xine # repeat = 0 # config = SetupShow # end
# visibility toggle of the event sender window # begin # button = xxxxx # prog = xine # repeat = 0 # config = EventSenderShow # end
# visibility toggle of analog TV window # begin # button = xxxxx # prog = xine # repeat = 0 # config = TVAnalogShow # end
# visibility toggle of log viewer # begin # button = xxxxx # prog = xine # repeat = 0 # config = ViewlogShow # end
# visibility toggle of stream info window # begin # button = xxxxx # prog = xine # repeat = 0 # config = StreamInfosShow # end
# display stream information using OSD begin button = Text prog = xine repeat = 0 config = OSDStreamInfos end
# enter key binding editor # begin # button = xxxxx # prog = xine # repeat = 0 # config = KeyBindingEditor # end
# open file selector # begin # button = xxxxx # prog = xine # repeat = 0 # config = FileSelector # end
# select a subtitle file # begin # button = xxxxx # prog = xine # repeat = 0 # config = SubSelector # end
# download a skin from the skin server # begin # button = xxxxx # prog = xine # repeat = 0 # config = SkinDownload # end
# display MRL/Ident toggle # begin # button = xxxxx # prog = xine # repeat = 0 # config = MrlIdentToggle # end
# grab pointer toggle # begin # button = xxxxx # prog = xine # repeat = 0 # config = GrabPointer # end
# # enter the number 0 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number0 # end # # # enter the number 1 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number1 # end # # # enter the number 2 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number2 # end # # # enter the number 3 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number3 # end # # # enter the number 4 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number4 # end # # # enter the number 5 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number5 # end # # # enter the number 6 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number6 # end # # # enter the number 7 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number7 # end # # # enter the number 8 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number8 # end # # # enter the number 9 # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number9 # end # # # add 10 to the next entered number # begin # button = xxxxx # prog = xine # repeat = 0 # config = Number10add # end
# set position in current stream to numeric percentage # begin # button = xxxxx # prog = xine # repeat = 0 # config = SetPosition% # end
# set position forward by numeric argument in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative+ # end
# set position back by numeric argument in current stream # begin # button = xxxxx # prog = xine # repeat = 0 # config = SeekRelative- # end
# change audio video syncing (delay video) # begin # button = xxxxx # prog = xine # repeat = 0 # config = AudioVideoDecay+ # end
# change audio video syncing (delay audio) # begin # button = xxxxx # prog = xine # repeat = 0 # config = AudioVideoDecay- # end
# reset audio video syncing offset # begin # button = xxxxx # prog = xine # repeat = 0 # config = AudioVideoDecayReset # end
# change subtitle syncing (delay video) # begin # button = xxxxx # prog = xine # repeat = 0 # config = SpuVideoDecay+ # end
# change subtitle syncing (delay subtitles) # begin # button = xxxxx # prog = xine # repeat = 0 # config = SpuVideoDecay- # end
# reset subtitle syncing offset # begin # button = xxxxx # prog = xine # repeat = 0 # config = SpuVideoDecayReset # end
# toggle TV modes (on the DXR3) # begin # button = xxxxx # prog = xine # repeat = 0 # config = ToggleTVmode # end
# switch Monitor to DPMS standby mode # begin # button = xxxxx # prog = xine # repeat = 0 # config = DPMSStandby # end
# increase hue by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = HueControl+ # end
# decrease hue by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = HueControl- # end
# increase saturation by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = SaturationControl+ # end
# decrease saturation by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = SaturationControl- # end
# increase brightness by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = BrightnessControl+ # end
# decrease brightness by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = BrightnessControl- # end
# increase contrast by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = ContrastControl+ # end
# decrease contrast by 10 # begin # button = xxxxx # prog = xine # repeat = 0 # config = ContrastControl- # end
# quit the program begin button = Power prog = xine repeat = 0 config = Quit end
## # End of xine key bindings. ##
|