Opened 15 months ago

Closed 14 months ago

Last modified 14 months ago

#13326 closed Patch - Bug Fix (fixed)

DVD Playback fails in master

Reported by: Peter Bennett Owned by: Peter Bennett
Priority: minor Milestone: 30.0
Component: MythTV - DVD Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

There are two problems with DVD playback in master

  1. Recent changes cause DVD playback to fail if using software decoding or vaapi2. The code that fixes timestamps for DVDs is being bypassed.
  1. There is a deadlock when starting playback between decoder and playback thread. It is not clear when this started or what conditions cause it.

Attachments (2)

20181004_1214_DVD_timestamp_bug.patch (584 bytes) - added by Peter Bennett 15 months ago.
Fix timestamp bug that occurred after recent changes
20181004_1214_DVD_deadlock_bug.patch (598 bytes) - added by Peter Bennett 15 months ago.
Work-around for deadlock by commenting a QMutexLocker. This looks safe but it may cause problems. If anybody has a better suggestion please let me know.

Download all attachments as: .zip

Change History (36)

Changed 15 months ago by Peter Bennett

Fix timestamp bug that occurred after recent changes

Changed 15 months ago by Peter Bennett

Work-around for deadlock by commenting a QMutexLocker. This looks safe but it may cause problems. If anybody has a better suggestion please let me know.

comment:1 Changed 15 months ago by Stuart Auchterlonie

Milestone: needs_triage30.0
Version: UnspecifiedMaster Head

comment:2 Changed 14 months ago by Peter Bennett

Resolution: Fixed
Status: assignedclosed

commit cc60867b30789b4e9f4e82e1151fa97295b5722f Author: Peter Bennett Date: Sat Oct 13 12:18:47 2018 -0400

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master. This is likely a result of two-levels of queuing that is now supported for decoders that produce multiple frames from a single packet. This change removes a lock that seems unnecessary as it is only accessing and not updating.

Fixes #13326

commit 0f3cb12ba84a978eb64aa423462b34abecd50213 Author: Peter Bennett Date: Sat Oct 13 12:15:18 2018 -0400

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2. This caused extremely interrupted playback.

Fixes #13326

comment:3 Changed 14 months ago by jpilk

I hadn't been conscious of DVD playback problems in MythTV, although I have a large collection of MythArchive? creations. I suppose mostly they have been played back, if at all, on other systems and any problems were just accepted as part of the DVD experiemce. They weren't frequent. But I just took a random example and tried it with F27 master cc60867 with nvidia 396.54 VDPAU High Quality, and playback consistently fails at one position:

Player(0): waiting for video buffers

followed by sequences of

Player(0): Waited xxxx ms for video buffers <diagnostic code value>

Eventually it quits with 'Video frame buffering failed too many times' I also see 'DVDRB: Failed to read block: Error reading from DVD' but that might be after some button pushes.

VLC 3.0.4 seemed to cope ok, and MythTV played a K3b-recovered .iso image, as a Video, without problems. My disks are burned from an image including checkisomd5, and the recovered image is good.

F27 real DVD playback fails at the same point on this disk for VDPAU HD or Normal, or just Normal.

Playing the same disk is OK on the el7 box at master 11d426bd49b with old intel q33 graphics.

I've just reverted on F27 to 4651002fc0c and VDPAU HQ. That fails too.

I don't know how many of my disks might be affected by this...

comment:4 Changed 14 months ago by jpilk

With the F27 box reverted to the same commit as the el7, playback from DVD still fails and playback from .iso image still succeeds. I tried Normal and VDPAU HD

I suppose this might be a product of a long-standing apparent bug in mplex, which my copy of Mytharchive is patched to treat as non-fatal. I don't know if it affected the original recording.

     # This seems to be a 'corner case' infrequent warning from mplex.  
     # I have never detected a problem during playback but it may make MythArchive fail. 
     # ++ WARN: [mplex] Stream e0: data will arrive too late sent(SCR)=7314 required(DTS)=7200
     # ++ WARN: [mplex] Video e0: buf= 101237 frame=000001 sector=00000050

comment:5 Changed 14 months ago by Peter Bennett <pbennett@…>

Resolution: Fixedfixed

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:6 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:7 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:8 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:9 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:10 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:11 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:12 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:13 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:14 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:15 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:16 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:17 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:18 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:19 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:20 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:21 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:22 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:23 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:24 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:25 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:26 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:27 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:28 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:29 Changed 14 months ago by Peter Bennett <pbennett@…>

In 0f3cb12ba/mythtv:

DVD Playback: Fix timestamp bug when playing DVD with vaapi2 or ffmpeg

DVD timestamp fixup code was being bypassed in recent changes for vaapi2.
This caused extremely interrupted playback.

Fixes #13326

comment:30 Changed 14 months ago by Peter Bennett <pbennett@…>

In cc60867b3/mythtv:

DVD playback: Fix deadlock

A deadlock during playback of DVDs happens in recent master.
This is likely a result of two-levels of queuing that is
now supported for decoders that produce multiple frames
from a single packet. This change removes a lock that seems
unnecessary as it is only accessing and not updating.

Fixes #13326

comment:31 Changed 14 months ago by jpilk

For info, continuing from comment 4

I am now running master 5f18eb435ca in Fedora 27 (ie FFmpeg 4.0.2 etc)

Playback of this MythArchive? real DVD still fails repeatedly at around 21 minutes into the first track, quitting playback after two short and one long hangs 'waiting for video buffers.'

Playback as a Video of an .iso file regenerated from the DVD by K3B is fine.

An .mpg file extracted by mplayer from the .iso file, written over a new recording that had been converted to .mpg by MythDVBcut, and given a new seektable, also plays fine. A Project-X log (from MythDVBcut) shows nothing unusual except VobID chapter markers; I had never tried this procedure before and had never seen those. The output file from that final run of MythDVBcut also plays fine.

I had thought that I might see evidence of a multiplexing overrun in this log, but didn't.

I'm puzzled.

comment:32 Changed 14 months ago by Peter Bennett

When did the problem start? Did that DVD work before the latest changes?

Does it work on other playback profiles?

comment:33 Changed 14 months ago by jpilk

Peter: It did much the same in other profiles yesterday, although with the latest build it eventually unpaused and continued. Today, same setup, it quit after the long pause. It's unlikely that I had played that disk before - and scanning multiple 3-hour disks for random failures is not what I want to do. Please ignore unless it really appears to be happening routinely or you have a testable explanation. Cheers.

comment:34 Changed 14 months ago by jpilk

While looking at dmesg for unconnected reasons I found multiple segments like this:

[  793.821599] sr 1:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  793.821603] sr 1:0:0:0: [sr0] tag#0 Sense Key : Medium Error [current] 
[  793.821606] sr 1:0:0:0: [sr0] tag#0 Add. Sense: L-EC uncorrectable error
[  793.821610] sr 1:0:0:0: [sr0] tag#0 CDB: Read(10) 28 00 00 04 f1 2a 00 00 02 00
[  793.821613] print_req_error: I/O error, dev sr0, sector 1295528
[  793.821618] Buffer I/O error on dev sr0, logical block 161941, async page read

but, as previously noted, the .iso image recovered by K3B was passed by checkisomd5.

Note: See TracTickets for help on using tickets.