MythTV / MythDVD movie ripping / playback problem (Solved!)

I have used Myth to rip a large number of my DVD's to AVI files (using either the Excellent or Good setting).  Now that I am starting to play back the movies, I have found something that is very troubling.

On many of the movies, the first 95% of the movie (e.g. 1:13 min of a 1:26 movie) plays flawlessly. However, near the end of the movie, the audio and video starts to speed up and get jerky. (Audio/video sync is also thrown off.) Continue reading

Connecting to non-broadcasting SSID networks with IPW2200

I have been having problems connecting to a wireless network that does not broadcast its  SSID. (A so-called "hidden" network.) I am using an Intel IPW 2200 802.11b/g mini-pci wireless card that uses the ipw2200 wireless module.

I found that reloading the ipw2200 module before attempting to connect to the network fixed my problems (but only if I put a pause between the unload/load/connect sequence).  I use wifi-radar to manage my wireless connections, and was able to call my unload/reload script using its "before" connection command.

The script is simply:

sudo rmmod ipw2200
sleep 1
sudo modprobe ipw2200
sleep 1 

This does add two seconds to the connection time, but this is not a terrible penalty to pay as without the above pause the connection would usually only work about 25% of the time. 

DPMS monitor control via remote control on Myth TV

I am using an LCD monitor as the display for my MythTV box, connected via an analog RGB (a.k.a. VGA) cable. This allows me to use DPMS (Display Power Management Signaling) to turn the monitor on and off from the MythTV box.

Instructions for setting this up with MythTV are here , but I found that I had to make a few changes to get things to work correctly. I modified one line of the shell script  as follows:

STATUS=$( xset -q | grep "Monitor is" | awk '{print $3}' )

To trigger the monitorpowerbutton.sh script, I placed the following into my /etc/lirc/lircrc file:

begin
 prog =  irexec
 button = TV_POWER
 repeat = 4
 config = /usr/local/bin/monitorpowerbutton.sh
end

Now my TV_POWER button toggles the power state of the monitor! 

Fixing a missing bluetooth icon, battery charge indicator, and update notifier in Ubuntu

Notification Icons

For the last week my battery indicator and bluetooth icons had been missing from my top panel in Ubuntu. When I did Bluetooth stuff the pop-up "speaker balloons" from the bluetooth applet would still appear at the corner of my screen, but the Bluetooth applet itself was "invisible". I finally figured out that what I was missing was a "Notification Area" for these applets to "live". Right-Clicking on the Panel, Selecting "Add to Panel" and then adding the "Notifcation Area" (from the Utilities category) fixed my problems. Indeed, I then found out that the Software Update notification icon had been trying to tell me about software updates, but I hadn't seen it, so I had to install several software updates!

Phillips Webcam with Linux

I bought three Phillips SPC  900 NC webcams because they claim to support up to 90fps and I have had good luck using linux with the PWC drivers in the past.  Plugged into a generic Ubuntu 7.10 install, I found that 640×480 resolution was automatic, with 15fps. 320×240 worked at 30fps. (I tried 160×120 resolution, but wasn't able to get a speed faster than 26fps with that, so I'm doubtful of the 90fps claim from Phillips, at least with the stock Ubuntu drivers.)

This useful website looks to provide nice OpenCV support for this camera. 

I have also archived the relevant files on my site, in case the above link goes down. 

Webcam to OpenCV package

Webcam software manual

Fixing Program Guide data on MythTV after Daylight Savings Time switch

I'm running MythTV (Subversion Trunk) on a Ubuntu 7.10 box. After the daylight savings time changeover, my mythtv box had the correct time, but the Program Guide data was still off by an hour.  Manually running a mythfilldatabase didn't fix it. After checking to make sure that my timezone xmltv settings were set to Auto, I decided to manually erase all of the program data from the database.

(After using mysql to connect to the database, I issued the "delete from program;" command to delete all of the program entries.)

Then I re-ran mythfilldatabase and everything was fixed. (I still don't understand why this didn't automatically fix itself when the ubuntu box changed it's timezone, as all of the program data is supposed to be stored under UTC…)

Mythtv gotchas when upgrading from Ubuntu 7.04 (Feisty) to 7.10 (Gutsy)

I upgraded my Mythtv server from Feisty to Gutsy for no good reason (other than I like the pain).

Gotchas I ran into when trying to get MythTV working again:

1. The upgrade lost/removed the libqt3-mysql support from my computer. This resulted in the MythTV applications (frontend and backend) giving "unable to connect to database" errors. As the upgrade had also upgraded my MySQL install, I spent a good amount of time checking that the mythtv user still existed and had the proper permissions before I figured out it was a QT database library problem.
  apt-get install libqt3-mt-mysql fixed it.

2. LIRCD stopped receiving commands from my HDHomeRun receiver from SiliconDust. Turns out you have to change the LIRCD_ARGS="-d 5000" line in the /etc/lirc/hardware.conf file to LIRCD_ARGS="-H udp -d 5000".  After this, typing irw showed that LIRCD was now receiving the command codes as it was supposed to.

3. The module name for my D-Link GWL-G122 usb wifi-adaptor have changed, so I had to change entry in the /etc/modprobe.d/blacklist  file to reflect the new name(s) of: rt2x00usb and rt2500usb.

On the fly external monitor support (mirroring / spanning) on Ubuntu 7.10

My IBM X31 laptop has the capability to drive an external VGA monitor in addition to it's built in XGA (1024×768) Laptop Video Display Screen (LVDS). The new xrandr extension allows non-privlidged users to change monitor layouts on-the-fly. And now, thanks to my friend Tracy, I know the "extra magic" to make it all work.

Continue reading

Tuning an ext3 filesystem for storing large media files

I added a new hard disk to my MythTV box, specifically for storing movies copied from my DVD collection. Because this disk will be used for storing mostly files that will be in the 1-4GB size range, and because it is NOT going to be used as the root (/) drive of this computer, I set the sparse_super and largefile4 settings, plus reserved zero space for the superuser (-m 0) with the following command:

 
mkfs -t ext3 -m 0 -O sparse_super -T largefile4 /dev/sdb1

MythTV to phone (.3gp) transcoder script and Bluetooth transfer

I built a perl script that can be used as a "User Job" from within mythtv to convert a recorded TV program into a cell phone (.3gp) movie. It makes uses of mythname.pl to get the show and title (for the filename) and mplayer/mencoder and ffmpeg to do the actual transcoding.

Unless you want to drop your files off in the /var/lib/mythtv/for_phone directory, you will need to edit the output directory.  I've found that 35 minutes of TV gets shrunken down to 24-30megs when in .3gp format when transcoded at a generous 80/16 (video/audio bitrate).

Script to transcode from mythtv files to .3gp files

I wrote a second script to transfer any files in this directory to my phone via bluetooth OBEX push every night. I use cron to start the phoneTransfer.pl script up each night, and it looks for any .3gp files in the directory and tries to copy them to my phone. If successful, it removes them from the directory.  Note that my Motorola V3xx has an annoying feature where it will receive OBEX bluetooth files into phone memory, and NOT to the default download location (which can be set to the memory card). If your phone is similar, you will have to copy files from the phone's memory to the memory card so that your phone's memory doesn't get full. If your phone's memory gets full, it will refuse further bluetooth transfers until you move the files over to a memory card. 

Script that does a bluetooth transfer to phone

Note that to use this script you will have to find your phone's bluetooth mac address (using "hcitool scan") and put it in the script. Also, you should pair your phone with your computer, and set your phone up to automatically accept OBEX push/FTP transfers unless you want to manually approve each video transfer.