[mythtv-users] Firewire recording works in LiveTV but scheduledrecordings unreliable

Les Noland lnoland at xnet.com
Wed Aug 31 03:16:16 UTC 2011



-----Original Message-----
From: mythtv-users-bounces at mythtv.org
[mailto:mythtv-users-bounces at mythtv.org] On Behalf Of Les Noland
Sent: Sunday, August 28, 2011 10:33 AM
To: mythtv-users at mythtv.org
Subject: [mythtv-users] Firewire recording works in LiveTV but
scheduledrecordings unreliable

I've done a lot of experimenting with this but can't quite figure out what
the problem is. Our cable company went all-digital so I decided to upgrade
my cable to HD. I bought a Hauppauge HD-PVR to connect to the HD set-top
box, but couldn't get that to work -- in my research I discovered that it
was possible to record directly from the STB using Firewire so I decided to
try that instead.

After some trial and error I got a reasonably reliable setup -- so long as I
don't schedule recordings.

I am using the juju firewire stack since it seemed that newer would be
better. I have a SA3250HD STB. The MythTV built-in channel changer wouldn't
select the correct channel so I built a channel changer based on:

http://www.mythtv.org/wiki/Sa3250ch 

(I actually started with Benton Roberts' variant, found here:

http://bentonroberts.com/personal/media-server/code

I changed it to not exit with an error if it finds an unused node (since I
am only using one) and to automatically choose the first working node since,
again, I am only using one, and the node keeps changing. (I wasn't sure
whether it would work with the new stack since it appeared to predate it and
I don't know much about firewire or its implementation -- it seems to work
great, however -- rock-solid, totally reliable).

The STB is connected to my HTPC which houses a combination front end and
slave back end. If I watch it in LiveTV it seems to work pretty reliably,
unless there was some sort of crash or error from a previous recording or
LiveTV session, in which case, the front end often crashes (at least once)
but eventually stabilizes after one of the subsequent relaunches. I seem to
be able to pick up just about everything -- SD channels, premium channels,
clear-QAM channels, HD basic channels, . . . .

If I hit R (Record) in LiveTV, it generally records the program with no
issues. If I schedule a recording on the STB, however, it is pretty
hit-or-miss as to whether it will be successful. In most cases, it will tune
the channel but will give up trying to record less than a minute later and
there will be no file associated with the recording tombstone in the Myth
"watch recorded" menu. Sometimes, going into upcoming recordings right away
and selecting "Reactivate" for the show will result in a recording though
that often fails as well. If, however, I switch to LiveTV, tune the channel
and after it locks, I enter an R, it generally will record it just fine.

I have no idea why it would work fine in LiveTV but not on scheduled
recordings. Can anyone help with this? Below is some test info for
troubleshooting.

The following is a description that covers the timeline of a test I did. It
involved the following activities:
 
1. A scheduled recording of the movie "Dante's Peak" is attempted.
2. The recording fails.
3. I reactivate the recording from the Upcoming Recordings menu.
4. It seems to start recording again.
5. A check of recorded shows reveals that it thinks it is still recording
but, in fact, there is no recording file.
6. I deleted the file (by pressing "D") and indicated to allow re-record.
7. I switched to LiveTV and tuned the movie which worked fine.
8. I pressed "R" and it began recording (which, eventually ended
successfully).

THe following is an excerpt from the backend log covering the above steps
(only up to the beginning of step 8 -- the conclusion of the recording isn't
included:
Code:
2011-08-24 06:42:15.486 mythbackend: Running housekeeping thread
2011-08-24 07:10:13.987 QueryBasename found no entry for 6410 @
2011-08-24T07:10:00
2011-08-24 07:10:14.021 QueryBasename found no entry for 6410 @
2011-08-24T07:10:00
2011-08-24 07:10:14.099 TVRec(10): Changing from None to RecordingOnly
2011-08-24 07:10:14.115 TVRec(10): HW Tuner: 10->10
2011-08-24 07:10:15.397 LFireDev(001692D3FE120000): Buffered packets 2000
(8000 KB)
2011-08-24 07:10:15.642 TVRec(10): rec->GetPathname():
'/6410_20110824071000.mpg'

============================================================================
=
2011-08-24 07:10:15.654 TFW, Error: Opening file '/6410_20110824071000.mpg'.
  eno: Permission denied (13)

NOTE: This makes it look as if it was trying to put the recording file into
the root directory where it has no permissions to create files. That makes
no sense -- none of my storage directories are the root directory and in the
cases where it works properly it certainly doesn't store anything in the
root directory.
============================================================================
=

2011-08-24 07:10:15.670 TVRec(10) Error: RingBuffer
'/6410_20110824071000.mpg' not open...
2011-08-24 07:10:15.690 TVRec(10): Changing from RecordingOnly to None
2011-08-24 07:10:15.719 Finished recording Dante's Peak: channel 6410
2011-08-24 07:10:15.742 scheduler: Finished recording: Dante's Peak: channel
6410
2011-08-24 07:16:31.118 ProgramInfo(6410_20110824071000.mpg), Error:
GetPlaybackURL: '6410_20110824071000.mpg' should be local, but it can not be
found.
2011-08-24 07:17:02.010 MainServer::ANN Monitor
2011-08-24 07:17:02.027 adding: MythTVFrontEnd as a client (events: 2)
2011-08-24 07:17:46.392 ProgramInfo(6410_20110824071000.mpg), Error:
GetPlaybackURL: '6410_20110824071000.mpg' should be local, but it can not be
found.
2011-08-24 07:17:46.785 ProgramInfo(6410_20110824071000.mpg), Error:
GetPlaybackURL: '6410_20110824071000.mpg' should be local, but it can not be
found.
2011-08-24 07:17:49.431 Error deleting
'GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/MythTVFrontEnd/6410_20110824071
000.mpg' could not open 
   eno: No such file or directory (2)
2011-08-24 07:17:49.453 Delete Error
'GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/MythTVFrontEnd/6410_20110824071
000.mpg'
   eno: No such file or directory (2)
2011-08-24 07:17:54.035 MainServer::ANN Playback
2011-08-24 07:17:54.045 adding: MythTVFrontEnd as a client (events: 0)
2011-08-24 07:17:54.098 TVRec(10): Changing from None to WatchingLiveTV
2011-08-24 07:17:54.135 TVRec(10): HW Tuner: 10->10
2011-08-24 07:17:54.333 LoadFromScheduler(): Error, called from backend.
2011-08-24 07:17:55.619 TVRec(10): Changing from WatchingLiveTV to None
2011-08-24 07:18:06.056 MainServer::ANN Playback
2011-08-24 07:18:06.088 adding: MythTVFrontEnd as a client (events: 0)
2011-08-24 07:18:06.125 TVRec(10): Changing from None to WatchingLiveTV
2011-08-24 07:18:06.150 TVRec(10): HW Tuner: 10->10
2011-08-24 07:18:06.342 LoadFromScheduler(): Error, called from backend.
2011-08-24 07:18:07.696 LFireDev(001692D3FE120000): Buffered packets 2000
(8000 KB)

============================================================================
==202011-08-24 07:18:08.478 Finished recording The Ranger, the Cook and a
Hole in the Sky: channel 6490

NOTE: Just to clarify, this "recording" being ended is the show which was on
the initial channel when I changed to LiveTV. It ended when I changed the
channel.
============================================================================
===

2011-08-24 07:18:08.517 scheduler: Finished recording: The Ranger, the Cook
and a Hole in the Sky: channel 6490
2011-08-24 07:18:08.582 LoadFromScheduler(): Error, called from backend.
11-08-24 07:18:08.628 Finished recording The Ranger, the Cook and a Hole in
the Sky: channel 6490
2011-08-24 07:18:08.721 LFireDev(001692D3FE120000): Buffered packets 2000
(8000 KB)
2011-08-24 07:18:11.336 RecBase(10:/dev/video):
GetKeyframePositions(28,9223372036854775807,#0) out of 1
2011-08-24 07:18:11.370 RecBase(10:/dev/video):
GetKeyframePositions(28,9223372036854775807,#0) out of 1
2011-08-24 07:18:36.488 TVRec(10): HW Tuner: 10->10
2011-08-24 07:18:36.519 LoadFromScheduler(): Error, called from backend.
2011-08-24 07:18:36.576 Finished recording The Ranger, the Cook and a Hole
in the Sky: channel 6490
2011-08-24 07:18:38.123 LFireDev(001692D3FE120000): Buffered packets 2000
(8000 KB)
2011-08-24 07:18:38.475 Finished recording Dante's Peak: channel 6410
2011-08-24 07:18:38.506 scheduler: Last message repeated 2 times: Finished
recording: The Ranger, the Cook and a Hole in the Sky: channel 6490
2011-08-24 07:18:38.530 scheduler: Finished recording: Dante's Peak: channel
6410
2011-08-24 07:18:38.550 LoadFromScheduler(): Error, called from backend.
2011-08-24 07:18:38.608 Finished recording Dante's Peak: channel 6410
2011-08-24 07:18:38.687 LFireDev(001692D3FE120000): Buffered packets 2000
(8000 KB)
2011-08-24 07:18:41.966 RecBase(10:/dev/video):
GetKeyframePositions(32,9223372036854775807,#0) out of 1
2011-08-24 07:18:41.999 RecBase(10:/dev/video):
GetKeyframePositions(32,9223372036854775807,#0) out of 1
Error in my_thread_global_end(): 1 threads didn't exit
2011-08-24 07:18:54.024 TVRec(10): SetLiveRecording(1)
2011-08-24 07:18:54.078 TVRec(10): SetLiveRecording() -- record
2011-08-24 07:19:39.197 TVRec(10): Changing from WatchingLiveTV to
RecordingOnly
Error in my_thread_global_end(): 1 threads didn't exit
2011-08-24 07:20:31.800 New DB connection, total: 4
2011-08-24 07:20:31.864 Connected to database 'mythconverg' at host:
192.168.0.235

Thanks for any help which anyone can offer.

- Les 

_______________________________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-users


I found the following which may shed light on my problem, though I don't
know how to pursue it:

http://code.mythtv.org/trac/ticket/9895

This is a much different problem than mine but it has the same symptoms I am
seeing.  It appears that the cause of the problem in the ticket is that in
accessing remote files the files are often being returned with a slash
prepended which confused the receiving software making it impossible to
access the file.  Given that I am seeing the same errors reported by the
same routines, it is likely that my problem has the same cause -- when the
slave backend attempts to access the recording file it gets a filename with
a slash prepended and fails to open the file so it shuts down the recording.
Evidently the routine which does recording in liveTV doesn't have the same
problem (perhaps because the LiveTV storage group is local to the slave
backend and the problem is, apparently, only with remote files).  

Though the ticket has been closed I don't know if the fix will help my
situation -- the "fix" appears to be more of a workaround of making the
receiving routine more tolerant of the variants returned whereas it would
seem that the best fix would be to change whatever is returning the remote
files to do so in a consistent manner which all calling code can handle.
(Actually, I think the best fix would be to stop using generic strings for
files and paths and instead define classes which automatically handle issues
like joining filenames to paths and making sure that proper syntax is
observed).

If the code being fixed in the ticket is different from the code which is
failing in my case, then I guess my problem will persist, but I don't know
how to investigate that.

I suppose I could try to force all recordings to only use local storage
groups -- I'm not sure if I understand storage groups well enough to pull
that off.

I feel bad -- I'm a programmer and with this clue I feel as if I could fix
this problem if I had any familiarity with the code, but I would have to
learn new tools, a new OS environment, the MythTV architecture, coding
conventions, and software idioms, etc.  I don't have anywhere near that kind
of time available (I wish I did -- MythTV really rocks . . . I'd love to
help make it better) nor would I have any idea where to start.

Since it seems that changing to using local recording groups only might be a
viable workaround, can anyone suggest what I would need to do to make that
happen?  Do I just need to eliminate any network paths between a backend and
a remote storage group?  If I do that, what will happen to disk-space
balancing, once recordings for a tuner can only record to a local file
system?  Also, as I understand it, if I set it up that way, when I watch a
show stored remotely, it will be streamed from that host since there will be
no way for the front-end to read the file directly.  Right?

I don't think I can put all of my tuners on one backend -- I have already
had cases where several HD streams recording at once have caused occasional
network overruns and/or disk overruns (it's pretty rare but I don't want to
exacerbate the situation).  Besides, the main backend runs in a VirtualBox
VM and I don't know of any way to attach a firewire feed to that.

Thanks for any thoughts or advice you can offef.

- Les



More information about the mythtv-users mailing list