Opened 16 years ago

Closed 13 years ago

Last modified 12 years ago

#5552 closed defect (fixed)

AC3 passthrough causes accelerated playback on OSX frontend

Reported by: scram69@… Owned by: JYA
Priority: minor Milestone: 0.25
Component: Ports - OSX Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When AC3 passthrough is selected on the OSX frontend, occasionally the video an audio begin playing at an accelerated rate. This usually happens when the show is not bookmarked - i.e. playback starts from the beginning of the file. It never happens if AC3 passthrough is un-checked. I've attached a log file. The accelerated playback session begins at the top of the file and ends at 21:29:24. The normal playback session begins immediately afterward at 21:29:25. The most obvious difference between the two is the appearance of a slew of " NVP: Video is x.xxxx frames behind audio (too slow), dropping frame to catch up." messages once playback begins in the first case.

Attachments (9)

accelandnormalplayback.rtf (28.2 KB) - added by scram69@… 16 years ago.
-v audio,libav,playback log file
mfe022goodvideo.txt (13.7 KB) - added by scram69@… 14 years ago.
normal 0.22 AC3 passthrough playback
mfe022accelvideo.txt (74.9 KB) - added by scram69@… 14 years ago.
accelerated 0.22 AC3 passthrough playback
toofast_backend.log.gz (341.5 KB) - added by myth@… 13 years ago.
OSX speedup backend log verbose=all
toofast_frontend.log (78.0 KB) - added by myth@… 13 years ago.
OSX speedup frontend log verbose=most
normal_playback.txt (22.4 KB) - added by scram69@… 13 years ago.
normal playback
accelerated_playback.txt (40.4 KB) - added by scram69@… 13 years ago.
accelerated playback
normal_playback_timestamp.txt (120.0 KB) - added by scram69@… 13 years ago.
Speakers->5.1 normal playback
garbled_playback_timestamp.txt (74.2 KB) - added by scram69@… 13 years ago.
Speakers->5.1 garbled playback

Download all attachments as: .zip

Change History (50)

Changed 16 years ago by scram69@…

Attachment: accelandnormalplayback.rtf added

-v audio,libav,playback log file

comment:1 Changed 16 years ago by ctreleaven@…

I have two Mac OS X machines. I've experienced this problem as well on my BE/FE machine running .21-fixes (different revs up to 17775). This machine is set up to use digital audio.

My remote frontend running .21-fixes has never experienced this problem.

I'm happy to produce more logs if that will help. The ones I've captured so far don't seem to show anything useful.

Craig

comment:2 in reply to:  1 Changed 16 years ago by ctreleaven@…

Replying to ctreleaven@cogeco.ca:

My remote frontend running .21-fixes has never experienced this problem.

And, of course, I should have been clear that the remote frontend uses analog audio output.

Sorry.

comment:3 Changed 16 years ago by stephen.hocking@…

I'm also seeing this, on trunk (SVN 18137). VLC on the same machine doing passthrough successfully plays back DVDs and the home theatre receiver lights up indicating that it sees an AC3 5.1 signal. This appears to be an OS/X specific problem.

comment:4 Changed 15 years ago by scram69@…

It appears this bug is getting worse. I just tried -fixes version 18900 from the Sniderpad. Now, following an episode of accelerated playback, I lose all sound output from my mac mini (under System Preferences > Sound, even the system alert sounds are greyed out). A reboot is required to restore functioning sound output.

comment:5 Changed 15 years ago by janh@…

I do have 2 Mac machines as backends and: Analog output/digital output (SPDIF): Smooth like butter (a few crashes now and then) AC3 passthrough: The frontend crashes most of the times and I have to REBOOT! my mac because the audio is gone from the whole system.

If that could be fixed MythTV would really be twice as useful.

I am so desperate I'm actually looking for a different frontend hardware because I'd love to enjoy the AC3 sound on my Home Theatre.

Thanks guys!! And keep up the good work.

Regards,

Jan.

comment:6 Changed 15 years ago by Nigel

OK. I am still trying to work this out. The original -v output doesn't show anything interesting, and I haven't been able to reproduce the fault with my two HD MPEG recordings (note that I don't have an AC3 decoder handy, so this is tedious to test).
Guys, is it _always_ the same recording, at the same place? If so, please find me one that does it at the start, and provide a few MB of that recording so I can try it here.
If the people who have crashes could please provide logs (e.g. ~/Library/Logs/CrashReporter?/mythfrontend.crash.log), it will also give me something solid to look into.

comment:7 in reply to:  6 Changed 15 years ago by ctreleaven@…

Replying to nigel:

Guys, is it _always_ the same recording, at the same place?

Nigel: Nope, often I'll try to start playing back a recording from the beginning and have it play in accelerated mode 2 or 3 times in succession and finally play properly.

Very recently, I've noticed that if I skip forward (60 second jumps) a few times, a file that started with accelerated playback will then switch to play normally. I've got to try this more to see if there is a magic sequence.

BTW, I'm running under 10.4.11 as others reported worse problems with 10.5 and above.

Craig

comment:8 Changed 15 years ago by stephen.hocking@…

I'm currently running trunk under 10.5.6, the first time one goes to play an AC3 soundtrack directly to SPDIF it ssems to work, but if you attempt to adjust the speed you either lose sound or it sounds like it's coming from underwater. The sound subsystem is then trashed and you have to reboot to get it working again.

comment:9 in reply to:  6 Changed 15 years ago by anonymous

Replying to nigel:

If the people who have crashes could please provide logs (e.g. ~/Library/Logs/CrashReporter?/mythfrontend.crash.log), it will also give me something solid to look into.

Here's what I believe to be the relevant snippet from my log:

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.406 AFD: codec AC3 has 2 channels

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.407 AFD: Opened codec 0x10d0c00, id(AC3) type(Audio)

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.407 AFD: codec AC3 has 2 channels

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.408 AFD: Opened codec 0x10d1000, id(AC3) type(Audio)

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.408 AFD: codec AC3 has 2 channels

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.408 AFD: Opened codec 0x10d1400, id(AC3) type(Audio)

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.414 Opening audio device 'CoreAudio:'. ch 6(2) sr 48000

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.414 AudioOutputCA Error: StreamsList?() - could not get list size: 560227702

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.414 AudioOutputCA Error: Configured for AC3 passthru but can't find an AC3 output stream. Disabling audio to prevent static

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.414 AudioOutput? Error: Aborting reconfigure

2/18/09 9:40:21 PM [0x0-0x104104].org.osx-bundler.MythFrontend[1587] 2009-02-18 21:40:21.414 NVP: Disabling Audio, reason is: Aborting reconfigure

Unfortunately, "Disabling audio" means disabling audio for all apps ... forever! I really wish mythfrontend would refrain from trashing my system that way. I have to reboot to get audio to work again for any app...

comment:10 Changed 15 years ago by Nigel

Component: mythtvPorts - OSX
Owner: changed from Isaac Richards to Nigel
Status: newassigned

comment:11 Changed 14 years ago by stormshaker

I'm running 0.22-fixes (22764) on OSX 10.6.1. I have the same problem. After some testing though, it seems like it might be a problem on stopping playback rather than starting?

My settings for Audio are the simplest I can make: CoreAudio?, Passthrough: Default, Output channels 5.1, Passive Upmix, AC3 Passthrough on and SP/DIF passthrough on.

When I playback a recording that contains digital audio, I see the receiver switch over to Dolby Digital and the playback is perfect. Then press ESC to stop playback and return to the GUI, the receiver is still receiving Dolby Digital output. Go back to the same recording and play it again, it plays much faster than normal speed. Quit Mythfrontend and return to the desktop - receiver is still stuck on Dolby Digital. Go back into Mythfrontend and play the recording again - it plays at normal speed. Back to the GUI then play again, fast speed.

So it seems there's something left behind after the first playback of a recording with digital audio that affects subsequent playbacks. Restarting Mythfrontend is enough to clear it.

OS X 10.6.2 is out, I will repeat the tests under 10.6.2 after upgrading.

comment:12 Changed 14 years ago by Brian K Boonstra <(myth) (at) (boonstra.org)>

This is apparently still a problem on 10.5.x as well, as reported in AVS Forums in this post.

comment:13 Changed 14 years ago by stormshaker

Alas still no luck with OS X 10.6.2.

Changed 14 years ago by scram69@…

Attachment: mfe022goodvideo.txt added

normal 0.22 AC3 passthrough playback

Changed 14 years ago by scram69@…

Attachment: mfe022accelvideo.txt added

accelerated 0.22 AC3 passthrough playback

comment:14 Changed 14 years ago by scram69@…

I've added two new attachments made with the OSX 0.22 frontend. These were made running -v audio,libav,playback. One is for an instance with AC3 passthrough enabled and normal playback occurred; the other is for an instance with accelerated playback. I've looked carefully, and the only difference I can find between the two is the appearance of:

2009-11-17 20:39:15.728 NVP(1): Video is 4.39223 frames behind audio (too slow), dropping frame to catch up.

every few milliseconds during the accelerated playback.

comment:15 Changed 14 years ago by Brian K Boonstra <(myth) (at) (boonstra.org)>

The Plex guys recently had some AC3 problems that were worked around, as documented at http://forums.plexapp.com/index.php?showtopic=8979 .

comment:16 Changed 14 years ago by anonymous

Still an issue with 0.22-fixes (current as of today 2010-01-05) and Mac OS X 10.6 Snow Leopard. The 'Plex' discussion has not been of any help to our particular setup.

comment:17 Changed 14 years ago by anonymous

Is there a workaround for this issue? If it is not on passthrough, is there still a way to have it play AC3?

comment:18 Changed 14 years ago by robertm

Ticket locked: set

http://svn.mythtv.org/trac/wiki/TicketHowTo

Read. Then read again. Then never do that again.

comment:19 Changed 14 years ago by robertm

Status: assignedinfoneeded

Can anyone test trunk to see if this is still an issue? We haven't checked in with this ticket since the audio class rewrite.

comment:20 Changed 14 years ago by robertm

Status: infoneededassigned

comment:21 Changed 14 years ago by stuartm

Milestone: unknown0.24
Summary: AC3 passthrough causes accelerated playback on OSX 0.21 frontendAC3 passthrough causes accelerated playback on OSX frontend
Version: unknownTrunk Head

comment:22 Changed 13 years ago by Nigel

Milestone: 0.240.25

Still unable to reproduce. Won't be resolved in 0.24

comment:23 Changed 13 years ago by stuartm

Milestone: 0.25

Milestone 0.25 deleted

comment:24 Changed 13 years ago by robertm

Ticket locked: unset

Changed 13 years ago by myth@…

Attachment: toofast_backend.log.gz added

OSX speedup backend log verbose=all

Changed 13 years ago by myth@…

Attachment: toofast_frontend.log added

OSX speedup frontend log verbose=most

comment:25 Changed 13 years ago by anonymous

I've attached a couple logs for this (svn 26959 branch 0.24-fixes) with higher verbose settings, including some audio timecodes. I am available to run any other diagnostics requested: (myth) [at] (boonstra) [dt] (org)

comment:26 Changed 13 years ago by JYA

Status: assignedinfoneeded

Please test with either current trunk, or today's 0.24 and let me know if you are still experiencing the problem.

I have played a few samples, on a MBP on either a spdif optical out and a DisplayPort?->HDMI adapter; everything plays fine for me with every content I tried.

comment:27 Changed 13 years ago by JYA

Owner: changed from Nigel to JYA

Changed 13 years ago by scram69@…

Attachment: normal_playback.txt added

normal playback

Changed 13 years ago by scram69@…

Attachment: accelerated_playback.txt added

accelerated playback

comment:28 in reply to:  26 Changed 13 years ago by scram69@…

Replying to jyavenard:

Please test with either current trunk, or today's 0.24 and let me know if you are still experiencing the problem.

I have played a few samples, on a MBP on either a spdif optical out and a DisplayPort?->HDMI adapter; everything plays fine for me with every content I tried.

Attached are log segments for normal and accelerated playback, both of the same recording, using MythFrontend version: fixes/0.24 [v0.24-198-g0d3d3a4-dirty] from 2 Mar 2011. The results are eerily similar to those I posted 16 months ago: "Video is 3.xxxxx frames behind audio (too slow), dropping frame to catch up." every few milliseconds in the accelerated case, resulting in a framerate that averages around 60fps.

comment:29 Changed 13 years ago by JYA

Can you please provide some information: -OS version you are running -What hardware -What connectivity etc..

The issue is obviously with CoreAudio? not providing the right timestamps for the audio it's playing : this is the only thing that could cause that issue. So we now have to pinpoint why it's doing it.

comment:30 Changed 13 years ago by scram69@…

Here you go- OS version: 10.6.6 Hardware: 2009 Nvidia Mac Mini 2.0GHz core2duo 2GB RAM Connections: Audio: spdif optical out to DTS 5.1 receiver, Video: mini-DVI to HDMI 720p display

comment:31 Changed 13 years ago by JYA

Did you attempt the workaround you posted a while ago on the xbmc forum using the Audio MIDI setup ?

The difference between xbmc and mythtv is that mythtv can only use the default coreaudio device ; so you'll have to select the new audio device created in the preferences -> sound setup

comment:32 in reply to:  31 Changed 13 years ago by scram69@…

Replying to jyavenard:

Did you attempt the workaround you posted a while ago on the xbmc forum using the Audio MIDI setup ?

Is this the one:

forums.plexapp.com/index.php/topic/8979-found-work-around-for-audio-cutout-and-video-locking

If so, what would be the equivalent to the Plex setup instructions for MythFrontend? Thanks-

comment:33 Changed 13 years ago by JYA

You do everything the same but for the plex instructions.

In the MIDI utility, right click on the "aggregate device" and select "Use this device for sound output" Do no change anything in the System Preferes -> Sound. If you do, it will stop using the aggregate device automatically.

In mythtv, you simply select CoreAudio:Default

Oh, and make sure the mythtv build you are using is less than a week old ; some fixes went in.

comment:34 in reply to:  33 Changed 13 years ago by scram69@…

Replying to jyavenard:

You do everything the same but for the plex instructions.

In the MIDI utility, right click on the "aggregate device" and select "Use this device for sound output" Do no change anything in the System Preferes -> Sound. If you do, it will stop using the aggregate device automatically.

In mythtv, you simply select CoreAudio:Default

Oh, and make sure the mythtv build you are using is less than a week old ; some fixes went in.

Trying the "aggregate device" with Speaker Configuration -> 5.1 results in no sound. I see the following in the frontend log: 2011-03-06 20:30:12.851 AO: Original codec was AC3, signed 16 bit, 48 kHz, 6 channels

2011-03-06 20:30:12.854 AO: enc(1), passthru(0), canAC3(1), canDTS(1), canLPCM(0), configured_channels(6), 6 channels supported(1)

2011-03-06 20:30:12.854 AO: Reencoding decoded AC-3/DTS to AC-3

2011-03-06 20:30:12.854 AO: Creating AC-3 Encoder with sr = 48000, ch = 6

2011-03-06 20:30:12.855 DEnc: Init codecid=AC3, br=448000, sr=48000, ch=6

2011-03-06 20:30:12.855 [ac3 @ 0x8a45a640]No channel layout specified. The encoder will guess the layout, but it might be incorrect.

2011-03-06 20:30:12.855 DigitalEncoder::Init fs=1536, bpf=12 ofb=18432

2011-03-06 20:30:12.855 AO: Audio processing enabled

2011-03-06 20:30:12.855 AO: Opening audio device 'CoreAudio:' ch 2(6) sr 48000 sf signed 16 bit reenc 1

2011-03-06 20:30:12.856 AudioOutputCA Error: Configured for AC3 passthru but can't find an AC3 output stream. Disabling audio to prevent static

2011-03-06 20:30:12.856 AudioOutput? Error: Aborting reconfigure

2011-03-06 20:30:12.856 AudioPlayer?: Disabling Audio, reason is: Aborting reconfigure

comment:35 Changed 13 years ago by JYA

Well, organise to send me your mac mini (or identical model) so I can try it here. Because with all the mac I have, I can not reproduce this.

Also please post playing the same video with -v audio,playback,timestamp one log for when it works and one log when it keeps dropping packet

comment:36 in reply to:  35 Changed 13 years ago by scram69@…

Replying to jyavenard:

Well, organise to send me your mac mini (or identical model) so I can try it here. Because with all the mac I have, I can not reproduce this.

Yes, this is a valid point - it may be a mini-only hardware issue. However, shipping my frontend to Australia for troubleshooting may seriously impact my WAF :)

Also please post playing the same video with -v audio,playback,timestamp one log for when it works and one log when it keeps dropping packet

I will add the timestamp and test and post this evening. I see that the fix you mentioned went in on 2/28; the binary build I downloaded from the SF site is dated 3/02. So hopefully it includes your most recent change for re-encoded AC3.

Changed 13 years ago by scram69@…

Speakers->5.1 normal playback

Changed 13 years ago by scram69@…

Speakers->5.1 garbled playback

comment:37 Changed 13 years ago by scram69@…

OK, I've attached two more logfiles using -v audio,playback,timestamp. I had to edit out large chunks of repeated messages in the middle to keep the files under the limit.

With -v timestamp, playback is no longer accelerated, but instead the digital audio is slow and garbled, as if underwater...

comment:38 in reply to:  35 Changed 13 years ago by scram69@…

Replying to jyavenard:

Well, organise to send me your mac mini (or identical model) so I can try it here. Because with all the mac I have, I can not reproduce this.

I should point out that the issue occurs on both my Mac Mini's - the 2009 Nvidia graphics model, and an older 2006 model with the Intel GMA950 graphics.

comment:39 Changed 13 years ago by robertm

Status: infoneededassigned

comment:40 Changed 13 years ago by Github

Resolution: fixed
Status: assignedclosed

Rewrite of CoreAudio? driver.

While not everything is fixed yet, it is a step in the right direction.

-You can now select which device to use in the setup and not always have to use the default audio device. -Fixes #5552. -Properly set channel layout, under most circumstances, you shouldn't have to use Audio Midi Setup utilities

There are still bugs that I can't explain, probably due to my lack of deep knowledge of CoreAudio?, and it certainly ain't behaving as it should. In particular, switching from AC3/DTS bitstream back to PCM will fail except if you have selected the default output device. Until this is resolved, it is best to keep using the default output device.

Branch: master Changeset: 267cada976140ef35e24fd8bbac0b65f7155974d

comment:41 Changed 12 years ago by JYA

Apparently, the issue about switching from AC3/DTS back to PCM is a bug in OS X 10.6

In 10.7 the bug is worse, and the device become unusable until you go back into the system preferences and swap the audio default device.

Note: See TracTickets for help on using tickets.