Mailing List Archive

DVD playback issues, from revision 22120 onwards
Hi all,

I've just joined this mailing list. I've been using MythTV for quite a
while now, always using subversion trunk and doing regular "svn update".
A while ago, DVD playback started having issues - basically, on most
DVDs video started playing too fast and went out of sync with the audio.

When I first noticed I didn't worry too much seeing as I figured it
would probably be fixed at some point in the future - however, that
hasn't happened yet, so I did some investigating.

By bisecting commits I discovered the problematic change. It is revision
22120:

Timestamp:
09/30/09 01:35:58 (4 weeks
<http://svn.mythtv.org/trac/timeline?from=2009-09-30T01%3A35%3A58Z&precision=second>
ago)
Author:
skamithi
Message:

Closes #7113 <http://svn.mythtv.org/trac/ticket/7113>. internal dvd
player: recent dvd code updates in trunk didn't account for dvd
still frame with audio. made the necessary changes to resolve this.
tested fix on lord of rings (the two towers) special features dvd.


See the code change:
http://svn.mythtv.org/trac/changeset/22120/trunk

As you can see various lines have become condition upon whether
curstream->codec->codec_type == CODEC_TYPE_VIDEO.

Now, on one DVD ("Let it Snow") which has a problem since this change,
it appears that the menu is implemented as a still frame. There are no
still frames in the actual chapter, however when it is playing after
displaying the DVD menu then the video plays too fast (at least for a
short period) and goes a few seconds out of sync with the audio.

I put in some debug lines and found that during the menu display,
curstream->codec->codec_type == CODEC_TYPE_AUDIO (not VIDEO).

Has anyone else seen the same problem, or is it just me? Is the change
in 22120 definitely correct or is it flawed? I don't know enough about
the code to be able to proceed - presumably the change *was* actually
fixing a problem so just reverting it might not be the right answer - so
I'd appreciate any help. (Perhaps A/V sync needs to be reset after
selecting a DVD menu item? How and where would this be done? etc)

Thanks for any help,

Davin
Re: DVD playback issues, from revision 22120 onwards [ In reply to ]
Davin McCall wrote:
[...]
> Has anyone else seen the same problem, or is it just me? Is the change
> in 22120 definitely correct or is it flawed? I don't know enough about
> the code to be able to proceed - presumably the change *was* actually
> fixing a problem so just reverting it might not be the right answer - so
> I'd appreciate any help. (Perhaps A/V sync needs to be reset after
> selecting a DVD menu item? How and where would this be done? etc)

Others have seen this too, including myself. Thanks for doing the
legwork to figure out when this broke! This is filed as ticket:

http://svn.mythtv.org/trac/ticket/7067

among a few other tickets as well.

> Thanks for any help,
>
> Davin
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: DVD playback issues, from revision 22120 onwards [ In reply to ]
Johnny Stenback wrote:
> Davin McCall wrote:
> [...]
>> Has anyone else seen the same problem, or is it just me? Is the change
>> in 22120 definitely correct or is it flawed? I don't know enough about
>> the code to be able to proceed - presumably the change *was* actually
>> fixing a problem so just reverting it might not be the right answer - so
>> I'd appreciate any help. (Perhaps A/V sync needs to be reset after
>> selecting a DVD menu item? How and where would this be done? etc)
>
> Others have seen this too, including myself. Thanks for doing the
> legwork to figure out when this broke! This is filed as ticket:
>
> http://svn.mythtv.org/trac/ticket/7067
>
> among a few other tickets as well.
>
>> Thanks for any help,
>>
>> Davin
>>
>>
>>
I don't know if this is related, but since going from 0.21 fixes to 0.22
fixes (fc10.x86_64 from ATrpms) I have had trouble playing my
Mytharchive dvds. I have a large collection burned over the past few
months using two-channel mp2 audio in both the menu and the recordings,
and the Mythcenter animated theme. I get no sound if I select the
recording soon after the menu appears, but if I wait several seconds the
selected recording plays properly. If I re-enter the menu from
playback, sound disappears, both in the menu and in any subsequent
selection, but it's sometimes ok if the selected recording plays to the
end and returns to the menu. I can of course provide logs if that would
be useful, but I've found it difficult to identify what might be relevant.

I'm not seeing the too-fast playback. The discs play as intended in vlc
- although with some stuttering at the beginning of the recordings - and
on the hardware players I have tried.

John P
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: DVD playback issues, from revision 22120 onwards [ In reply to ]
On 31/10/09 17:13, Johnny Stenback wrote:
>
> Others have seen this too, including myself. Thanks for doing the
> legwork to figure out when this broke! This is filed as ticket:
>
> http://svn.mythtv.org/trac/ticket/7067
>
> among a few other tickets as well.
>

Ok, thanks. That's good to know.

Davin

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: DVD playback issues, from revision 22120 onwards [ In reply to ]
On 31/10/09 17:13, Johnny Stenback wrote:
> Others have seen this too, including myself. Thanks for doing the
> legwork to figure out when this broke! This is filed as ticket:
>
> http://svn.mythtv.org/trac/ticket/7067
>
> among a few other tickets as well.


Some more on this problem. I've been digging in the source and have
found some interesting things, but I need help to make sense of them.

Basically, NuppelVideoPlayer and VideoSync seem to have different ideas
about the delay parameter to VideoSync::WaitForFrame(). VideoSync treats
it as a cumulative (the delay provided will always adjust the target
time for the next frame, represented in m_nexttrigger) whereas NVP
treats it as (kind of) an absolute, specifically, it provides a negative
value if video is behind audio or a positive value if video is ahead of
audio. The problem is it might not be VideoSync which is delaying the
video (more on this in a bit) in which case NVP will keep providing
negative values (in NVP::AVSync()) and VideoSync will tally these up
until eventually m_nexttrigger is a long way in the past (even though
the video might only be a bit behind the audio).

Sure enough, when that happens, VideoSync returns without actually
delaying, but as I mentioned, there may be something else delaying the
video. In the problem I see, AVSync() calls videoOutput->Show() which
results (at least for a while or in some situation) in an exactly
equivalent delay. Now that in itself seems wrong to me, but that is what
is happening (possibly this is while a still frame is showing, but I'd
need to investigate to be certain). Eventually the video gets ahead /
videoOutput->Show() stops delaying (end of still frame?), and when that
happens the video just races because m_nexttrigger is so far in the past
that calling WaitForNextFrame() with a positive delay value still
returns immediately (m_delay is too small).

Note that VideoSync (in CalcDelay()) specifically contains code to limit
the trigger time to 2 frames away. However it has no similar mechanism
to prevent the trigger from being too far in the past.

Given that NuppelVideoPlayer is the only user of VideoSync, it seems
that the nature of the delay parameter should be sorted out one way or
the other - as either an absolute or an accumlative delta.

Any insights?

Davin

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