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

Mailing List Archive: MythTV: Users

DVD Playback crashing in 0.24-fixes -- workaround

 

 

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


mythtv at rtr

Apr 1, 2012, 9:41 AM

Post #1 of 8 (649 views)
Permalink
DVD Playback crashing in 0.24-fixes -- workaround

Ever since I upgraded to 0.24-fixes (over a year ago),
the built-in DVD playback stuff has been unusable.

It *always* crashes, often on beginning DVD playback,
or often on the first press of the MENU button while playing.

Sometimes a new, never-seen-before, DVD will play okay for longer,
but on reinsertion things always crash again.
This is on multiple installations. The bug in somewhere in Mythtv.

So today I did something about it. I simply disabled DVD-Bookmark
saving/lookup in the source code. The crashes are now completely gone.

The patch (simple) is below. The code that deals with DVD-Bookmarks
doesn't look terribly scary, so it might be possible for somebody more
familiar with C++ to stare at it for a bit and perhaps spot the real bug.
I'm still looking at it here, but I'm not really a C++ guy. :)

Here's the patch, for anyone else who wants to use Mythtv to play DVDs
(patch is also attached, to bypass mailer mangling issues):


--- mythtv/libs/libmythtv/mythdvdplayer.cpp.orig 2012-03-15 10:10:31.000000000 -0400
+++ mythtv/libs/libmythtv/mythdvdplayer.cpp 2012-04-01 12:18:52.943931946 -0400
@@ -355,6 +355,7 @@

uint64_t MythDVDPlayer::GetBookmark(void)
{
+#if 0 /* bookmarks crash the DVDplayer too often, so disable them */
if (gCoreContext->IsDatabaseIgnored() || !player_ctx->buffer->isDVD())
return 0;

@@ -387,6 +388,9 @@
}
player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
return frames;;
+#else
+ return 0;
+#endif
}

void MythDVDPlayer::ChangeSpeed(void)
@@ -550,6 +554,7 @@

void MythDVDPlayer::SetDVDBookmark(uint64_t frame)
{
+#if 0 /* bookmarks crash the DVDplayer too often, so disable them */
if (!player_ctx->buffer->isDVD())
return;

@@ -598,6 +603,7 @@
.arg(title).arg(audiotrack).arg(subtitletrack).arg(framenum));
}
player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
+#endif
}

int MythDVDPlayer::GetNumAngles(void) const
Attachments: 68_dvd_disable_bookmarks.patch (0.98 KB)


J.Pilk at tesco

Apr 1, 2012, 10:57 AM

Post #2 of 8 (627 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On 01/04/12 17:41, Mark Lord wrote:
> Ever since I upgraded to 0.24-fixes (over a year ago),
> the built-in DVD playback stuff has been unusable.
>
> It *always* crashes, often on beginning DVD playback,
> or often on the first press of the MENU button while playing.
>
> Sometimes a new, never-seen-before, DVD will play okay for longer,
> but on reinsertion things always crash again.
> This is on multiple installations. The bug in somewhere in Mythtv.

< patch etc snipped >

My 0.24-fixes box spends a lot of its time authoring DVDs and I
occasionally use it to play them. Playback is usually OK but menu
handling often leaves something to be desired. vlc usually handles menus
better. I have often felt that the internal Myth player has been much
influenced by the desire to play commercial disks with copy-frustrating
features, to the detriment of its ability to play the products of
MythArchive, but I don't recognise your problem as one that I have seen.
Maybe others will. In case it's relevant, I don't use VDPAU.

John P

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


mythtv at rtr

Apr 1, 2012, 11:19 AM

Post #3 of 8 (626 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On 12-04-01 01:57 PM, John Pilkington wrote:
> On 01/04/12 17:41, Mark Lord wrote:
>> Ever since I upgraded to 0.24-fixes (over a year ago),
>> the built-in DVD playback stuff has been unusable.
>>
>> It *always* crashes, often on beginning DVD playback,
>> or often on the first press of the MENU button while playing.
>>
>> Sometimes a new, never-seen-before, DVD will play okay for longer,
>> but on reinsertion things always crash again.
>> This is on multiple installations. The bug in somewhere in Mythtv.
>
> < patch etc snipped >
>
> My 0.24-fixes box spends a lot of its time authoring DVDs and I occasionally use it to play them.
> Playback is usually OK but menu handling often leaves something to be desired. vlc usually handles
> menus better. I have often felt that the internal Myth player has been much influenced by the desire
> to play commercial disks with copy-frustrating features, to the detriment of its ability to play the
> products of MythArchive, but I don't recognise your problem as one that I have seen. Maybe others
> will. In case it's relevant, I don't use VDPAU.


The crashes happen with/without VDPAU, and there have been many tickets
(from others) reporting the issue, but no resolution.

I suspect a race between MythDVDPlayer::GetBookmark() and other parts of the player.
Saving bookmarks doesn't seem to cause trouble, just retrieving the first one
on resume of playback. This leads to internal heap corruption in libc++,
and then subsequent crashes in unrelated sections of code.

The code there does seem simple enough. Some experienced C++ eyeballs
ought to be able to spot the bug.

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


stichnot at gmail

Apr 1, 2012, 11:32 AM

Post #4 of 8 (628 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On Sun, Apr 1, 2012 at 11:19 AM, Mark Lord <mythtv [at] rtr> wrote:
>
> The crashes happen with/without VDPAU, and there have been many tickets
> (from others) reporting the issue, but no resolution.
>
> I suspect a race between MythDVDPlayer::GetBookmark() and other parts of the player.
> Saving bookmarks doesn't seem to cause trouble, just retrieving the first one
> on resume of playback.  This leads to internal heap corruption in libc++,
> and then subsequent crashes in unrelated sections of code.
>
> The code there does seem simple enough.  Some experienced C++ eyeballs
> ought to be able to spot the bug.

Mark,

I've seen several of these tickets, but I can't reproduce the crashing
on my system (either because I'm running Master instead of 0.24, or
more likely because of some difference on my system). If you can
reproduce the crash reliably, could you try running valgrind on it?
Something like:
valgrind --leak-check=yes mythfrontend ...

If there is some kind of memory corruption going on, valgrind might
find something interesting before the crash.

Thanks,

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


J.Pilk at tesco

Apr 1, 2012, 12:20 PM

Post #5 of 8 (628 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On 01/04/12 18:57, John Pilkington wrote:
> On 01/04/12 17:41, Mark Lord wrote:
>> Ever since I upgraded to 0.24-fixes (over a year ago),
>> the built-in DVD playback stuff has been unusable.
>>
>> It *always* crashes, often on beginning DVD playback,
>> or often on the first press of the MENU button while playing.
>>
>> Sometimes a new, never-seen-before, DVD will play okay for longer,
>> but on reinsertion things always crash again.
>> This is on multiple installations. The bug in somewhere in Mythtv.
>
> < patch etc snipped >
>
> My 0.24-fixes box spends a lot of its time authoring DVDs and I
> occasionally use it to play them. Playback is usually OK but menu
> handling often leaves something to be desired. vlc usually handles menus
> better. I have often felt that the internal Myth player has been much
> influenced by the desire to play commercial disks with copy-frustrating
> features, to the detriment of its ability to play the products of
> MythArchive, but I don't recognise your problem as one that I have seen.
> Maybe others will. In case it's relevant, I don't use VDPAU.
>
> John P

I hadn't used bookmarks before - and yes, I do see a problem when I try.
Sorry for the noise.

John P

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


mythtv at rtr

Apr 1, 2012, 1:17 PM

Post #6 of 8 (618 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On 12-04-01 02:32 PM, Jim Stichnoth wrote:
> On Sun, Apr 1, 2012 at 11:19 AM, Mark Lord <mythtv [at] rtr> wrote:
>>
>> The crashes happen with/without VDPAU, and there have been many tickets
>> (from others) reporting the issue, but no resolution.
>>
>> I suspect a race between MythDVDPlayer::GetBookmark() and other parts of the player.
>> Saving bookmarks doesn't seem to cause trouble, just retrieving the first one
>> on resume of playback. This leads to internal heap corruption in libc++,
>> and then subsequent crashes in unrelated sections of code.
>>
>> The code there does seem simple enough. Some experienced C++ eyeballs
>> ought to be able to spot the bug.
>
> Mark,
>
> I've seen several of these tickets, but I can't reproduce the crashing
> on my system (either because I'm running Master instead of 0.24, or
> more likely because of some difference on my system). If you can
> reproduce the crash reliably, could you try running valgrind on it?
> Something like:
> valgrind --leak-check=yes mythfrontend ...
>
> If there is some kind of memory corruption going on, valgrind might
> find something interesting before the crash.


That's a thought. I'll give it a try when I next get the chance.
Meanwhile, I did look at master, and there appears to be a whole
new ringbuffer class specifically for DVD playback.. so it is quite
possible that the bug got eliminated when that happened.
Which is encouraging.

But master isn't ready for prime time yet (compared with 0.24-fixes),
so that won't be a viable option here for various reasons
until the summer or so.

I'll see what valgrind spews out later today, hopefully.

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


mythtv at rtr

Apr 1, 2012, 8:14 PM

Post #7 of 8 (616 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On 12-04-01 02:32 PM, Jim Stichnoth wrote:
> On Sun, Apr 1, 2012 at 11:19 AM, Mark Lord <mythtv [at] rtr> wrote:
>>
>> The crashes happen with/without VDPAU, and there have been many tickets
>> (from others) reporting the issue, but no resolution.
>>
>> I suspect a race between MythDVDPlayer::GetBookmark() and other parts of the player.
>> Saving bookmarks doesn't seem to cause trouble, just retrieving the first one
>> on resume of playback. This leads to internal heap corruption in libc++,
>> and then subsequent crashes in unrelated sections of code.
>>
>> The code there does seem simple enough. Some experienced C++ eyeballs
>> ought to be able to spot the bug.
>
> Mark,
>
> I've seen several of these tickets, but I can't reproduce the crashing
> on my system (either because I'm running Master instead of 0.24, or
> more likely because of some difference on my system). If you can
> reproduce the crash reliably, could you try running valgrind on it?
> Something like:
> valgrind --leak-check=yes mythfrontend ...

Well, that was amusing. Valgrind literally complained of hundreds of errors
just in mythfrontend startup before the mainmenu got displayed.
At which point mythfrontend crashed back the desktop, without me ever
pushing a button or even getting close to the DVD player.

I wonder if "The Devs" ever run this on a beta/rc version before release?

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


stichnot at gmail

Apr 2, 2012, 11:18 AM

Post #8 of 8 (607 views)
Permalink
Re: DVD Playback crashing in 0.24-fixes -- workaround [In reply to]

On Sun, Apr 1, 2012 at 8:14 PM, Mark Lord <mythtv [at] rtr> wrote:
> On 12-04-01 02:32 PM, Jim Stichnoth wrote:
>> I've seen several of these tickets, but I can't reproduce the crashing
>> on my system (either because I'm running Master instead of 0.24, or
>> more likely because of some difference on my system).  If you can
>> reproduce the crash reliably, could you try running valgrind on it?
>> Something like:
>>     valgrind --leak-check=yes mythfrontend ...
>
> Well, that was amusing.  Valgrind literally complained of hundreds of errors
> just in mythfrontend startup before the mainmenu got displayed.
> At which point mythfrontend crashed back the desktop, without me ever
> pushing a button or even getting close to the DVD player.

I forgot to mention that you probably want to run the "configure"
script with "--enable-valgrind" which (according to the help message)
disables some timeouts to accommodate the valgrind slowdown factor.
With luck, that's what happened with the crash. Note that valgrind
may report a lot of false positives that have to be sifted through.
Also, it will report issues in e.g. the Qt libraries which we have no
control over.

> I wonder if "The Devs" ever run this on a beta/rc version before release?

When fixes are made based on feedback from analysis tools, a mention
is usually made in the commit message. Based on the commit messages,
I would say it's not too common.

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

MythTV users 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.