AnalogClock






Showing posts with label firewire. Show all posts
Showing posts with label firewire. Show all posts

Friday, June 6, 2008

My Working MythTV Firewire Fix

Updated post 6/6/2008 - And now it is tested and working

I finally found a working failsafe fix for my MythTV FireWire setup that doesn't require manual intervention to keep MythTV up and running. In the MythTV startup script I repeatedly unload and reload the 1394 modules and then test to determine if the the firewire is working by checking for errors from my external channel changing program..

I changed the following block in /etc/init.d/mythtv-backend

su - $USER -c "/usr/bin/mythprime"

to this

#until { su - $USER -c "/usr/bin/mythprime"|grep '1\ stbs\ primed'; };do
while sa3250ch 1 2>&1 | grep oops;do
modprobe -r dv1394
modprobe -r video1394
modprobe -r raw1394
modprobe -r ohci1394
modprobe -r ieee1394
modprobe raw1394
/bin/sleep 1
done
#done

I had to less +F /var/log/mythtv/mythbackend.log. So I could turn off then on the cable box using the power button when the MythTV backend was recording a show. Nothing else seemed to get the video data flowing. After getting the initial recording going it seems to work fine with later recordings. Without the need for manual intervention. I commented out my cron scripts as the latest version of MythTV seems much more robust and the cronjobs only created confusion when there is a problem that requires intervention.

In my search for a completely automated solution I ended up changing the driver for my Time Warner supplied SA3250HD firewire to use a 100Mbps connection.

This is the third fourth fifth update to the details of my working MythTV firewire setup. If I have any more updates I'll make a new postcontinue to update this post. Looks good so far.It's working again.

Latest change changed again:
I have changed my channel changing binary to a scripted frontend. I renamed the binary to sa3250ch.bin and made a /usr/local/bin/sa3250ch script like so. I commented out what it used to do. Just changing the channel and letting the channel changes fail and miss recordings is fine. When I find the time to find a channel changing script for the SA3250 using p2p I will post it here.:

#!/bin/bash

#/usr/local/bin/sa3250ch.bin 1
#/usr/local/bin/sa3250ch.bin 1
#/bin/sleep 1
/usr/local/bin/sa3250ch.bin $1
#/bin/sleep 2

Sunday, April 20, 2008

Migration to MythTV 0.21

I decided to upgrade my MythTV setup to version 0.21, the new release. I had taken my MythTV setup off-line last September to wait out the free scheduling shakeout. Turns out the guys of MythTV at Schedules Direct have stayed true to their word and the price of a yearly subscription has dropped to $20 a year and it can support many other DVR platforms. Allowing for an easy exit strategy if I decide there is a better free DVR. Which I haven't. Even though I took a good look at what the competition had to offer before I performed the 0.21 upgrade.

I had a little trouble getting MythTV working with my Time Warner digital cable box using the firewire connection. I was a little skeptical of the advice given in the wiki about MythTV being incompatible with the firewire modules of kernel 2.6.21 or later because of changes to the modules. The proposed solution to this "problem" was to change the makefile for the 2.6.21 or greater source and recompile the modules. After playing around with the firewire off and on over a period of two weeks I found the real source of the problem. The raw1394 and video1394 kernel modules were not being loaded automatically on my Ubuntu box. A quick couple of modprobes later and everything was working fine. Although I find I have to change to channel 1 after changing channels with the cable box remote to get video recording again. I also had to use an external channel changing program instead of the built in one.

I like the new robustness of the firewire connection. I was previously unable to change channels while they were being recorded using the cable remote without crashing MythTV. Now I can check the mythbackend.log file and if I see repeated unable to get video errors I simply change the channel to 1 then back to the previous channel to fix the problem. No stopping and starting MythTV over and over. And no firewire priming scripts! :) I still have my originals but they are definitely unnecessary. In fact I replaced the mythprime program that comes with 0.21 with a simple script the resets the firewire by first unloading and then the reloading the firewire module stack.

I had bought a FreeAgent USB 500GB external drive a while back and had resorted to the never spin-down method of keeping the drive from going off-line forever after spinning down. I had noticed recently that the drive was staring to get louder. But it is not as loud as some other drives I have set to never spin down. I decided to look for a solution to the FreeAgent USB spin-down that didn't involve burning up the drive and making it unreasonably loud. Luckily it had been months since I had looked for a solution and things had improved. I found a perfect and elegant solution here. It reduces the problem to a udev local rule file that sets the allow_restart attribute through the sys file system. Excellent solution! :) I'm impressed! ;)

That completes the upgrade on my MythTV backend. My MythTV backend is not powerful enough to record and display and play at a reasonable frame rate. At least not with the video card on the motherboard the last time I checked. I need to revisit using the backend as an all in one box after performing some tests and potentially adding a more powerful video card or switching to a more powerful machine and giving up on the PCI only small form factor box I'm using. I have a dual processor Pentium 3 motherboard with AGP and a Radeon 9700 that shouldn't have any problems delivering better performance than the Pentium 3 MythTV backend I'm currently using.

I've become extremely sensitive to the volume of noise produced by my computers and DVR. I originaly assumed most of the noise was coming from the fans. Turns out the most egregious sounds were being generated by loud drives that had become loud from never spinning down. My MythTV frontend is a Thinkpad notebook with a slightly loud hard drive.

I replaced the hard drive and use laptop_mode and a 30 second spin-down timer to keep the currently tested as quiet replacement notebook drive from getting as loud as the notebook drive it is replacing. Note to anybody that is reading this: notebook drives are not meant to run continously. They are designed to be spun down many more times that desktop drives. Notebook drives also have a much shorter spinned up life span. I wish I had done my research before I destroyed all those drives over the years! ;

More to come.

Update:

I using one of my Wiimotes as a bluetooth remote and loving it. The Wiimote has easily replaced my completely lame Sony T610 bluetooth phone hack as a remote setup that I was using before the rebuild.