Menu Content/Inhalt
Home
MythTv with Firewire Video and Channel Changing PDF Print E-mail
Written by Justin Furniss   
Sunday, 12 March 2006
After several long nights, as is always the case with MythTv, I bealive that I have finally figured it out.

In this article I will attempt to put together a decent HOW-TO for you firewire hungry mythtv folks out there.
This is far from my first battle with the great MythTv, in fact I have built several multi-tiered installations for family and helped some friends build some cool ones too.  

Since the advent of Jarod's MythTv HOW-TO, mything has gotten a lot easier especially since RPM packages will do most of the work for you.  I had known for some time that Myth supports firewire input and for some specific cables boxes, channel changing over that same firewire connection.  Right before realse 0.19 i went to my cable provider (Comcast) and asked them to give me some HD boxes, which I knew would be the Scientific Atlanta 3250HD box.  The 3250 was supported for capture over firewire but at the time the only way that a basic myth install would let you change channels is over an IRBlaster device.  Around 12am on my first night of setting everything up I finally got the video capture working and then caught a glimpse somewhere about 0.19 just coming out.  A quick scan through the release notes revealed that it now has support for channel change over firewire as well.  SWEET!!!

Firewire Channel Changing with the SA 3250 HD


I waited for a few days for the new version to be available for an easy installation and did the upgrade.  To make an even longer story short, the channel changing application was working--just not as expected.  When myth wanted to go to channel 110 it would send a wild array of numbers over the LED display on the 3250 then almost always rest on channel 52 (I have seen alot of people say channel 7 as well).  All the googling I could handle got me nowhere so I hit up the #mythtv-users channel on freenode.  No one there knew what I was talking about so I googled for a few more hours and found the root of the problem.

There is a C application that MythTv 0.19 contains which does the channel changing, sa3250.c.  It turned out, after another 2 days of on and off googling that I had to modify that code to acheive the desired result.  The line that contains:

cmd[1] = CTL_CMD1 | (dig[0] << 16) | (dig[1] << 8) | dig[2];
Had to be changed to:

cmd[1] = CTL_CMD1 | (chn << 8);
I made the change and it worked!!!  To save you some time or if you just dont feel comfortable modifying / compiling code you can download the source and the compiled binary from me here.

Once I compiled the code I had to put it somewhere convient for Myth and myself.

# cp sa3250ch /usr/local/bin/
# chmod a+x /usr/local/bin/sa3250ch
Since /usr/local/bin/ is in my patch I can now call the channel change command from anywhere.  To test it out:

#sa3250ch -v 110
As long as that worked then you are pretty good to go.  Now we just need to tell Myth to use our new app.  Go into the mythtvsetup application and set the change channel command to /usr/local/bin/sa3250ch.  It is also important to give it a valid starting channel.  When playing around, I found that if i tune it to either a channel I don't pay for or an OnDemand channel it takes a dump.  It is best to just remove them from your lineup in the mythtvsetup application.

Initializing the Firewire Ports at Boot


After the channel changing issue I had to deal with another issue which had plagued my system.  For some reason, everytime I would reboot the system I would need to turn off the cable box then turn it back on.  It was getting to be a pain and something needed to be done.  I googled around a bit and found an exteremely helpful page on the myth wiki.

So that the commands listed on that page are issued everytime the machine reboots, it put it in the /etc/rc5.d/S99local file.  This is the file where you can put just about any stray commands that need to be run at boot time.  It is important to note that this is a hack and I should really create a new file.  Etiherway,  my file now looks like this:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/bin/mknod /dev/raw1394 c 171 0
plugctl -n 0 oPCR[0].data_rate=2
plugctl -n 0 oPCR[0].n_p2p_connections=0
plugctl -n 0 oPCR[0].bcast_channel=63
plugctl -n 0 oPCR[0].bcast_connection=1

plugctl -n 3 oPCR[0].data_rate=2
plugctl -n 3 oPCR[0].n_p2p_connections=1
plugctl -n 3 oPCR[0].bcast_channel=0
plugctl -n 3 oPCR[0].bcast_connection=0
I hope this helps someone out there.  If there are any additions to be made please email me at primeobsession AhT gmail DOhT com.







Last Updated ( Wednesday, 16 May 2007 )