Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change)

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


mythtv at miwers

Jul 25, 2007, 2:43 PM

Post #1 of 7 (833 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change)

Shane wrote:
> On 7/24/07, Hadley Rich <hads [at] nice> wrote:
>> On Wed, 25 Jul 2007 04:06:44 eric.bosch [at] comcast wrote:
>>> I don't believe it is an ivtv issue, as I can have the live-tv hang on show
>>> transition, even though the program is scheduled to record, and once I can
>>> get back to the menu, and then play it back from recordings, it plays fine.
>>> My suspicion is that there is some sort of race condition or timing issue
>>> in that perhaps there is a short delay where the new file is opened, and
>>> actually catalogged.
>
> My guess is the problem lies with 'continuous' type of livetv file
> transitions, these continuous transitions are used for livetv ivtv
> files but not V4L or DVB files. The discontinuity (discont=1) type of
> file transitions follow a different path and are ok I think.
>
> Should be able to test this theory by making a small code change in
> tv_rec.cpp ...
>
> Around line 1310 in TVRec::RunTV(void)
> ...
> + SwitchLiveTVRingBuffer(true, true); // Try this for discont transitions
> - SwitchLiveTVRingBuffer(false, true);
>
> I also have a vague suspicion that something else might be causing
> more prebuffering pauses than usual.
>
> Shane

Are you sure about that? My rig uses the same transition type for all
recorders (IVTV, V4L, DVB all use discont = 0), at least the log says so.

Still, I only get freezes (EVERY time) on my IVTV cards, but not on my
V4L and DVB card.

But your little hack seems to fix the freezing on playback for me, so
you're probably right.

/Miwer
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mythtv at miwers

Jul 25, 2007, 3:03 PM

Post #2 of 7 (785 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

eric.bosch [at] comcast wrote:
> I don't believe it is an ivtv issue, as I can have the live-tv hang on
> show transition, even though the program is scheduled to record, and
> once I can get back to the menu, and then play it back from recordings,
> it plays fine. My suspicion is that there is some sort of race
> condition or timing issue in that perhaps there is a short delay where
> the new file is opened, and actually catalogged. What kind of
> filesystem implementations are you running? I have an LVM managed set
> of virtual drives, one of which being a 500GB filesystem for the
> recordings. My backend uses NFS filesystem for the recordings, and both
> frontends are configured to stream from remote server. If I don't do
> this, then I have severe stuttering and eventual stall on livetv from
> remote tuners.
>

Yeah, you're right...

My setup consists of one backend server also acting as a frontend, and a
second frontend machine streaming from the backend server. All testing
is done on the locally on the backend.

All recording happens to a separate 250GB physical SATA disk on the
backend with a reiserfs partition. Here are some hdparm timing tests,
for what it's worth:

server ~ # hdparm -Tt /dev/sda1

Timing cached reads: 898 MB in 2.00 seconds = 449.10 MB/sec
Timing buffered disk reads: 148 MB in 3.01 seconds = 49.23 MB/sec

Timing cached reads: 962 MB in 2.00 seconds = 480.36 MB/sec
Timing buffered disk reads: 160 MB in 3.02 seconds = 53.04 MB/sec

Timing cached reads: 1014 MB in 2.00 seconds = 506.58 MB/sec
Timing buffered disk reads: 156 MB in 3.02 seconds = 51.59 MB/sec

/Miwer
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


gnome42 at gmail

Jul 25, 2007, 4:21 PM

Post #3 of 7 (787 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

> Are you sure about that? My rig uses the same transition type for all
> recorders (IVTV, V4L, DVB all use discont = 0), at least the log says so.

I think so, but you can know for sure by looking in the frontend log.
If there are signs of a player reset occurring then the switch was
discont. Should see FileChangedCallback for continous.

eg. It's discont if you see this type of stuff with -v playback

VideoOutputXv: ClearAfterSeek()
VideoOutputXv: DiscardFrames(0)
VideoBuffers::DiscardFrames(0): AAAAAAAAAAAUUUUUUUUUUUuuAAAAAAA
VideoBuffers::DiscardFrames(0): AAAAAAAAAAAAAAAAAAAAAAaaAAAAAAA -- done
VideoOutputXv: DiscardFrames() 3: AAAAAAAAAAAAAAAAAAAAAAaaAAAAAAA -- done()

The discont'ness can be overridden later on, so the backend log is not
reliable for that.

> Still, I only get freezes (EVERY time) on my IVTV cards, but not on my
> V4L and DVB card.

Yeah, same here. Unfortunately it's beyond me to do much more useful
debugging on the continuous transitions. Hmm, I wonder if they have
ever been highly reliable?

Shane
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mythtv at miwers

Jul 26, 2007, 10:56 AM

Post #4 of 7 (778 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

Bob Cottingham wrote:
On 7/26/07, Nick Morrott <knowledgejunkie [at] gmail> wrote:
Another issue I have noticed is that when a completely recorded program transitions without freezing (the key problem), a new ringbuffer is not (always?) created and Myth does not start or even update the recording with details of the new program but carries on using the old recording file. When I entered LiveTV when a program was already underway, the next program transition was successful. In my testing I entered LiveTV at 0926, and LiveTV successfully transitioned to the next program at 0930, using a new ringbuffer and updating program details accordingly. However, when this show (0930-1000) finished, at 1000 the recording again continued without freezing, but continued to use the same ringbuffer file from the 0930-1000 show. When I backed out of this show at 1007 and looked at the recordings list, instead of showing one entry for 0930-1000 and another for 1000-1007 (the next program), there was only a single entry with duration 0930-1007 with the details relating to the 0930-1000 program. I'm sure this will probably cause some issues if a user decides to try and record the 'new' program when it is still using the old ringbuffer.
I've been seeing this problem as well as the freeze on transition issue for the last month so. The freeze on transition is very consistent, however the problem of not creating a new file on transistion is very intermittant and has caused quite a problem as it has created files over 30GB when LiveTV was left on over night, resulting in the system running out of disk space and crashing myth. There were a mix of non-expirable shows, expirable shows and LiveTV plus the slave backend OS on a 120GB drive - so once the auto-expirable shows were deleted it couldn't delete anything else. So I don't think that the issue you found is due to Shane's patch since I've been seeing it for a while as well. I hope to try his patch this weekend as the entire family appreciation factor has gone down with the LiveTV freezes.
During my testing I have seen this problem too, and I'm posting my logs here for you to review.
The transition happens at 19:30 and it's a copy/paste from just around that time.

I agree with bob, that it doesn't look related to the issue in this ticket. It appears to be a problem on the backend, not on the frontend like the freezing issue.
Maybe a separate ticket should be created for this issue, if one doesn't already exists.

Still no freeze after Shane's one-line patch :)

Tip for everyone:
You can speed up testing by applying Tino's patch "ticket-2335.diff". With this you get program transitions every 2 minutes on channels with no guide data.

And the logs:

============================================
frontend (-v important,genral,playback)


2007-07-26 19:29:42.874 Avg read interval was 197 msec. 256K block size
'video_output' mean = '39864.50', std. dev. = '8507.65', fps = '25.08'
'video_output' mean = '40025.03', std. dev. = '8911.47', fps = '24.98'
2007-07-26 19:29:53.539 Avg read interval was 191 msec. 288K block size
2007-07-26 19:29:53.594 NVP: 76800 interlaced frames seen.
'video_output' mean = '40023.78', std. dev. = '8361.07', fps = '24.99'
'video_output' mean = '40089.34', std. dev. = '8782.62', fps = '24.94'
'video_output' mean = '39960.72', std. dev. = '9173.60', fps = '25.02'
(--- transition ---)
2007-07-26 19:30:05.099 Avg read interval was 412 msec. 256K block size
2007-07-26 19:30:05.555 NVP: prebuffering pause
2007-07-26 19:30:05.555 NVP: Waiting for prebuffer.. 0 AAAAAAuAAAAaAALAAAAAAAAAAAAAAAA
2007-07-26 19:30:05.729 NVP: Waiting for prebuffer.. 1 AAAAAAuAAAAaAALAAAAAAAAAAAAAAAA
2007-07-26 19:30:05.848 WriteAudio: buffer underrun
2007-07-26 19:30:05.887 Avg read interval was 186 msec. 64K block size
'video_output' mean = '43194.48', std. dev. = '33426.02', fps = '23.15'
2007-07-26 19:30:06.171 Avg read interval was 195 msec. 96K block size
2007-07-26 19:30:07.080 Avg read interval was 193 msec. 128K block size
2007-07-26 19:30:09.772 Avg read interval was 195 msec. 160K block size
2007-07-26 19:30:09.851 NVP: 77200 interlaced frames seen.
'video_output' mean = '39203.18', std. dev. = '8306.81', fps = '25.51'
'video_output' mean = '40158.75', std. dev. = '10300.15', fps = '24.90'
'video_output' mean = '39891.53', std. dev. = '10887.40', fps = '25.07'


============================================
backend (-v important,general,record,file)


2007-07-26 19:29:24.545 AutoExpire: SendDeleteMessages. Nothing to expire.
(--- transition ---)
2007-07-26 19:30:00.580 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:01.588 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:02.289 SG(LiveTV): FindRecordingFile: Searching for '6011_20070726190000.mpg'
2007-07-26 19:30:02.625 SG(LiveTV): FindRecordingDir: Checking '/Storage/mythdata/recordings/livetv'
2007-07-26 19:30:02.627 SG(LiveTV): FindRecordingFile: Found '/Storage/mythdata/recordings/livetv/6011_20070726190000.mpg'
2007-07-26 19:30:02.628 ProgramInfo: GetPlaybackURL: File is local: '/Storage/mythdata/recordings/livetv/6011_20070726190000.mpg'
2007-07-26 19:30:02.698 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:03.767 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:04.776 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:05.780 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:06.788 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:07.796 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:08.800 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:09.805 TVRec(1): Enabling Full LiveTV UI.
2007-07-26 19:30:10.809 TVRec(1): Enabling Full LiveTV UI.

/Miwer


mythtv at miwers

Aug 7, 2007, 12:10 PM

Post #5 of 7 (723 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

Shane wrote:
Are you sure about that? My rig uses the same transition type for all recorders (IVTV, V4L, DVB all use discont = 0), at least the log says so.
I think so, but you can know for sure by looking in the frontend log. If there are signs of a player reset occurring then the switch was discont. Should see FileChangedCallback for continous. eg. It's discont if you see this type of stuff with -v playback VideoOutputXv: ClearAfterSeek() VideoOutputXv: DiscardFrames(0) VideoBuffers::DiscardFrames(0): AAAAAAAAAAAUUUUUUUUUUUuuAAAAAAA VideoBuffers::DiscardFrames(0): AAAAAAAAAAAAAAAAAAAAAAaaAAAAAAA -- done VideoOutputXv: DiscardFrames() 3: AAAAAAAAAAAAAAAAAAAAAAaaAAAAAAA -- done() The discont'ness can be overridden later on, so the backend log is not reliable for that.
Still, I only get freezes (EVERY time) on my IVTV cards, but not on my V4L and DVB card.
Yeah, same here. Unfortunately it's beyond me to do much more useful debugging on the continuous transitions. Hmm, I wonder if they have ever been highly reliable? Shane

After some more testing, I must agree with you, Shane. I cannot trust the backend regarding discont.
I compiled mythtv without your one-line workaround, so in all tests below the backend reports discont = 0 (continuous recording)
I have attached some log files to this mail

Using the DVB card for recording, I have seen both continuous and discontinuous switching on the frontend - it seems that sometimes (not everytime) the frontend ignores the discont = 0 and resets the playback. For some reason I got five switches in a row at one time. Don't know if that was a different bug, and it doesn't seem related to this.

mythtv-DVB-continuous.txt
mythtv-DVB-multiple-changes-ignoring-continuous.txt

To be continued...

/Miwer
Attachments: mythtv-DVB-continuous.txt (6.91 KB)
  mythtv-DVB-multiple-changes-ignoring-continuous.txt (15.2 KB)


mythtv at miwers

Aug 7, 2007, 12:13 PM

Post #6 of 7 (720 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

mythtv [at] miwers wrote:
After some more testing, I must agree with you, Shane. I cannot trust the backend regarding discont.
I compiled mythtv without your one-line workaround, so in all tests below the backend reports discont = 0 (continuous recording)
I have attached some log files to this mail

Using the DVB card for recording, I have seen both continuous and discontinuous switching on the frontend - it seems that sometimes (not everytime) the frontend ignores the discont = 0 and resets the playback. For some reason I got five switches in a row at one time. Don't know if that was a different bug, and it doesn't seem related to this.

mythtv-DVB-continuous.txt
mythtv-DVB-multiple-changes-ignoring-continuous.txt

To be continued...

I found something else during my testing...
Please notice that the frontend only issues one LiveTVChain(): SwitchTo() event for each switch:

If I record with the IVTV tuners, then I get two SwitchTo events for each switch. Could this be the cause of the freezing? It seems that the frontend is trying to play back the stream twice, and there's a collision. I'm only guessing, but it could be worth looking into.

mythtv-IVTV-double-switchto.txt

Also notice, that in the DVB log (continuous) I get the FileChangedCallback, but I don't get this in the IVTV logs before it freeze. So, maybe somewhere in between those events it all goes fubar for the frontend.

/Miwer
Attachments: mythtv-IVTV-double-switchto.txt (18.7 KB)


stuart at tase

Aug 7, 2007, 12:33 PM

Post #7 of 7 (725 views)
Permalink
Re: Ticket #2335: LiveTV hangs when a recording is finished and a new on starts (no channel change) [In reply to]

On Tuesday 07 August 2007 20:13:20 mythtv [at] miwers wrote:
> I found something else during my testing...
> Please notice that the frontend only issues one LiveTVChain(): SwitchTo()
> event for each switch:
>
> If I record with the IVTV tuners, then I get two SwitchTo events for each
> switch. Could this be the cause of the freezing? It seems that the frontend
> is trying to play back the stream twice, and there's a collision. I'm only
> guessing, but it could be worth looking into.

This is a known problem but seems to be more of a symptom that the root cause.
We reach EOF on one file and then switch to the second file only to EOF again
because it doesn't exist (or is empty). We then try to switch to the third
file in the chain but only two programmes exist and at this point we get
stuck looking for a non-existant "next" file.

> mythtv-IVTV-double-switchto.txt
>
> Also notice, that in the DVB log (continuous) I get the
> FileChangedCallback, but I don't get this in the IVTV logs before it
> freeze. So, maybe somewhere in between those events it all goes fubar for
> the frontend.

Let me just say right now, that it's a red herring looking at differences
between DVB and IVTV. Plenty of people have trouble with DVB and none at all
with IVTV or vice-versa. This is a race condition issue caused by differences
in speed on some systems and seems to have nothing to do with the type of
capture card.

--
Stuart Morgan
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.