[mythtv-users] Seeking PVR-150 / channel change script backend contention advice

auric auric at aanet.com.au
Sat Jan 15 03:05:19 UTC 2011


> Date: Thu, 13 Jan 2011 12:52:25 -0500
> From: Joe Hickey <jfwd at phlobus.net>
> Subject: [mythtv-users] Seeking PVR-150 / channel change script /
> 	backend	contention advice
> To: Discussion about mythtv <mythtv-users at mythtv.org>
> Message-ID:
> 	<AANLkTi=nxqGDgpO1RJTtcvvoDzPFkg65e5S814bTb2LB at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi all,
> 
> I'm hoping to solve this problem in a better way.  Here's some
> background info- my third tuner is a PVR-150 connected to a cable STB
> so I can record all those channels that aren't sent clear QAM.  It
> works, except the cable box is not particularly stable; it turns off,
> reboots itself or otherwise misbehaves regularly, particularly during
> the night, causing missed recordings.
> 
> Here's what I did as a workaround: as part of my channel change script
> I dump a couple seconds of video to a file in /tmp (by reading
> /dev/video0 directly), and then use a couple tools to dump a few
> frames to JPG files and then convert these to ascii art (I forget the
> tool names).  Basically it's a blank screen detection -- if I get
> blanks, I blast a "POWER" button before changing the channel.
> 
> This improved the situation greatly for recordings.  However, I
> suspect there is some contention now as both the backend and my script
> are trying to open /dev/video0.  LiveTV on this turner doesn't seem to
> work at all.  I suppose a better way would be if I looked at the
> actual file that mythbackend is recording to, but there is no easy way
> for a channel change script to know this as far as I can tell.
> 
> I found one script that does a few mysql queries to figure this out,
> querying the channels table to get the chanid and then the recordings
> table to find the latest entry on that chanid, but by doing something
> like that you've now tied your channel change script to the myth
> database schema, and created dependencies on the recordings table
> being updated before the script is called, etc.  It seems like it's
> prone to breakage as well.
> 
> So - my question:
> a) Is there any reliable way that a channel change script can obtain
> the filename that mythbackend is starting it's recording to?
> -OR-
> b) Is there a way to determine if the cable box is on that doesn't
> require access to the video stream, like querying some other statistic
> in the ivtv driver?
> 
> Thanks in advance!
> 
> 

Joe, Have a script that queries the channel table to get source and
chanid + SG table so that can be used to get the video file name. It
then does blank checking to decide if power on is needed. Finally does
scrapping of the video for the STB OSD to check it is tuned to the
correct channel, if not try channel change again. Have been using it for
many years and yep Storage Groups introduction in whatever release of
Myth that was broke it, but don't see schema changes that would break it
coming along very often. Doesn't use recordings table so don't have that
issue.
You can see it at http://web.aanet.com.au/~auric/?q=node/9
Needs quite a old version of mplayer, the newer ones won't dump images
fast enough, and does require some tailoring for different cable
providers. So you won't be able to use it as such but might give you
some ideas.

Auric



More information about the mythtv-users mailing list