Mailing List Archive

SA3250HD Firewire -- A New User's Findings
(part one - the zero-file-length issue)

Hello, all.

I built my first MythTV box about three weeks ago, and have it working
pretty well. In fact, my only significant problems at this stage are
with the firewire capture from the two Scientific Atlanta 3250HD cable
decoders I rent from Time Warner Cable in Manhattan. This is the first
of three emails I will post to this list describing the problems I've
overcome, and those I've failed to overcome (so far). Though I am quite
new to the MythTV community, I've been reading the mailing list and
combing its archives these last few weeks, so I'm pretty sure that the
information I have to share here will be of value to other MythTV users
with similar problems. There's certainly alot of discussion of this
cable box going on here all the time.

This first email will talk about the "zero file length" capture problem
that plagues so many users of this decoder. The second email will
present a peculiar problem with a two-decoder setup which involves
recording from the higher-numbered firewire node only. And finally, the
last email will describe my experiences setting up independent channel
control of the two decoders. Also in the third email will be a summary
of the hardware and software details of the system on which these
results were produced.

Now, on to the "zero file length" problem. A thorough search of this
mailing list's archives will show that most SA3250HD users encounter
this problem a lot at first, then gradually learn to minimize, and
sometimes eliminate the problem of receiving a zero-byte recording from
this decoder's the firewire port. On the other hand, it seems many users
give up and go back to analog input instead. Most users report that
their SA3250HDs go in and out of the "no-data state" on an infrequent
basis; that is, it works for days at a time, and then stops working
until manual intervention is required to fix the problem. My experience
has so far been this exactly. Through trial and error, I've found a
software-only process to restore the decoder to working condition about
95% of the time. But about one time in twenty, this process will fail,
and a reboot of the cable box is required (press and hold the power
button for 5 seconds).

Before I describe the almost-fix that I've been using, let me first list
the conditions known to cause this zero-byte stream problem:
#1) Tuning the 3250 to a 5C-encrypted channel. Some users report that
after doing this, they have to reset the cable box. But with my system,
I just have to tune to a clear channel and reset the bus; and sometimes
even the bus reset isn't required -- I just tune back to a clear channel
and the stream is restored.
#2) Tuning to a channel which you have not subscribed to, encrypted or
not. If I do this, I always have to go through my software-only fixing
process, and sometimes I have to reboot the cable box first. :(

Now, here is the process that restores either of my SA3250s to working
condition about 95% of the time...

First, a test to determine whether a firewire bus reset is required. I
use the excellent firewire_tester program, compiled from
/usr/share/doc/mythtv-0.20/contrib, according to its README. I invoke it
like this:
firewire_tester -vp -P [port] -n [node] -r 4
On my setup, if this command fails after the tuner has been stable for
about 2 seconds, there's a 100% chance I'll get a zero-length file from
that device using test-mpeg2, and that Mythbackend will report "No input
after 15 seconds". Conversely, if the above command succeeds, I've
gotten good data from the decoder about 95% of the time (sample size is
still <100 recordings, though). So that's the test that works best for me.

The second thing that's needed is a way to (sometimes) get rid of this
problematic condition. Once again following the advice of those who have
gone before, I tried tuning to a known "Clear Channel" (use a broadcast
network) and then resetting the firewire bus in question. For me, the
reset command is:
firewire_tester -v -P [port] -n [node] -R
This command always reports success, but works to restore input only
about 75% of the time. However, that means if I do it several times
until the preceding test is passed (with a small delay in between
resets), I can get rid of the problem within "a few" tries "most of the
time" (like my math?). So my channel-changing logic is:
* Test the connection with the tester. If it works, just tune to the
desired channel
* If it doesn't work, tune to the known clear channel, then reset the
bus until it does
* However, give up after N bus-reset attempts (currently set at 3).

And here's my channel-changing script, which expresses the that logic.
As mentioned above, it depends on the presence of the firewire_tester
program. For my setup, it also depends on a slightly-enhanced version of
the sa3250ch channel-changing program from Myth CVS -- basically I just
added support for -p [port] and -n [node], so that I could control my
two decoders independently.

* Source code for the modified sa3250ch channel changer:
http://bentonroberts.com/personal/media-server/code/sa3250ch-BR.c

* Tuner shell script invoked from MythTV, which calls sa3250ch with the
-p parameter:
http://bentonroberts.com/personal/media-server/code/mySA3250change.sh

* Here's a similar script, which tries to find working channels on a
SA3250HD, using the same algorithm:
http://bentonroberts.com/personal/media-server/code/walkSA3250channels.sh

While directly monitoring the output signal from my SA3250HD as this
list third script runs, and examining the script's output, I learned
alot about which channels I can get in the clear. The unexpectedly happy
answer: everything that I've paid for (though that's basic cable only),
including HD. However, I've been unable to record at least one of the HD
channels at all through MythTV (Discovery HD Theater), even though I've
recorded two straight minutes of this channel using the above
walkSA3250channels script. I will report more data on this issue in a
future "Time-Warner Manhattan" thread.

So, that's how I got "pretty reliable" firewire output from ONE of my
two SA3250s. Your comments, questions, and advice are welcome.
Especially since, unlike the next two emails in this thread, the
problems raised in this message are so far unresolved. Particularly
valuable would be any suggestions on debugging methodology. I've made a
spreadsheet to track failed recordings by time, channel, previous
channel, encoder, and a few other fields, but no obvious correlations
have jumped out at me yet. Anyone here ever apply a firewire protocol
analyzer, or some other reverse-engineering tool, to this problem?
Thanks in advance for your collective wisdom.

Next up in "SA3250HD Firewire -- A New User's Findings": my problems
with adding the second decoder.

- benton



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
I am very interested to hear how you got the second cable box working. I
have one working very reliably but I have had no luck getting a second one
working with myth.

Allan
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
On 4/28/07, Benton Roberts <benton@panix.com> wrote:
>
>
> This first email will talk about the "zero file length" capture problem
> that plagues so many users of this decoder. The second email will
> present a peculiar problem with a two-decoder setup which involves
> recording from the higher-numbered firewire node only. And finally, the
> last email will describe my experiences setting up independent channel
> control of the two decoders. Also in the third email will be a summary
> of the hardware and software details of the system on which these
> results were produced.


Benton,
Thanks for the good write-up and enhanced channel-changing scripts. I hope
to give them a whirl in the next few days and I look forward to your other
emails. :)

/Brian/
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
(part two - a tale of crossed signals)

Hello again, everyone.

This follow-up to my initial post in this thread describes two
possibly-related conditions which initially prevented me from recording
from my second cable box, whether simultaneously or not. The first
condition is when both boxes are on the same firewire bus (same port,
different nodes), and the second is when they're on different firewire
buses (different ports, same node).

First, the setup with both SA3250HDs on the same firewire bus,
designated port 0. One decoder is assigned to node 0, and the other is
node 1. For some reason, the firewire bus on my Asus M2NPV motherboard
assigns the node IDs starting from the device that's *farthest* from the
motherboard on the chain. This means that if I attach one just cable
box, it gets assigned node 0, but if I then loop my second cable box off
the first, the IDs get reassigned so that the second cable box takes
over node 0, and the first cable box becomes node 1. This can really
mess you up when you're debugging, or when the backend is running. The
moral of the story? Don't do that! ;)

In fact, I have been completely unable to get a good stream from the
second SA3250 in this configuration. Why? I think it's because the command
plugctl -n 1 oPCR[0].channel=1
Does not seem to have any effect on either of my cable boxes. Based on
the firewire pages in the Myth Wiki, I'm pretty sure this command is
required to get different decoders working on the same bus, so that
their packet streams don't get mixed up. Right after I run the above
'set' command, I can run the equivalent 'get' command, and verify that
the setting has not taken:
================================================
[root@media ~]# plugctl -n 0 oPCR[0].channel
0
================================================
It's still on channel zero! I can't seem to set either node to any
channel other than zero. The result is that when trying to record from
node 1 with "mpeg2-test -r 1 > file.mpg", the file gets filled with a
broken-up version of the packet stream from node 0. It sometimes plays
in mplayer, sometimes doesn't, but what little you can see is clearly
coming from node 0, not node 1. I'm pretty sure the overlapping channel
is responsible for this, but have no idea how to correct this. Anyone?

Finally, I don't think chaining SA3250s this way is a good idea anyway,
because in my experience (see previous email) you have to reset the
entire firewire bus periodically, just to fix one box. So when a bus
reset is required for a non-working box while the the *working* box is
recording, bad things happen to the recording. :(


OK, on to the second setup, then. Here I use the two decoders on two
different firewire buses, port 0 and port 1 (both cable boxes take node
number 0 in this configuration). In my backend system, the first port is
on the motherboard and the second is an add-in PCI card (see next email
for specs). This configuration fails the test-mpeg2 test, but works fine
with MythTV in practice. It seems there's a command-line processing bug
in test-mpeg2...

When I issue the command
test-mpeg2 -p 1 -r 0
the system reads data from my PCs firewire port 0, instead of firewire
port 1 as requested. Every time, a perfect capture, exactly as if I had
issued
test-mpeg2 -p 0 -r 0
instead. If I turn off the cable box attached to port 0, the capture
fails, naturally. Here's some further evidence for non-standard
command-line processing code in test-mpeg2: while the command
"test-mpeg2 -p 0 -r 0" works fine, the equally-valid command "test-mpeg2
-r 0 -p 0" fails, with an arguments error. Bleh!

Anyway, the bottom line is this: my advice to anyone using twin SA3250s
is to put them on separate firewire buses! I hope this will save someone
the vexing hours I spent acquiring this information. Once again, your
input and experiences are gratefully appreciated...

- benton

P.S. Next up, the third and final episode in the now-much-hated series
of rants, "SA3250HD Firewire -- A New User's Findings"

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
(part three - The Old Man and the C)

Hi, Mythologists.

This third part of "SA3250HD Firewire -- A New User's Findings"
addresses the issue of independently controlling two different SA3250s
using the firewire connection. I also give the hardware and software
specs for the combination front/backend computer on which the issues
raised in this thread were documented.

OK, as of April 2007, the sa3250ch channel changing script on
cvs.myththv.org does not support multiple SA3250s. It just iterates over
the all devices on firewire port zero, until it finds one that matches
one of it's known SA3250 hardware IDs, then sends that device the
commands. So I dusted off my C, and added the [-p PORT] and [-n NODE]
settings to this tool. Now it works fine for independently controlling
my two SA3250s, whether they're on the same bus, or on different ones.
Should I submit this improvement to contrib, MythTV project leaders?

Source code for the modified sa3250ch channel changer:
http://bentonroberts.com/personal/media-server/code/sa3250ch-BR.c


And finally, for the reference purposes of those interested in the many
issues raised in this thread (or for the teminally nerdy), here are the
specs for my first Myth system:

HARDWARE TABLE:
Component Manufacturer/Model Detail
---------------------------------------------------------------
Case Silverstone SG01-BW 4 rear slot panels
Power supply Silverstone ST50EF-Plus Full ATX
Heat sink Silverstone NT06-LITE Cools CPU with PS fan
Motherboard ASUS M2NPV-VM Socket AM2 SATA RAID
Processor AMD Athlon 64 X2 3800+ Windsor 2.0GHz Dual-core
RAM Kingston ValueRAM 1GB (2 x 512MB) DDR2 800
Hard disks WDigital Caviar SE16 WD2500KS 2 x 250GB SATA
Analog A/V input Hauppauge PVR-500 1 PCI slot, 2 analog encoders
Optical drive LITE-ON 20X DVD+R 8X dual-layer dvd+/-r(w)
Extra firewire CompUSA PCI 1394 (P/N:274516) VT6306 chipset
Card reader nMediaPC ZE-C38 universal memory-card reader
KB / mouse Logitech Cordless Desktop EX110
IR control CommandIR Mini up to 4 emitters

SOFTWARE TABLE:
Function Product / Package Version
---------------------------------------------------------------
OS Fedora-base 6
kernel + firewire Fedora-base 2.6.20-1.2933.fc6
firewire video Fedora libiec61883 1.1.0-1.fc6
MythTV ATrpms mythtv-suite 0.20-154.fc6.at


Conclusion:
Well, that's all for this epic missive. I hope it will be helpful to
many other new users, and of course I hope that someone out there will
have both the patience to read all this, and the knowledge to help me
(and all those others) along the way to media nirvana.

Happy hacking!
- benton




_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
I have a side question about the 1394 cable service....

Are you able to access premium channels with MythTv and firewire?

Dale
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
d-larson wrote:
> Are you able to access premium channels with
> MythTv and firewire?

I can't answer this definitively, because I don't pay for the premium
channels. However, I think it's likely that those who do pay for them
can indeed read them over firewire, and here's why:

For the first 48 hours or so after I traded in my Time-Warner-supplied
dual-tuner SA8300HD DVR for two SA3250HDs, the HBO-HD channel was coming
in clear, even though I had not paid for it. (I've head similar "free
preview period" stories from other users, after they changed or renewed
their digital TV service packages.) During that time, I was indeed able
to record a short segment (about 90 seconds) from HBO-HD. So I think
it's likely that you would be able to.

On the other hand, as reported previously in this thread, I am for some
reason unable to record the series "Planet Earth" on Discovery HD, even
though the channel is free with digital HD service, and even though I
*can* record from the channel at least some of the time. This leads me
to believe that for some channels, the 5C encryption can actually be
turned on or off on a program-by-program basis? Can anyone here verify
or debunk that?

I will try to post a (hopefully) comprehensive list of which basic cable
channels come in clear over Time-Warner Cable of Manhattan's
firewire-enabled 3250s some time in the next week.

- benton
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
Benton Roberts wrote:
> The second thing that's needed is a way to (sometimes) get rid of this
> problematic condition. Once again following the advice of those who have
> gone before, I tried tuning to a known "Clear Channel" (use a broadcast
> network) and then resetting the firewire bus in question. For me, the
> reset command is:
> firewire_tester -v -P [port] -n [node] -R
>
Are you using Broadcast or P2P? Have you tried
firewire_tester -P [port] -n [node] -B

This is a 100% reliable indicator if my recordings will work - mind you
I'm using a Motorola 6200.

Thanks for giving back - well documented user experiences are always
helpful!

Greg
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
Hi Benton,

>> Are you able to access premium channels with
>> MythTv and firewire?
>
>I can't answer this definitively, because I don't pay for the premium
>channels. However, I think it's likely that those who do pay for them
>can indeed read them over firewire, and here's why:
>:
>:
>On the other hand, as reported previously in this thread, I am for some
>reason unable to record the series "Planet Earth" on Discovery HD, even
>:
>turned on or off on a program-by-program basis? Can anyone here verify
>or debunk that?

I'm currently using an AirStar-HD5000AV to handle digital. When I scanned
my Time Warner cable (Milwaukee) I didn't get a hit on Discovery channel.
If you happen to find a time they are reproducibly unencrypted please let
us know. I can then run a scan to find its frequency and service ID. It
would be real nice to record this series.

>I will try to post a (hopefully) comprehensive list of which basic cable
>channels come in clear over Time-Warner Cable of Manhattan's
>firewire-enabled 3250s some time in the next week.

I'm certainly looking forward to seeing that post!

Dale
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
On 4/29/07, Greg Mitchell <greg@nodecam.com> wrote:
> Benton Roberts wrote:
> > The second thing that's needed is a way to (sometimes) get rid of this
> > problematic condition. Once again following the advice of those who have
> > gone before, I tried tuning to a known "Clear Channel" (use a broadcast
> > network) and then resetting the firewire bus in question. For me, the
> > reset command is:
> > firewire_tester -v -P [port] -n [node] -R
> >
> Are you using Broadcast or P2P? Have you tried
> firewire_tester -P [port] -n [node] -B
>
> This is a 100% reliable indicator if my recordings will work - mind you
> I'm using a Motorola 6200.
>
> Thanks for giving back - well documented user experiences are always
> helpful!

to add to what Greg said, from what I understand digital video from
cable boxes over firewire are supposed to be broadcast.

Also, are you running SVN? There are some big improvements in firewire
recording in SVN. I currently have two daisy-chained Motorola DCT
boxes on my back
end running SVN and haven't had any issues (with the bus reset code enabled).
--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
Good to hear someone got two 3250's going. I'll have to give it a go again
this week and see if I can have any luck. Thanks for the in depth summaries.

Allan
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
On 4/28/07, Benton Roberts <benton@panix.com> wrote:
>
> <snip> So I dusted off my C, and added the [-p PORT] and [-n NODE]
>
settings to this tool. Now it works fine for independently controlling
> my two SA3250s, whether they're on the same bus, or on different ones.
> Should I submit this improvement to contrib, MythTV project leaders?


If I were you, I would submit this via a ticket.

Source code for the modified sa3250ch channel changer:
> http://bentonroberts.com/personal/media-server/code/sa3250ch-BR.c
> <snip>
> MythTV ATrpms mythtv-suite 0.20-154.fc6.at


A couple of weeks ago, I read through the SVN logs for the differences
between 0.20 and 0.21 wrt. firewire and the changes are significant. I
would recommend you try ATrpms-bleeding mythtv-suite if you still experience
firewire issues.

/Brian/
Re: SA3250HD Firewire -- A New User's Findings [ In reply to ]
On 4/28/07, Benton Roberts <benton@panix.com> wrote:
> (part one - the zero-file-length issue)
> <snip>
> * Source code for the modified sa3250ch channel changer:
> http://bentonroberts.com/personal/media-server/code/sa3250ch-BR.c
>
> * Tuner shell script invoked from MythTV, which calls sa3250ch with the
> -p parameter:
> http://bentonroberts.com/personal/media-server/code/mySA3250change.sh

Benton,
I finally had a chance to put your modified sa3250ch-BR into action
last night even though I'm running Myth SVN (atrpms-bleeding). I set
up your mySA3250change.sh as the external channel changer after some
manual test runs. I ended up copying the "reset bus" loop into the
bottom section where you set the new channel and then test that it
worked. I found that sometimes it would get through the first loop
after setting the channel to a known-clear channel, then reset the bus
and firewire_tester would work. Then it would change the channel,
firewire_tester would fail and it would exit.

Before doing this, I removed all tuners and added Firewire first (both
3250's); then I added my PVR-500 tuners. When I try to watch TV,
nothing displays except the OSD for a few seconds and it says "Lock".
Before using your channel changing script, I would only get "Partial
Lock".

I hope to narrow down the video problems further, but thanks for the
nice scripts.

/Brian/
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users