Archive for the ‘Tips and Tricks’ Category

Updated EPG instructions for MythTV in New Zealand

Friday, June 8th, 2007

I’ve been learning a bit more about Linux over the last few weeks and updated my electronic program guide (EPG) configuration to better reflect “standard” file location usage. The changes work better for my backup strategy as well as I do not backup any directory that starts with a dot.

  1. The location of the EPG script has changed. The EPG related scripts are now in the /home/mythtv/epg directory. Within that directory are two further directories. One for the old xmlTVNZ EPG configuration and the other for the new nice EPG configuration.
  2. The name of the EPG script has been changed. It is now simply called nice.sh and lives in the /home/mythtv/epg directory.
  3. The nice.sh script has been modified to log to the /var/log/mythtv directory:
    cd /home/mythtv/epg/nice
    wget http://nice.net.nz/epg/listings.xml.gz
    gunzip -f listings.xml.gz
    rm /var/log/mythtv/mythfilldatabase.log
    mythfilldatabase --no-delete --file 1 -1 listings.xml --update > /var/log/mythtv/mythfilldatabase.log

Setting up an EPG for MythTV in New Zealand

Monday, May 14th, 2007

One of the most important things to get right for your MythTV installation is the Electronic Program Guide (EPG). The EPG lets MythTV know when all of the programs are on so it know when to record your favourite show like “The Best of Top Gear”.

I’ve been using xmlTVNZ for some months now reasonably successfully. xmlTVNZ is a command line tool that scrapes various web-sites for the TV listings. The specific web-sites that are scraped depend on the command line parameters passed to it, which depend on which channels you are interested in getting EPG data for. Because of it’s scraping nature, it’s prone to falling over when a web-site that it scrapes changes. I think that problem may of occurred last night because all of the TV3 listings going forward disappeared. I managed to eventually get it working again by modifying the command line parameters to scrape TV3 off the Sky web-site instead of XTRA (which now appears to be Yahoo!).

I’ve also belonged to the Myth TV in NZ mailing list for some months and recently there was talk of some other common EPG methods. At the time I didn’t look into it because xmlTVNZ had been working fine. Given the recent problems though I looked into both the “Hairy” and “Nice” EPG listing methods.

The “Hairy” EPG is located at http://hairy.geek.nz/epg/ but when I looked last night there was some other strange directory listing there. The “Nice” EPG is located at http://nice.net.nz/epg/ and was all up when I looked last night. Both the Hairy and Nice EPG’s are based of the DVB program guide broadcast by Sky. The Nice one appears to have at least better information than obtained by xmlTVNZ because after updating there was lots of information updated after running mythfilldatabase for the same number of days.

Below is a set of instructions for getting the Nice EPG running within MythTV. This just covers the analog stations that I am recording since I don’t have a satellite dish installed but should work for any set of stations that you are tuning.

  1. Login as the mythtv user.
  2. Open the /home/mythtv/.mythtv/ directory
  3. Create a new directory called epg in that directory. This new directory could be created anywhere within the mythtv users home directory. I just put it in the .mythtv directory so it’s out of the way and next to the other MythTV related configuration directories like channels, which contains my channel icons.
  4. Create a new shell script file called nice.net.nz.sh in the epg directory. This will be used to script the download of the Nice EPG and to then populate the MythTV program database. This script could be named anything you like.
  5. Populate the newly created shell script with the following:
    #!/bin/bash
    wget http://nice.net.nz/epg/listings.xml.gz
    gunzip -f listings.xml.gz
    mythfilldatabase --no-delete --file 1 -1 listings.xml --update
  6. Alter the XMLTV ID values within the MythTV configuration for the channels that you want to have updated by the Nice EPG. This can be done using mythtv-setup or by using mythfilldatabase passing the --manual flag rather than --update. The XMLTV ID values I am using based on the Nice EPG are below.
  7. Analog Channel ID mappings to Nice EPG XMLTV Channel ID
    Channel Analog Channel ID Nice EPG XMLTV ID
    TV ONE 2 1031.dvb.guide
    TV2 4 1032.dvb.guide
    TV3 7 1033.dvb.guide
    C4 9 1034.dvb.guide
    Juice TV 57 1007.dvb.guide
    Prime 59 1037.dvb.guide
  8. Open up KCron or any other Crontab editor of your choice.
  9. Schedule the newly created shell script nice.net.nz.sh to run daily at a suitable time as the mythtv user. Since it doesn’t do any web-site scraping it is much faster than xmlTVNZ so could be run at any time of the day without any problems. Based on the last time the listings.xml.gz file was updated on nice.net.nz (~5:30 AM) it would be good to schedule it sometime after 6 AM.

Getting XBMC MythTV to work with Kubuntu Feisty Fawn (7.04)

Monday, April 30th, 2007

After upgrading to Feisty Fawn (7.04) of Kubuntu I thought I had made all the necessary changes for my XBMC (XBox Media Center) MythTV frontend to talk to the Kubuntu server running the MythTV backend. Part of the Kubuntu upgrade altered the /etc/mysql/my.cnf configuration file for MySQL. This alteration required me to change the bind-address from localhost to the static IP addess of the server.

I thought that this change would be sufficient but it turns out that it wasn’t. The MythTV frontend on my XBox failed to connect to the MySQL database on the MythTV backend for completely non-obvious reasons. If the error output in the MythTV frontend was better I probably would of identified the problem much more quickly. After some hours of looking closely at the MySQL configuration changes and various other network related settings in Kubuntu it looked like it might have something to do with the MySQL password handling.

The old /etc/mysql/my.cnf had a old_passwords = 1 setting in it. The new configuration file did not. In addition, within the newly added configuration import directory /etc/mysql/conf.d there was an old_passwords.cnf file that explicitely set old_passwords = false. This gave me enough clues to see if the MythTV front end for the XBMC was in fact using the old password authentication mechanism (no longer supported by the server with this configuration). I found plenty of references to versions of PHP needing to use the old password authentication mechanism for MySQL and wondered if there was a similar issue with Python (the language used for the MythTV frontend on the XBMC). That information was enough to convince me to try and find out how to configure the server to continue to use the old password mechanism to see if that changed anything.

Based on instructions in the MySQL reference documentation at Client does not support authentication protocol I first tried to get the MySQL daemon mysqld to start with the --old-passwords parameter so it worked like it would have prior to the upgrade. I couldn’t get this to work (the MySQL documentation is a bit sparse on how to set some of the configuration options) so I tried to set the password for the mythtv user using the OLD_PASSWORD() function instead of the PASSWORD() function. By a stroke of luck that actually worked. That’s where I’m leaving it too.

If it aint broke, don’t fix it.

So, at the moment the MySQL configuration is exactly the same way as it was after upgrading to Kubuntu Feisty Fawn (7.04) apart from the bind-address being set to the static IP address of the server. In addition, the MySQL password for the mythtv user has been reset using the OLD_PASSWORD() function.

  1. Login to MySQL as the root user
  2. mysql -u root -p
  3. SET PASSWORD for mythtv = OLD_PASSWORD('mythtv'); - where ‘mythtv’ is the password that is configured in the MythTV settings on the XBox.
  4. Test the settings in MythTV on the XBox
  5. Pat yourself on the back when it works and then go to bed…

This was pretty frustrating to have to deal with. If the error getting spat out of the MythTV frontend on XBMC was better this problem would have been much easier to find with a bit of searching on Google.

Wireless Client Update for Windows XP with Service Pack 2

Sunday, April 29th, 2007

Windows released the Wireless Client Update for Windows XP with Service Pack 2 in January of 2007. By all accounts it seems to have resolved some of the reasons why I switched to using the Intel PROSet Wireless application.

The Wireless Client Update lets you configure wireless networks as broadcast networks or as nonbroadcast networks. Additionally, Wireless Auto Configuration sends probe requests only for nonbroadcast networks.

Since the latest release of the Intel software caused 100% CPU usage on my machine I ditched and went back to Windows management of wireless.

With this Client Update installed I haven’t had any problems so far with my wireless network that isn’t broadcasting the SSID. Excellent. Thanks to the Non-broadcast Wireless Networks with Microsoft Windows article for providing the link to this breakthrough.

Setting up the nonbroadcast network isn’t as simple as it was for the Intel wireless management, but at least it’s possible without the machine going into a tailspin:

  1. View the wireless networks that are available. More than likely the nonbroadcast network won’t be displayed.
  2. Click on the Change advanced settings link underneath the Related tasks heading in the left hand pane.
  3. Choose the Wireless networks tab.
  4. In the Preferred networks section click on the Add button.
  5. Fill in the SSID that is being broadcast and select the Connect even if this network is not broadcasting checkbox.
  6. Save the changes and then see if Windows tries to connect to the network. This should fail since you haven’t specified the wireless network key. I found that I had to do this before Windows would even let me set the Wireless network key though.
  7. Hopefully now the network shows up in the list of networks that are available. If it does, go into the configuration settings for it again (this time the SSID should be disabled) and specify the correct wireless network secuirty settings for your network.

Latest version of Intel PROSet Wireless causes 100% CPU usage

Sunday, April 29th, 2007

Last night I had the misfortune of updating to the latest version of the Intel PROSet Wireless application and device drivers (11.1.0.86). After updating the machine spins into a 100% CPU gobbling cycle by the ZCfgsvg.exe process. This is related to the Intel PROSet application. Killing the process moves the problem to the iFrmwork.exe process. After faffing around for 30 minutes trying to figure out what was poked I just uninstalled the whole damn thing.

The reason I upgraded was to try and resolve a very bizarre problem I’ve had for some time on my Windows laptop. Every so often the machine will throw a complete hissy fit with fonts not rendering making the machine unusable (even the Windows Start button text goes away). For some time I’ve had my suspicions that it was related to the Intel PROSet Wireless application somehow mangling something in the OS. It’s a pretty far fetched suspicion because no application should be able to prevent the OS from being able to render fonts onto the display. However, more often than not it all went pear shaped after an error box (with nothing in it) was popped up by the Intel PROSet Wireless application.

So, now I may not have the problem with fonts going away but I’m faced with using Windows wireless networking which I never got to really work satisfactorily in the past - why I moved to the native Intel application in the first place. Luckily I found another Windows download that helps resolve some of the problems I was initially having with the Windows wireless management - I’ll cover this in a later post.

SATA driver location changed in Linux kernel 2.6.20 configuration

Saturday, March 24th, 2007

I just updated to the latest and greatest Linux kernel in my Kubuntu installation to get the latest drivers for my Hauppauge PVR-150 card and found that the SATA driver configuration has moved in the kernel configuration.

I’ve done a kernel upgrade before so I knew to do the whole make oldconfig thing after copying over my known good Linux kernel configuration. I’d had a hell of a time figuring out how to get my machine to boot without the "Waiting for the filesystem…" halt during boot because I’m using SATA drives.

Anyway, the new location for the drivers is Device Drivers -> Serial ATA (prod) and Parallel ATA (experimental) drivers. Compiling in AHCI SATA Support worked great with the Intel ICH7 chipset that my motherboard has.

It’s possible that the SATA driver location change was somewhere between 2.6.17 and 2.6.20 because that is the jump in Linux kernel that I went through.

Strange iTunes behaviour when configured to automatically sync music to iPod

Monday, December 11th, 2006

In one of my recent posts I thought I had stumbled upon a great way to synchronize all of my podcasts to my iPod and still be able to use smart playlists to listen to them on the iPod.

However, it turns out that when you have your iPod configured to automatically sync with your iTunes library it is not possible to play that music/podcast/whatever from within iTunes. You can play the content without any problems using the iPod directly, but with it connected via iTunes all of the tracks are greyed out and you can’t click on the play button in iTunes (even on the computer you are sync’ing with). This is particularly annoying for me because I have all my music at home and I want to listen to the music on the iPod at work through iTunes.

As of yet there is no iTunes store purchased content on the iPod since the New Zealand store just opened days ago, hoorah! So, it seems pretty weird that I can’t play any of the content via iTunes. Initially I thought that it was because I hadn’t authorized my work computer since I’d just opened an Apple account. It wasn’t though - authorization didn’t do anything. Reading the iTunes help it even mentions:

"To use your iPod with more than one computer, set up iTunes to manage songs manually."

Oh well. The workaround at the moment is to switch between manual synchronization turned on at work, and automatic synchronization at home. A little bit painful but seems to work as needed.

The best way to manage podcasts on an iPod

Sunday, December 10th, 2006

While updating my iPod this evening I ran into a better way to manage podcasts. It’s so simple I don’t know why I didn’t do this when I first started using the podcast smart playlist hack to get podcasts to play nicely on the iPod.

The original smart playlist hack was done because there are a couple of problems with standard podcast synchronisation and playing behaviour on an iPod.

First, as soon as you start listening to a podcast (or anything I believe) it is marked as played. So, synchronizing non-played podcasts doesn’t work very well because I often loose what I was part way through listening. To combat this I have previously configured my iPod Nano to synchronise only checked podcasts so I can actively remove podcasts that I have actually finished listening to off the iPod.

Second, the standard behaviour of listening to podcasts on the iPod is bizarre. It plays one podcast and then as soon as it is finished jumps back to the list of the podcasts in the feed. Pretty hopeless since I listen to the podcasts in the car on the way to work and many of the podcasts are only a few minutes long. To address this I have additionally had appropriate smart playlists configured on the iPod so that I can listen to each podcast one after the other based on feed. Playlists work as expected, carrying onto the next item once the current one finishes. The smart playlists are easy to setup using Podcast is true and then matching appropriately on Artist or Album.

With my latest configuration I don’t synchronise podcasts to the iPod Nano at all. I simply synchronise the podcast related smart playlists. I still have the music synchronisation configured to only pull across checked items so I can remove podcasts that I have listened to and prevent music that I don’t really want to on the iPod. So simple.

Everything is much easier to manage now with the rest of the space on the iPod is filled up with a number limited randomly ordered music smart playlist. Excellent.

Trouble getting bluetooth to work on my HP laptop with Windows XP SP2

Sunday, October 29th, 2006

What a freakin’ nightmare trying to get bluetooth to work on my HP laptop so I can get my new cellphone to talk to it via bluetooth.

To start with I couldn’t see any bluetooth devices entry in the Control Panel despite Windows Help telling me that’s where I had to go in order to configure it. After searching on the internet it seems like this is a common problem in Windows XP SP2. If Windows doesn’t find a somehow certified bluetooth device driver then it simply doesn’t show all of the Bluetooth related information in the Control Panel.

After finding that the Control Panel applet is run using bthprops.cpl I thought I could just use that directly. However, running bthprops.cpl didn’t actually do anything. So after more searching on the internet, there were more people found with similar problems of having the Bluetooth Control Panel applet simply not doing anything. Some people uninstalled the original bluetooth drivers and then had Windows install the new drivers and everything worked. Not for me though, unfortunately. Even updating the driver through the Device Manager didn’t seem to do anything because Windows Update couldn’t find any more up-to-date drivers.

Anyway, it’s all working fine now after I went to HP to explicitely download the latest drivers from Support Software for Bluetooth by HP. 20 odd Mb to download though, but at least the problem has gone away. Hooray!

If you are having problems with bluetooth not showing up in the Windows Control Panel then I suggest trying to download the latest drivers for your bluetooth device to ensure they are compatible with Windows XP SP2.

 

Using Rsync to backup files

Sunday, July 17th, 2005

Rsync is an open source utility that provides fast incremental file transfer. Rsync uses the Rsync algorithm which provides a very fast method for synchronizing remote files. It does this by sending just the differences in the files.Rsync is developed by the same folk that constructed Samba, which provides file and print services to all manner of SMB/CIFS clients, including the numerous versions of Microsoft Windows operating systems (whilst quietly beating the pants off the native Windows implementation in terms of transfer rate).

I’ve been looking for a decent file backup mechanism for some time. The Windows Backup Utility is hopeless to use and is slow as pies. Rsync provides a relatively easy way to quickly backup and archive files. Below are the steps to follow to get yourself to the point where you can easily synchronize files.

  1. Download cwRsync from cwRsync - General
  2. Install cwRsync according to the instructions on the web page above.
  3. Append the bin directory of the installed location of cwRsync (something like C:\Program Files\cwRsyncServer\bin) to your PATH environment variable (so rsync is available on the command line)
  4. Create a mapped network drive to the machine containing the files that need to be backed up, or backed up to.
  5. Read the man pages for Rsync to understand what options are available when using rsync.

Next you need to test on something non-critical to make sure rsync is working.

  1. Create a folder on your C:\ drive called Test.
  2. Put some files into it.
  3. Create a folder on your C:\ drive called Backup.
  4. Open a DOS prompt
  5. Test a backup using the rsync command line tool.
    rsync /cygdrive/c/Test /cygdrive/c/Backup

    This will copy the contents of C:\Test to C:\Backup\Test.

Note the syntax that is used to map between the name of the drive as far as rsync is concerned and your actual file system according to Windows. /cygdrive/ is treated as being at the same level as My Computer.

C:\
/cygdrive/c
C:\Test
/cygdrive/c/Test
D:\
/cygdrive/d
D:\Multimedia Files
‘/cygdrive/d/Multimedia Files’ (note that quotes are needed if there is a space in the filename)

The only thing left to do is to determine what options to use. I am using the options -Cavz for all the file synchronization I am doing.

-C
auto-ignore files the same way that CVS does.
-a
archive mode - recurse into directories, copy symlinks as symlinks (not relevant on Windows), preserve permissions, preserve times, preserve group, preserve owner, preserve devices (not relevant on Windows).
-v
increase verbosity
-z
compress file data during transfer.

For example:

rsync -Cavz /cygdrive/y/Shelly /cygdrive/z

This copies all of the data from the Shelly share underneath my mapped network drive (Y:\) to my Z:\ (Backup) drive. If necessary you could easily create a .bat file to do multiple drives and then schedule it using the Windows Scheduler. This is much easier than doing a Backup with Windows Backup and it’s also much faster.

Depending on what software and hardware you have you can probably also use Rsync to work with a RW CD or DVD drive since it only updates files that have actually changed.