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.

Saturday, March 31, 2007

Ubuntu Video Performance Woes

I had been noticing poor video performance since I first installed Ubuntu (very similar to what clinto describes here), but with MythTV it was really annoying. So it was time to address that.

Looking at the specs for my PC, I saw that I had a Integrated NVIDIA Quadro® NVS 210S Graphics card. But looking at the video card configuration in at /etc/X11/xorig.conf, I saw that my configuration was for a generic video card:
Section "Device"
Identifier "Generic Video Card"
Driver "vesa"
BusID "PCI:0:5:0"
EndSection
So I poked around for how to install NVIDIA drivers and came across the appropriate section in the Ubuntu Guide. I followed the steps to install and configure the drivers:

sudo apt-get install nvidia-glx nvidia-kernel-common
sudo nvidia-xconfig
I tried to restart gdm using /etc/init.d/gdm restart, but then I had no mouse pointer, so I rebooted the system and all seemed fine. Video at this point seemed very smooth and MythTV looked great.

Subsequent directions in the Ubuntu guide talked about configuring XvMC. They seemed to assume that /etc/X11/XvMCConfig didn't exist, but I already had such a file with the following line in it:
libXvMC.so.1
I went ahead and replaced with it with the following (after making sure such a library existed in /usr/lib):
libXvMCNVIDIA_dynamic.so.1
But then:
# xine -V xxmc filename.ts
bash: xine: command not found
So at this point I put XvMC on the back burner.

Next thing was get get the X configuration for my monitor right. I found the specification for my Dell E193FP LCD and then ran dpkg-reconfigure xserver-xorg entering the values from the monitor specification.
# dpkg-reconfigure xserver-xorg
Then I rebooted.

At this point all looked great. 1280x1024 resolution (ok, not great but as good as this LCD display was going to get) and video was nice and smooth.

Sunday, March 25, 2007

Securing MythWeb

Ok, in my last post I set up MythWeb. Now to lock it down so that it's not publicly accessible. I basically followed the directions at the KnoppMythWiki, with a couple of twists:
  1. I'm running Apache2
  2. I only locked down MythWeb and not my whole web space.
First I edited /etc/apache2/apache2.conf and added the following (I did it right before UseCanonicalName Off but I don't think it matters):

<Directory /var/www/mythweb>
AuthType Basic
AuthName "BasicAuth"
AuthUserFile /etc/apache2/basicauth
Require valid-user
</Directory>

Then I created /etc/apache2/basicauth with a mythtv user, setting the password in the process:
# htpasswd -c /etc/apache2/basicauth mythtv
Then I restarted apache and all was good:
# /etc/init.d/apache2 restart

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

Saturday, March 24, 2007

MythTV on Ubuntu

My next project was to install my WinTV PVR-250 and MythTV. I followed the directions at the Ubuntu Community Documentation site and specifically the directions for a Backend/Frontend/Desktop install with the exception I was building on a existing Ubuntu install so I skipped most of the initial steps and I started with installing the XFS Utilities:
# apt-get install xfsprogs
Then I set up NTP as specified. I did a "Synchronize Now" before since my clock was 10 minutes off. NTP was not installed, but I selected the auto installaion and all went fine.

For the WinTV-PVR 250 drivers I installed IVTV.

Now I installed MythTV. I skipped the mysql install since I already had it installed when I installed MediaWiki.
# apt-get install mythtv-frontend mythtv-backend mythtv-database
Now set up MythTV following the directions provided. Some details
  • Under Video Source setup, I set the Channel frequency table to "us-cable" since I have cable.
  • Chose the MPEG-2 encoder card (PVR-x50, PVR-500)
  • I registered with Zap2It as specified and got a username and password which I used for MythTV.
I synchronized the channel line up as specified:
# /etc/cron.daily/mythtv-backend
And launched the backend:
# /etc/init.d/mythtv-backend start
Starting MythTV server: mythbackend.
As suggested on the page I installed phpmyadmin:
sudo apt-get install phpmyadmin
And added the channel icons.

And installed the mythplugins. Note I had to restart Apache for the /etc/group change to take effect:
# /etc/init.d/apache2 restart
At this point I could run mythfrontend and everything seemed to be working great except for the remote control, which isn't working at this point. That will be the next post.

Saturday, March 17, 2007

Securing Mediawiki

I noticed that mediawiki was allowing anonymous editing of pages. I wanted to lock it down so that only those I grant accounts to could edit it.

I found the directions here. Which work for the most part, with some tweaks...

I started by restricting the wiki so that users had to be logged in to edit. That went fine.

Then I wanted to give myself sysop privileges. This was more complicated. The big issue is that when I installed mediawiki, I specified a prefix for my mediawiki tables:
$ grep wgDBprefix /etc/mediawiki/LocalSettings.php
$wgDBprefix = "mw_";
So I had to prefiex "mw_" to all the table names on the page. The specific steps were:
  1. First, I had to figure out what version of mediawiki I was running. Fortunately there is a Special:Version page that tells you that.
  2. Now I need to figure out my uid for the 1.4 comments. the best way I found to do that was to log into the mysql database and then issued the following command. From the output I was able to figure out my uid was '2'.
    mysql> SELECT user_id, user_name from mw_user;
  3. Now I could issue the command on the page:
    mysql> UPDATE mw_user_rights SET ur_rights="bureaucrat,sysop" WHERE ur_user=2;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
That did it. I didn't even have to log out and back into the wiki.

Thursday, March 15, 2007

Adding a New Disc to Itunes via Rythmbox/Samba

Itunes is getting music via Samba from Ubuntu. If you import a new CD on the Umbuntu server, you have to import the new folder on the Samba Share under Itunes for it to appear in the library on the Samba client.

To do this select File/Add Folder to Library. Then find the network share and then the specific new folder that the CD was imported into. Yes, if you have a lot of CDs, this will be slow. It should import quickly once you find it and be immediately available under Itunes.

Saturday, March 10, 2007

Installing MediaWiki on Ubuntu

  1. Start by installing MySQL.
    1. I had to use the directions here to set the root password for the mysql DB. Specifically the directions at the bottom of the page for a forgotten root password.
  2. Follow the directions at the following URL to install and configure MediaWiki: http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu_GNU/Linux
    1. Note that the current version of MediaWiki has different paths that what are given at the URL