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.

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

No comments: