LinHES Forums
http://forum.linhes.org/

How the LIRC process works in KnoppMyth
http://forum.linhes.org/viewtopic.php?f=11&t=11193
Page 1 of 1

Author:  neutron68 [ Fri Aug 18, 2006 8:52 am ]
Post subject:  How the LIRC process works in KnoppMyth

I have been tweaking on my IR remote control (the Hauppauge silver dogbone) setup and believe I understand how the LIRC system works in KnoppMyth. Last night I customized my IR remote buttons (using the NANO text editor) for XINE so it can play dvds like a regular dvd player.

Here's my explaination of how the process works.

The IR remote sends out a number code when a button is pressed. There is a file called /etc/lirc/lircd.conf which assigns a button name to each key code. Then, there is a file called /home/mythtv/.mythtv/lircrc which assigns a program function call to that button name.

So, you push the button (called HOTBUTTON as an example) on the remote and code 1234 is sent. In the lircd.conf file we have a line that assigns the name HOTBUTTON to code 1234. In the lircrc file, we have button HOTBUTTON assigned to perform the PLAY function in XINE. So, in the end of the process you push HOTBUTTON on your remote and XINE will start playing a dvd. :)

As far as I know, there is no automatic process to help you create the lircd.conf or lircrc files. Also, I don't think there is any graphic user interface to help you assign key presses to specific events. You have to use a text editor like NANO to do all this. :(

In terms of automating the IR button process, I would LOVE to see a little application that helps you create the config files for LIRC. The application would prompt you for an IR remote button press, ask you what you want to call the button and what you want function that button to perform.

Eric

Author:  tjc [ Fri Aug 18, 2006 6:13 pm ]
Post subject:  Re: How the LIRC process works in KnoppMyth

neutron68 wrote:
As far as I know, there is no automatic process to help you create the lircd.conf or lircrc files.

Code:
man irrecord


The rest sounds like a great project for an ambitious newbie looking to give back to the community... ;-)

Author:  neutron68 [ Sat Aug 19, 2006 1:56 pm ]
Post subject:  how to stop lirc?

I need to create some custom lirc files for my friend's remote.

What is the proper way to stop LIRC so I can run the irrecord program?

Should I just type "lircd stop", then read the error message to get the PID of the process and then type "kill XXXX" where xxxx is the process number?

Author:  cesman [ Sat Aug 19, 2006 5:29 pm ]
Post subject: 

Code:
/etc/init.d/lirc stop

Author:  neutron68 [ Sun Aug 27, 2006 9:35 am ]
Post subject:  Re: How the LIRC process works in KnoppMyth

tjc wrote:
The rest sounds like a great project for an ambitious newbie looking to give back to the community... ;-)


Unless it's easier than I think, I have a gut feeling that such a project is beyond the capabilities of a newbie. Speaking personally, I've got no idea where to start writing a GUI application in Linux. Is there a GUI programming package available - similar to Visual Basic or Visual C?

Eric

Author:  neutron68 [ Sun Aug 27, 2006 10:36 am ]
Post subject:  wasn't enough

cesman wrote:
Code:
/etc/init.d/lirc stop

I tried it and it wasn't enough to stop all the LIRC processes. I got this error back from IRRECORD:
Code:
irrecord: could not init hardware (lircd running ? --> close it, check permissions)

So, I did the thing I mentioned above:
Code:
root@mythtv:~# lircd stop
lircd: there seems to already be a lircd process with pid 2448
lircd: otherwise delete stale lockfile /var/run/lircd.pid
root@mythtv:~# kill 2448
root@mythtv:~# irrecord /home/eric/test

and that worked fine.

Eric

Author:  neutron68 [ Sun Aug 27, 2006 10:46 am ]
Post subject:  "You have labored to produce."

Here are the config files I produced for the RCA remote control that comes with the RCA DTC-100 HDTV receiver box. This is a 6 device remote and when you take into account the 6 different modes, there are about 200 different button codes with this remote. I only used the "TV" mode of the remote so there is no remote mode-changing necessary. You will note that some of the program funtions don't have keys assigned to them. They have xxxx for a button name. For me, these program functions weren't important. The arrow buttons were the most important to me, since you can control a huge percentage of KnoppMyth with just the arrows.

I hope these files help someone.

Eric

Code:
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.0pre4-pvr150(all) on Sun Aug 20 12:02:01 2006
#
# contributed by neutron68 at yah00 d0t c0m
#
# brand: RCA
# model no. of remote control: CRK76CA2 (came with DTC-100 HD receiver)
# devices being controlled by this remote: VCR1, DVD, VCR2, AUX, HD RCVR, TV
#
# the remote was set in the default mode
# Each button sends out a different code for each mode.
# Example:
# the 1 button sends a different code when in VCR1 mode vs. TV mode
# 3 of the keys are the same in all modes:  vol-right, vol-left and mute
#

begin remote

  name rca-dtc-100
  bits           24
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       4044  3942
  one           532  1961
  zero          532   966
  ptrail        539
  gap          65915
  toggle_bit      0


      begin codes
          vol-left                 0xF2E0D1
          vol-right                0xF2F0D0
          mute                     0xF3F0C0
          aux-on-off               0xC3B3C4
          aux-mute                 0xC3F3C0
          aux-who                  0xC6139E
          aux-ch+                  0xC2D3D2
          aux-ch-                  0xC2C3D3
          aux-vol-left             0xC2E3D1
          aux-vol-right            0xC2F3D0
          aux-fetch                0xC9336C
          aux-go-back              0xC273D8
          aux-guide                0xC1A3E5
          aux-info                 0xC3C3C3
          aux-menu                 0xC083F7
          aux-clear                0xC063F9
          aux-up                   0xC593A6
          aux-down                 0xC583A7
          aux-right                0xC573A8
          aux-left                 0xC563A9
          aux-ok                   0xCF430B
          aux-1                    0xC313CE
          aux-2                    0xC323CD
          aux-3                    0xC333CC
          aux-4                    0xC343CB
          aux-5                    0xC353CA
          aux-6                    0xC363C9
          aux-7                    0xC373C8
          aux-8                    0xC383C7
          aux-9                    0xC393C6
          aux-0                    0xC303CF
          aux-antenna              0xC053FA
          aux-reverse              0xC1D3E2
          aux-play                 0xC153EA
          aux-forward              0xC1C3E3
          aux-record               0xC173E8
          aux-stop                 0xC1F3E0
          aux-pause                0xC193E6
          vcr1-on-off              0xE2A1D5
          vcr1-who                 0xE6119E
          vcr1-ch+                 0xE2D1D2
          vcr1-ch-                 0xE2C1D3
          vcr1-fetch               0xE9316C
          vcr1-go-back             0xE271D8
          vcr1-guide               0xE1A1E5
          vrc1-info                0xE3C1C3
          vcr1-ok                  0xEF410B
          vcr1-up                  0xE591A6
          vcr1-down                0xE581A7
          vcr1-left                0xE561A9
          vcr1-right               0xE571A8
          vcr1-menu                0xE081F7
          vcr1-clear               0xE061F9
          vcr1-1                   0xE311CE
          vcr1-2                   0xE321CD
          vcr1-3                   0xE331CC
          vcr1-4                   0xE341CB
          vcr1-5                   0xE351CA
          vcr1-6                   0xE361C9
          vcr1-7                   0xE371C8
          vcr1-8                   0xE381C7
          vcr1-9                   0xE391C6
          vcr1-0                   0xE301CF
          vcr1-input               0xE471B8
          vcr1-antenna             0xE051FA
          vcr1-reverse             0xE1D1E2
          vcr1-play                0xE151EA
          vcr1-forward             0xE1C1E3
          vcr1-record              0xE171E8
          vcr1-stop                0xE1F1E0
          vcr1-pause               0xE191E6
          vcr2-on-off              0xD2A2D5
          vcr2-who                 0xD6129E
          vcr2-fetch               0xD9326C
          vcr2-go-back             0xD272D8
          vcr2-ch+                 0xD2D2D2
          vcr2-ch-                 0xD2C2D3
          vcr2-guide               0xD1A2E5
          vcr2-info                0xD3C2C3
          vcr2-ok                  0xDF420B
          vcr2-up                  0xD592A6
          vcr2-down                0xD582A7
          vcr2-left                0xD562A9
          vcr2-right               0xD572A8
          vcr2-menu                0xD082F7
          vcr2-clear               0xD062F9
          vcr2-1                   0xD312CE
          vcr2-2                   0xD322CD
          vcr2-3                   0xD332CC
          vcr2-4                   0xD342CB
          vcr2-5                   0xD352CA
          vcr2-6                   0xD362C9
          vcr2-7                   0xD372C8
          vcr2-8                   0xD382C7
          vcr2-9                   0xD392C6
          vcr2-0                   0xD302CF
          vcr2-input               0xD472B8
          vcr2-antenna             0xD052FA
          vcr2-reverse             0xD1D2E2
          vcr2-play                0xD152EA
          vcr2-forward             0xD1C2E3
          vcr2-record              0xD172E8
          vcr2-stop                0xD1F2E0
          vcr2-pause               0xD192E6
          tv-on-off                0xF2A0D5
          tv-mute                  0xF3F0C0
          tv-who                   0xF6109E
          tv-fetch                 0xF9306C
          tv-go-back               0xF270D8
          tv-ch+                   0xF2D0D2
          tv-ch-                   0xF2C0D3
          tv-vol-left              0xF2E0D1
          tv-vol-right             0xF2F0D0
          tv-guide                 0xF1A0E5
          tv-info                  0xF3C0C3
          tv-menu                  0xF080F7
          tv-clear                 0xF060F9
          tv-ok                    0xFF400B
          tv-up                    0xF590A6
          tv-down                  0xF580A7
          tv-left                  0xF560A9
          tv-right                 0xF570A8
          tv-1                     0xF310CE
          tv-2                     0xF320CD
          tv-3                     0xF330CC
          tv-4                     0xF340CB
          tv-5                     0xF350CA
          tv-6                     0xF360C9
          tv-7                     0xF370C8
          tv-8                     0xF380C7
          tv-9                     0xF390C6
          tv-0                     0xF300CF
          tv-input                 0xFA305C
          tv-antenna               0xF050FA
          tv-reverse               0xF1D0E2
          tv-play                  0xF150EA
          tv-forward               0xF1C0E3
          tv-record                0xF170E8
          tv-stop                  0xF1F0E0
          tv-pause                 0xF190E6
          dvd-on-off               0x52AAD5
          dvd-mute                 0xF3F0C0
          dvd-who                  0x561A9E
          dvd-ch+                  0x520ADF
          dvd-ch-                  0x522ADD
          dvd-fetch                0x593A6C
          dvd-go-back              0x527AD8
          dvd-guide                0x51AAE5
          dvd-info                 0x53CAC3
          dvd-ok                   0x5F4A0B
          dvd-up                   0x559AA6
          dvd-down                 0x558AA7
          dvd-left                 0x556AA9
          dvd-right                0x557AA8
          dvd-menu                 0x508AF7
          dvd-clear                0x506AF9
          dvd-1                    0x531ACE
          dvd-2                    0x532ACD
          dvd-3                    0x533ACC
          dvd-4                    0x534ACB
          dvd-5                    0x535ACA
          dvd-6                    0x536AC9
          dvd-7                    0x537AC8
          dvd-8                    0x538AC7
          dvd-9                    0x539AC6
          dvd-0                    0x530ACF
          dvd-input                0x547AB8
          dvd-antenna              0x505AFA
          dvd-reverse              0x51DAE2
          dvd-play                 0x515AEA
          dvd-forward              0x51CAE3
          dvd-record               0x517AE8
          dvd-stop                 0x51FAE0
          dvd-pause                0x519AE6
          hd-on-off                0x72A8D5
          hd-ch+                   0x72D8D2
          hd-ch-                   0x72C8D3
          hd-who                   0x76189E
          hd-fetch                 0x79386C
          hd-go-back               0x7278D8
          hd-guide                 0x71A8E5
          hd-info                  0x73C8C3
          hd-ok                    0x7F480B
          hd-up                    0x7598A6
          hd-down                  0x7588A7
          hd-left                  0x7568A9
          hd-right                 0x7578A8
          hd-menu                  0x7088F7
          hd-clear                 0x7068F9
          hd-1                     0x7318CE
          hd-2                     0x7328CD
          hd-3                     0x7338CC
          hd-4                     0x7348CB
          hd-5                     0x7358CA
          hd-6                     0x7368C9
          hd-7                     0x7378C8
          hd-8                     0x7388C7
          hd-9                     0x7398C6
          hd-0                     0x7308CF
          hd-input                 0x7A385C
          hd-antenna               0x7058FA
          hd-reverse               0x71D8E2
          hd-play                  0x7158EA
          hd-forward               0x71C8E3
          hd-record                0x7178E8
          hd-stop                  0x71F8E0
          hd-pause                 0x7198E6
      end codes

end remote


Code:
# MythTV LIRC config file for the RCA DTC-100 remote
# remote has bright green power, ch+, ch-, vol+, vol- buttons
# Sticker on the inside of battery compartment
#     says CRK76CA2
#     
#
# /home/mythtv/.mythtv/lircrc
#
#
### RESET THE MYTH BOX or REBOOT IT
# 1 click is reset front end, 2 clicks is reboot
#
begin
   prog = irexec
   button = xxxx
   config = /home/mythtv/scripts/mypower.sh &
end
#
### MYTHTV SETTINGS FOR IT'S CONTROL
#
# Program Guide
begin
   prog = mythtv
   button = tv-guide
   config = F2
end
#
# TV Recording tv-playback
begin
   prog = mythtv
   button = xxxx
   config = F3
end
#
# Live TV
begin
   prog = mythtv
   button = xxxx
   config = F4
end
#
# MythWeather
begin
   prog = mythtv
   button = xxxx
   config = F7
end
#
# MythGame
begin
   prog = mythtv
   button = xxxx
   config = F5
end
#
# MythMusic
begin
   prog = mythtv
   button = xxxx
   config = F6
end
#
# Previous Channel
begin
   prog = mythtv
   button = tv-go-back
   config = H
end
#

# OK/Select
begin
 prog = mythtv
 button = tv-ok
 config = Space
end

# tv-play
begin
prog = mythtv
button = tv-play
config = Return
end

# tv-stop
begin
prog = mythtv
button = tv-stop
config = Esc
end

# Escape/Exit/Back
begin
 prog = mythtv
 button = tv-go-back
 config = Esc
end

# Power Off/Exit
begin
 prog = mythtv
 button = tv-on-off
 config = Esc
end

# Pause
begin
prog = mythtv
button = tv-pause
config = P
end

# mute
begin
prog = mythtv
button = mute
config = F9
end

begin
prog = mythtv
button = tv-up
config = Up
end

begin
prog = mythtv
button = tv-right
config = Right
end

begin
prog = mythtv
button = tv-down
config = Down
end

begin
prog = mythtv
button = tv-left
config = Left
end


# Fast forward (while viewing)
begin
prog = mythtv
button = tv-forward
config = >
end

# Rewind (while viewing)
begin
prog = mythtv
button = tv-reverse
config = <
end

# Skip forward (10 min default)
begin
prog = mythtv
button = tv-ch-
config = PgDown
end

# Skip backward (10 min default)
begin
prog = mythtv
button = tv-ch+
config = PgUp
end

# Record
begin
prog = mythtv
button = tv-record
config = R
end

# Delete
begin
prog = mythtv
button = xxxx
config = D
end

# OSD browse

begin
prog = mythtv
button = tv-menu
config = O
end

# Display EPG while in live TV,
# View selected show while in EPG
begin
prog = mythtv
button = tv-guide
config = M
end

# Volume-Up
begin
prog = mythtv
button = vol-right
config = ]
end

# Volume-Down
begin
prog = mythtv
button = vol-left
config = [
end

# Bring up OSD info
begin
prog = mythtv
button = tv-info
config = I
end

# Change display aspect ratio
begin
prog = mythtv
button = tv-input
config = W
end

# Seek to previous commercial cut point
begin
prog = mythtv
button = tv-fetch
config = Q
end

# Seek to next commercial cut point
begin
prog = mythtv
button = tv-clear
config = Z
end

# Numbers 0-9

begin
prog = mythtv
button = tv-0
config = 0
end

begin
prog = mythtv
button = tv-1
config = 1
end

begin
prog = mythtv
button = tv-2
config = 2
end

begin
prog = mythtv
button = tv-3
config = 3
end

begin
prog = mythtv
button = tv-4
config = 4
end

begin
prog = mythtv
button = tv-5
config = 5
end

begin
prog = mythtv
button = tv-6
config = 6
end

begin
prog = mythtv
button = tv-7
config = 7
end

begin
prog = mythtv
button = tv-8
config = 8
end

begin
prog = mythtv
button = tv-9
config = 9
end

#
### Mplayer lirc setup
#
# Show OSD
begin
prog = mplayer
button = tv-info
config = osd
end

# pause playback
begin
prog = mplayer
button = tv-pause
config = pause
end

# Skip ahead a minute if playing
# If paused, resume playing
begin
prog = mplayer
button = tv-right
config = seek +1
end

# tv-stop playback and exit
begin
prog = mplayer
button = tv-stop
config = quit
end

# mute
begin
prog = mplayer
button = mute
config = mute
end

# Seek back 10 seconds
begin
prog = mplayer
button = tv-left
config = seek -10
end

# Seek forward 30 seconds
begin
prog = mplayer
button = tv-right
config = seek +30
end

# Quit
begin
prog = mplayer
button = tv-go-back
config = quit
end

# Seek forward 10 minutes
begin
prog = mplayer
button = tv-down
config = seek +600
end

# Seek backward 10 minutes
begin
prog = mplayer
button = tv-up
config = seek -600
end

# Toggle full-screen
begin
prog = mplayer
button = tv-input
config = vo_fullscreen
end

#
### XINE CONFIGURATION
#
##
# xine key bindings.
# Automatically generated by xine-ui version 0.99.2.
# edited by neutron68
##

# start playback
begin
   button = tv-play
   prog   = xine
   config = Play
end

# playback pause toggle
begin
   button = tv-pause
   prog   = xine
   config = Pause
end

# stop playback
begin
   button = tv-stop
   prog   = xine
   config = Stop
end

# take a snapshot
begin
   button = tv-fetch
   prog   = xine
   config = Snapshot
end

# eject the current medium
begin
   button = tv-antenna
   prog   = xine
   config = Eject
end

# toggle interlaced mode
begin
   button = tv-clear
   prog   = xine
   config = ToggleInterleave
end


# set position to -60 seconds in current stream
begin
   button = tv-ch+
   prog   = xine
   config = SeekRelative-60
end

# set position to +60 seconds in current stream
begin
   button = tv-ch-
   prog   = xine
   config = SeekRelative+60
end

# set position to -30 seconds in current stream
begin
   button = xxxx
   prog   = xine
   config = SeekRelative-30
end

# set position to +30 seconds in current stream
begin
   button = xxxx
   prog   = xine
   config = SeekRelative+30
end

# set position to +7 and -7 seconds in current stream
begin
   button = tv-1
   prog   = xine
   config = SeekRelative-7
end

begin
   button = tv-2
   prog   = xine
   config = SeekRelative+7
end

begin
   button = tv-4
   prog   = xine
   config = SetPosition40%
end

begin
   button = tv-5
   prog   = xine
   config = SetPosition70%
end

begin
   button = tv-9
   prog   = xine
   config = SpeedFaster
end

begin
   button = tv-7
   prog   = xine
   config = SpeedSlower
end

begin
   button = tv-8
   prog   = xine
   config = SpeedReset
end

# increment audio volume
begin
   button = vol-right
   prog   = xine
   config = Volume+
end

# decrement audio volume
begin
   button = vol-left
   prog   = xine
   config = Volume-
end

# audio muting toggle
begin
   button = mute
   prog   = xine
   config = mute
end

# set video output window to 100%
begin

   button = xxxxx
   prog   = xine
   config = Window100
end

# set video output window to 200%
begin

   button = xxxxx
   prog   = xine
   config = Window200
end

# zoom in
begin
   button = xxxxx
   prog   = xine
   config = ZoomIn
end

# zoom out
begin

   button = xxxxx
   prog   = xine
   config = ZoomOut
end

# fullscreen toggle
begin
   button = xxxx
   prog   = xine
   config = ToggleFullscreen
end

# Xinerama fullscreen toggle
begin
   button = xxxx
   prog   = xine
   config = ToggleXineramaFullscr
end

# jump to Title Menu
begin
   button = tv-menu
   prog   = xine
   config = TitleMenu
end

# jump to Root Menu
begin
   button = tv-guide
   prog   = xine
   config = RootMenu
end

# menu navigate up
begin
   button = tv-up
   prog   = xine
   config = EventUp
end

# menu navigate down
begin
   button = tv-down
   prog   = xine
   config = EventDown
end

# menu navigate left
begin
   button = tv-left
   prog   = xine
   config = EventLeft
end

# menu navigate right
begin
   button = tv-right
   prog   = xine
   config = EventRight
end

begin
   prog = xine
   button = tv-ok
   config = EventSelect
end

#skip chapter forward
begin
   prog = xine
   button = tv-forward
   config = EventNext
end

#skip chapter backward
begin
   prog = xine
   button = tv-reverse
   config = EventPrior
end

# visibility toggle of stream info window
begin
   button = tv-info
   prog   = xine
   config = StreamInfosShow
end

# display stream information using OSD
begin
   button = tv-who
   prog   = xine
   config = OSDStreamInfos
end

# increase brightness by 10
begin
   button = xxxx
   prog   = xine
   config = BrightnessControl+
end

# decrease brightness by 10
begin
   button = xxxx
   prog   = xine
   config = BrightnessControl-
end

# quit the program
begin
   button = tv-go-back
   prog   = xine
   config = Quit
end

##
# End of xine key bindings.
##

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/