Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8792 closed defect (fixed)

DVD playback issues with 5.1 AC3 sound

Reported by: mythtv@… Owned by: JYA
Priority: minor Milestone: 0.24
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords: dvd 5.1 audio
Cc: Ticket locked: no

Description

Since updating mythtv from 25578 to 25612, playback of DVDs with 5.1 AC3 sound no longer works.

The DVD will play for a second or two then hang with copious "Waited 100ms for video buffers" errors.

If the frontend is reconfigured to a plain stereo audio config, then playback works as expected.

Attached are frontend -v playback,audio logs for the same DVD with both 5.1 and stereo audio configs.

Note: Audio is configured for AC3/DTS passthru in both cases. I also have the 48k override option enabled and my patch as per #8773 to skip resampling of 48k sampled audio (the problem occurs without this patch as well).

Attachments (3)

frontend-5.1.log (39.7 KB) - added by mythtv@… 9 years ago.
frontend log from failed 5.1 playback attempt
frontend-stereo.log (40.5 KB) - added by mythtv@… 9 years ago.
frontend log from successful stereo playback attempt
frontend-VOB-5.1.log (15.7 KB) - added by mythtv@… 9 years ago.
frontend log from successful 5.1 playback attempt of single VOB file

Download all attachments as: .zip

Change History (20)

Changed 9 years ago by mythtv@…

Attachment: frontend-5.1.log added

frontend log from failed 5.1 playback attempt

Changed 9 years ago by mythtv@…

Attachment: frontend-stereo.log added

frontend log from successful stereo playback attempt

comment:1 Changed 9 years ago by stuartm

Component: MythTV - DVD & Bluray PlaybackMythTV - Audio Output
Owner: changed from robertm to JYA
Status: newassigned

comment:2 Changed 9 years ago by JYA

Component: MythTV - Audio OutputMythTV - Video Playback

In first log, audio being played, as per the log: Original codec was AC3, signed 16 bit, 48 kHz, 2 channels

It's Stereo. Not 5.1.

In 2nd log, 5.1 audio trac is selected, but stereo configured.

In any case, there aren't any audio playback issue here, those are videos

Why force 48k resample btw?

comment:3 Changed 9 years ago by mythtv@…

The logs are slightly confusing as the DVD source runs through a number of title changes (which are mostly empty) before hitting the studio intro (which is where the problem occurs).

In both cases the last audio stream selected was English AC3 7ch. However, the audio code then opens the non-passthru device and tries to output 2ch audio. This works ok when the frontend is configured for stereo, but not when configured for 5.1 Oddly, in both cases - the audio is sent as PCM rather than an AC3 stream.

The problem in the 5.1 playback seems to be here:

2010-08-18 21:22:07.924 Player(0): Waiting for video buffers...
2010-08-18 21:22:07.924 AO: Pause 1
2010-08-18 21:22:07.929 AO: OutputAudioLoop: audio paused

Where the audio gets paused and never restarted.

To me it feels like and AV sync issue. It certainly seems to have been made worse by the recent dvdnav resync, but I was having intermittent problems with slowed audio playback before this (but only with DVDs).

I might try pulling out the relevent VOB file from the DVD and try playing that back on it's own.

As the 48k override, I've got a slightly broken Alsa driver which claims to support a range of sample rates, but if you actually use anything other than 48k, then the driver gets into a state where no audio output works until it is reloaded.

comment:4 Changed 9 years ago by JYA

Owner: changed from JYA to danielk

Changed 9 years ago by mythtv@…

Attachment: frontend-VOB-5.1.log added

frontend log from successful 5.1 playback attempt of single VOB file

comment:5 Changed 9 years ago by mythtv@…

I've pulled out the studio title from the DVD image and tried playing it on it's own. This time it plays correctly with 5.1 sound enabled (log attached). However, there's still something strange going on as the audio is re-encoded before being passed to the sound card despite already being in a form suitable for passthru transmission.

comment:6 Changed 9 years ago by mythtv@…

For anyone who wants to give this a try - I've created a cut-down copy of one of the offending DVDs. I've stripped out the actual movie, and just left the Studio's title sequence and the copyright screens. For me, the problem manifests about 2s into the studio title. You can download it from here: http://www.meric.id.au/files/coraline_test.tar.bz2

comment:7 Changed 9 years ago by mythtv@…

Forgot to add... the file is about 30MB.

comment:8 Changed 9 years ago by JYA

Owner: changed from danielk to JYA

Hi

Please try with r26250. It should fix why you were seeing the audio being re-encoded when it could be passthrough.

I have downloaded the video and noticed an issue on my machine, something weird is occurring though, ffmpeg shows the audio track has being 7 channels AC3, yet tells the audio framework that there are 6 channels.

comment:9 Changed 9 years ago by JYA

When I use mythvideo to play the disk, when playing the track, it shows: 2010-09-13 02:00:47.710 AFD: codec AC3 has 0 channels 2010-09-13 02:00:47.710 AFD: Opened codec 0x2dc2f00, id(AC3) type(Audio) 2010-09-13 02:00:47.710 AFD: Audio Track #1 is A/V stream #1 and has 0 channels in the English language(6647399). 2010-09-13 02:00:47.710 AFD: Audio is disabled - trying to restart it 2010-09-13 02:00:47.710 AFD: Selected track 1: English AC3 7ch (A/V Stream #1)

However, when playing the VOB alone, Coraline_Test/VIDEO_TS/VTS_03_1.VOB It shows:

2010-09-13 02:03:16.167 AFD: Opened codec 0x3bfb730, id(MPEG2VIDEO) type(Video) 2010-09-13 02:03:16.167 AFD: codec AC3 has 6 channels 2010-09-13 02:03:16.167 AFD: Opened codec 0x3bf9210, id(AC3) type(Audio) 2010-09-13 02:03:16.168 AFD: Audio Track #1 is A/V stream #1 and has 6 channels in the Undetermined language(7695972). 2010-09-13 02:03:16.168 AFD: Selected track 1: Undetermined AC3 5.1ch (A/V Stream #1)

Looks like a format decoding error

comment:10 Changed 9 years ago by JYA

Resolution: fixed
Status: assignedclosed

Change the way audio output object is created. Now, we do not destroy the audio output class object, instead we disable it. This allow to retrieve information about the audio capabilities such as the number of channels, if passthrough is available etc. The audio framework will now immediately return if it was fed rubbish and will not attempt to perform any initialisation. The greatly reduced the amount of open/close of the audio card. Fixes #8792. Issue occured as an invalid codec detection lead to the audio framework not being initialised ; in turn it became impossible for AVFD to detect the capabilities of the hardware

comment:11 Changed 9 years ago by Richard <mythtv@…>

I don't think we're quite there yet. The issue with playback hanging has been fixed, but I now have no 5.1 audio at all for any content. My guess is that it is related to my use of the separate passthru device (advanced options).

comment:12 Changed 9 years ago by JYA

Open a new ticket if you're having problem, and provide some logs

comment:13 Changed 9 years ago by JYA

Resolution: fixed
Status: closednew

Was re-reading that ticket. You wrote: "Since updating mythtv from r25578 to r25612, playback of DVDs with 5.1 AC3 sound no longer works."

I have looked at all changesets between r25578 and r25612 ; and I can find no changes related to audio nor general playback for that matter.

I am reopening this ticket, if you could go back to r25578 and recompile to find which changeset broke it for you it would be helpful. But at this stage, I'm thinking of more a local issue at your end than in mythtv.

You have a dodgy audio card to start with which has always been troublesome (like can't play other than 48kHz content)

comment:14 Changed 9 years ago by JYA

Status: newinfoneeded_new

comment:15 Changed 9 years ago by Richard <mythtv@…>

Ok, you can close this now - PEBCAK at my end. Reset the ALSA driver and all is good. Sorry for dragging it out.

comment:16 Changed 9 years ago by JYA

Resolution: fixed
Status: infoneeded_newclosed

well, we did find another issue thanks to this ticket..

comment:17 Changed 9 years ago by stuartm

Milestone: unknown0.24
Note: See TracTickets for help on using tickets.