My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Showing posts with label lirc. Show all posts
Showing posts with label lirc. Show all posts

Wednesday, September 24, 2008

MythBuntu MythTV Tweaks

After getting MythBuntu installed, I did the following tweaks to MythTV:
  • Disabling DPMS (screen power saver): Previously I did it with the session manager, but Mythbuntu doesn't have the equivalent. So based on this thread, I did the following:
    $ vi ~/.xsessionrc
    $ cat ~/.xsessionrc
    xset s noblank
    xset s off
    xset -dpms
    Now restart desktop so changes take effect
    $ sudo /etc/init.d/gdm restart
    Updated Oct 24, 2008: I later also disabled the gnome-screensaver
  • I was still getting commercials during playback of recorded shows. Poking around it seemed like all the options for commercial remove were select, but then I found under Utilities/Setup -> Setup -> TV Settings -> Playback on screen 8 "Automatically Skip Commercials" which I set to "Automatically Skip"
  • I wanted my familiar Blootube theme back. I found this under Utilities/Setup -> Setup -> Appearance on screen 1.
  • I wanted channel changing during live TV to take effect immediately. This was done with a combination of two options: Utilities/Setup -> Setup -> TV Settings -> General screen 1, select "Change channels immediately without select", and Utilities/Setup -> Setup -> TV Settings -> Playback OSD screen 1, unselect "Always use Browse Mode"
  • Under Utilities/Setup -> Setup -> TV Settings -> Playback, screen 2, I set "Action on playback exit" to "Save Position and exit" and "Prompt at end of Recording".
  • Configured MythFillDatbase to run automatically. Utilities/Setup -> Setup -> TV Settings -> General screen 6, enable "Automatically run mythfilldatabase". For "Arguments" I used "--refresh-all --quiet" and for "Log Path" I used "/tmp/mythfilldatabase.log". Everything else I left as is.
  • Next I wanted to get the extra buttons on my remote working. So under Utilities/Setup -> Edit Keys I bound keys to the various screens I wanted shortcuts to under "JumpPoints". (Hint: to jump to the "Watch Recordings" screen, use the "TV Recording Playback" action as the target.)

    A hint, run "irw" as root and press keys on your remote to figure out their names, e.g. the following shows me pressing the Blue and Go keys:
    # irw
    00000000000017a9 00 Blue Hauppauge_350
    00000000000017a9 01 Blue Hauppauge_350
    00000000000017a9 02 Blue Hauppauge_350
    00000000000017bb 00 Go Hauppauge_350
    00000000000017bb 01 Go Hauppauge_350
    00000000000017bb 02 Go Hauppauge_350


    The I edited ~/.lirc/mythtv and bound the remote commands to those keys (the "config" option).
    $ cd ~/.lirc
    $ cp mythtv mythtv.orig
    $ vi mythtv
    $ diff -c mythtv.orig mythtv
    *** mythtv.orig 2008-09-24 21:05:35.000000000 -0500
    --- mythtv 2008-09-24 21:39:34.000000000 -0500
    ***************
    *** 733,738 ****
    --- 733,774 ----
    begin
    remote = Hauppauge_350
    prog = mythtv
    + button = Blue
    + config = d
    + repeat = 0
    + delay = 0
    + end
    +
    + begin
    + remote = Hauppauge_350
    + prog = mythtv
    + button = Videos
    + config = r
    + repeat = 0
    + delay = 0
    + end
    +
    + begin
    + remote = Hauppauge_350
    + prog = mythtv
    + button = TV
    + config = l
    + repeat = 0
    + delay = 0
    + end
    +
    + begin
    + remote = Hauppauge_350
    + prog = mythtv
    + button = RED
    + config = m
    + repeat = 0
    + delay = 0
    + end
    +
    + begin
    + remote = Hauppauge_350
    + prog = mythtv
    button = 7
    config = 7
    repeat = 0

    Next I tried restarting lirc:

    sudo /etc/init.d/lirc restart

    But that just caused my remote to stop working with mythtv all together, so I rebooted and all worked fine.


Wow, if it is possible for something to have too many options, MythTV is guilty...

Wednesday, July 30, 2008

LIRC (remote) not working

I rebooted my Ubuntu system and suddenly the remote wasn't working. I poked around and noticed lirc was not running.

# ps auxwww | grep lirc
root 14915 0.0 0.0 2884 752 pts/0 R+ 21:09 0:00 grep lirc
#


Poking around in the logs, it looked like lirc was dying when lircmd was started (I verified this by starting them sequentially):

# tail /var/log/daemon.log
Jul 30 21:00:43 casey lircd-0.8.2-CVS[6792]: lircd(userspace) ready
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: accepted new client on /dev/lircd
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: could not get file information for /dev/lirc
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: default_init(): No such file or directory
Jul 30 21:00:48 casey lircd-0.8.2-CVS[6792]: caught signal
#


So I downloaded LIRC 0.8.3 (I had been running 0.8.1) from the project download page and build according to directions at: http://www.mythtv.org/wiki/index.php/LIRC_on_Ubuntu_Edgy_Eft

Then the daemon seemed to start fine, though I still had to reboot to get the remote working.

# /etc/init.d/lirc start
Starting lirc daemon: lircd lircmd.
# ps auxwww | grep lirc
root 14842 0.0 0.0 0 0 ? S 21:07 0:00 [lirc_dev]
root 14909 0.0 0.0 2876 552 ? Ss 21:09 0:00 /usr/sbin/lircd --device=/dev/lirc
root 14911 0.0 0.0 1636 236 ? Ss 21:09 0:00 /usr/sbin/lircmd
root 14915 0.0 0.0 2884 752 pts/0 R+ 21:09 0:00 grep lirc
#

Sunday, March 25, 2007

LIRC and Remote working with Ubuntu and MythTV

Next step was setting up the remote. I have the Grey Hauppauge remote with the 4 color buttons at the bottom, model A415-HPG (confirmed via a sticker inside the battery compartment).

I followed the directions on the LIRC_on_Ubuntu_Edgy_Eft page, with the following exceptions:
  • My lirc device was /dev/lirc/0 and not /dev/lirc0
At this point I fired up the lirc deamons and things seemed to be working in that irw reported key presses (although, yes it was reporting "Hauppauge_350" when I have a 250):
$ irw
00000000000017b7 00 Record Hauppauge_350
0000000000001790 00 Vol+ Hauppauge_350
00000000000017b5 00 Play Hauppauge_350
00000000000017b2 00 Rewind Hauppauge_350
00000000000017a4 00 Replay/SkipBackward Hauppauge_350
00000000000017a4 01 Replay/SkipBackward Hauppauge_350
0000000000001790 00 Vol+ Hauppauge_350
But it still wasn't working with MythTV at this point.

So I poked around on the following sites:
I didn't seem to have lirc support build into MythTV ("native LIRC support"), at least creating a ~mythtv/.mythtv/lircrc file didn't do anything (as described here). I'm not sure how you determine this for certain.

I also didn't have irxevent installed. I figured out I had to install the lirc-x package to get irxevent:
# apt-get install !$
# which irxevent
/usr/bin/irxevent
I then created ~/.lircrc from http://gentoo-wiki.com/HOWTO_Setup_MythTV/Hauppauge_lircrc

Update 4/20/2007:
Looks like adding irxevent to my ~/.xinitrc file doesn't work with Gnome. Instead under System/Preferences select Sessions. Then click on the Startup Programs tab, then Add and enter irxevent --daemon. Then Close.

Back to original text...

At this point I could run irxevent and I could see that IR events were being translated into keystrokes for my Terminal window. I fired up MythFrontend and things sorta worked. By that I mean the arrow keys didn't work for the opening menu and once I started watching TV things worked after I hit enter on the keyboard once. Not ideal.

So after some editing to my .lircrc file it looks like the following. It's working fairly well, but changing channels is still clunky. It seems like I have to hit enter after channel up/down to make the change take effect. I suspect some problem with MythTV since I see the same issue with hitting the up/down keys on the keyboard.

begin
prog = irxevent
button = UP
repeat = 3
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = DOWN
repeat = 3
config = Key Down CurrentWindow
end
begin
prog = irxevent
button = LEFT
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = RIGHT
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = OK
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = CH+
repeat = 3
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = CH-
repeat = 3
config = Key Down CurrentWindow
end
begin
prog = irxevent
button = MENU
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = RECORD
repeat = 3
config = Key Return CurrentWindow
end
begin
prog = irxevent
button = RED
repeat = 3
config = Key X CurrentWindow
end
begin
prog = irxevent
button = GREEN
repeat = 3
config = Key I CurrentWindow
end
begin
prog = irxevent
button = YELLOW
repeat = 3
config = Key bracketleft CurrentWindow
end
begin
prog = irxevent
button = BLUE
repeat = 3
config = Key bracketright CurrentWindow
end
begin
prog = irxevent
button = BLANK
repeat = 3
config = Key D CurrentWindow
end
begin
prog = irxevent
button = VOL-
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = REV
repeat = 3
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = PLAY
repeat = 3
config = Key P CurrentWindow
end
begin
prog = irxevent
button = MUTE
repeat = 3
config = Key backslash CurrentWindow
end
begin
prog = irxevent
button = VOL+
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = FFW
repeat = 3
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = BACK/EXIT
repeat = 3
config = Key Escape CurrentWindow
end
begin
prog = irxevent
button = FULL
repeat = 3
config = Key Escape CurrentWindow
end
begin
prog = irxevent
button = PAUSE
repeat = 3
config = Key P CurrentWindow
end
begin
prog = irxevent
button = 0
config = Key 0 CurrentWindow
end
begin
prog = irxevent
button = 1
config = Key 1 CurrentWindow
end
begin
prog = irxevent
button = 2
config = Key 2 CurrentWindow
end
begin
prog = irxevent
button = 3
config = Key 3 CurrentWindow
end
begin
prog = irxevent
button = 4
config = Key 4 CurrentWindow
end
begin
prog = irxevent
button = 5
config = Key 5 CurrentWindow
end
begin
prog = irxevent
button = 6
config = Key 6 CurrentWindow
end
begin
prog = irxevent
button = 7
config = Key 7 CurrentWindow
end
begin
prog = irxevent
button = 8
config = Key 8 CurrentWindow
end
begin
prog = irxevent
button = 9
config = Key 9 CurrentWindow
end