Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#5265 closed patch (fixed)

AVSync problem with certain BBC programmes

Reported by: jackanddougal@… Owned by: Isaac Richards
Priority: critical Milestone: 0.22
Component: Video Playback Version: 0.21-fixes
Severity: high Keywords: easy
Cc: Ticket locked: no

Description

Since changing the video card in my machine to one that actually supports interlaced-output (connected directly to a TV via an VGA->RGB-Scart lead), I attempted to use XvMC as the software decoding was too slow to generate the full resolution display (only a 800MHz PIII:)).

This all appeared to be good except for certain BBC programmes (generally the high budget dramas and the like) which have very bad audio/video sync issues, including stuttering, pauses etc. In fact, when I set the recording to start 5 minutes early, the content before the programme is fine, but as soon as the programme starts (within frames) the problem occurs.

After many hours looking at the decoder, playback and audio playback loops, and adding addititional logging in these areas, I determined that the root cause is that these programmes have multiple audio streams in them, #1 (the main stereo feed) one running typically 260ms behind the video stream, #2 (audio description) ruinning around 700ms ahead of the video stream.

The problem is that the 'lastapts' value is set whenever either audio stream is decoded (so it swings by around 1000ms total) which confuses the playback code.

The solution is to only set 'lastapts' when you are actually decoding the audio stream that is playing. A patch is attached (based on 0.21-fixes) to do this.

I don't know why this only effects XvMC rather than the software decoders, but I suspect it is due to having a limited number of XvMC frame buffers available.

This problem has existed ever since the 'properly support multiple audio streams' change went in at 4281, so it may well account for the large number of NVIDIA users on the web complaining about choppy playback with SDTV content.

Cheers

Daniel

Attachments (1)

mythtv-0.21-avsync.patch (1.2 KB) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by anonymous

Attachment: mythtv-0.21-avsync.patch added

comment:1 Changed 12 years ago by jackanddougal@…

Any chance of this being applied to trunk and/or 0.21-fixes at some point?

comment:2 Changed 11 years ago by laga

Keywords: easy added
Type: defectpatch

comment:3 Changed 11 years ago by laga

Component: mythtvVideo Playback

comment:4 Changed 11 years ago by stuartm

Milestone: unknown0.22
Priority: minorcritical
Severity: mediumhigh

comment:5 Changed 11 years ago by Janne Grunau

Resolution: fixed
Status: newclosed

(In [19243]) set lastapts only from the selected audio stream. Fixes #5265

Fixes AV-Sync problems with recordings with multiple audio streams and diverging timestamps

comment:6 Changed 11 years ago by Janne Grunau

(In [19244]) backports [19243] from trunk. Refs #5265

Note: See TracTickets for help on using tickets.