[MAC] Hang on exit after playing movie with DTS audio?
#1
Question 
So I'm not quite sure when this particular bug cropped up - it's been a while since I spent any length of time running XBMC on my Mini (which is hooked up to an A/V receiver via optical audio).. But here goes:

Spec & Config

OSX 10.5.7
Mac Mini (Intel C2D 2.0GHz, GMA950)
Self-built SVN rev. 20856 (build Jun 1st)
Audio Output is set to 'Digital'
AC3 & DTS capable receiver set 'On'
Audio output device is 'Default Output Device'
Downmix multichannel to stereo is 'Off'
Sync playback to display is 'On'
A/V sync method is 'Video clock (Drop/Dupe audio)'


The Media

I'm playing back a 1080p H264 MKV with DTS audio.

Pastebin of mkvinfo: http://pastebin.com/f5b5bb02a


The symptoms
  • After playback (whether aborted via 'Stop' or the end of the movie), my AV receiver continues to display 'DTS' on it's display
  • No skin sounds are played on navigation
  • Attempting to exit XBMC results in a wedged process consuming 100% of one core, that never exits (requires a kill -9 to snuff the life from it)

Pastebin of complete debug enabled log: http://pastebin.com/f7b1e05ad
(Note that XBMC did not actually exit - it hangs immediately after writing the line 'NOTICE: unload skin' - at a guess when it attempts to play the skin 'exit' whoosh noise.. Technical, I know)

Pastebin of a 'good' clean exit, no media played: http://pastebin.com/m4d39b6f9


I'm thinking this is something in relatively recent SVN builds, but I couldn't tell you exactly when unfortunately Sad I don't see anyone else reporting this, which is odd.. and makes me think perhaps it's me..


The workaround

Switching from Digital to Analogue audio (stereo downmix down the optical out to the receiver - which then displays '48KHz PCM') resolves the problem, with the obvious lack of .. well.. digital audio Smile



If nobody has any ideas I can compile a debug enabled build and run that to force a core when XBMC gets wedged (then pump that through gdb), and given a bit more time I could install Xcode on the Mini and debug it myself.. I'm just kinda hoping one of the core devs has a penny-dropping moment and says 'ah, that'll be X' before I have to Smile

(My main dev machine is my MacBook which I can't hook up to the TV all that easily given cable logistics, or I'd already be debugging this.. or rather, attempting to!)


Thanks,
Aaron
Reply
#2
Do me a favor, and see if you can try playing 2 videos in a row, 2 MKVs with DTS preferably. Play one, stop it at any point, then start another.

For the last 2-3 OSX builds I have gotten an audio error as soon as I try to play a second video.

Also, when using PM3HD skin, I notice navigation sounds no longer play after my first video stops.

Using a mac mini and the toslink digital out.
Reply
#3
I think I might have seen that behaviour, too - I put it down to something else (having 'Resample Audio' selected even though that can't, as I understand it, work with passthrough optical audio) but now you mention it..

I'll test again tonight when I get home.
Reply
#4
Hmmm, I am trying to remember where the resample option is now and if I have it checked. I know I don't have downmix checked, and I have digital and DTS/DD ticked.
Reply
#5
By the way Aaron I got this issue starting around 3 SVN builds ago, using the public nightly copiled SVN builds (not my own) so it's not your compile. There must be some tinkering going on with audio in the latest SVNs.

I'd go back to Babylon, but the latest versions of Aeon being tested out require SVN builds so I am sorta stuck for now. Hoping someone can figure it out in the code. Once I find an SVN build that works I may just stop updating for a while. Wink
Reply
#6
So I just got home and tried this out - I turned off the audio sync stuff and:

Played my MKV for 30 seconds - worked OK, receiver showed DTS
Back to the menu - receiver still showed DTS, no menu sounds
Played my MKV for 30 seconds - worked OK, receiver shows DTS, plays audio
Back to the menu, still no sounds
Played my MKV and.. it got wedged on 'Waiting for audio thread to exit'

So I think I'm right - it's not unhooking the CoreAudio device at the end of playback.. I'd build up a debug build, but SVN won't compile right now Sad I suppose I need to install Xcode on the Mini anyway.. so off I go to do that!
Reply
#7
Wow, you are experiencing a different problem than I. Are you compiling your own SVN? If you get one that works and you can share on rapidshare or something similar I'd like to try it. The builds at the public SVN site 20881 from yesterday anyway...I get the "unable to initialize audio" error as soon as I try to play a second MKV file.

Similar issue anyway I think.
Reply
#8
Unfortunately, this is due to a bug/quirk in OSX. It is related to the way the audio device must be handled for passthrough content, as well as the asynchronous nature of CoreAudio. I have tried several solutions with little success as of yet, but will have a look at your debug log and see if it talks to me.

One last question. You had said that you disabled the audio-sync settings, but they are enabled in the log you posted. If you disabled them after posting, please post a current log as well.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


                                            Image
Reply
#9
Yep - the first logs posted above were all taken with the video smoothing & audio sync stuff turned on, I only turned them off for the last test (which I didn't collect full logs for) - I'll re-do that test a little later and post up.

Unfortunately it's a pretty debilitating bug - forcing a 'Force Quit' between watching movies Sad I'd have thought more people would be hitting it though - I mean.. don't most people use media centers hooked up to A/V gear and a good TV? Maybe not I guess! Smile


It's a bug that's popped up in Plex from time to time as well, I think - which also uses CoreAudio as far as I know - but not one that Plex suffers now..

I did try to compare the code of the two projects, but the CoreAudio component is implemented very differently - I really need to get a better handle on both the XBMC code and Plex code before I can make any meaningful comparisons.

All this also reminds me I should test the last two official releases (Babylon & Atlantis) and see if they suffer the same thing Nerd
Reply
#10
I have the same (annoying) problem with the latest SVN build. If I start one movie, the sound is fine, but if I start a second one it says: failed to initialize audio device, check your audio settings.

Bleh.
Reply
#11
Is it DTS only? I watched a whole bunch of AC3 audio episodes last night (with passthrough, ofcourse) without a problem. AV sync/resample stuff is disabled.

r20720 on that machine.

I'll test later tonight with DTS.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
The hang actually occurs in the GUI sounds code. You should be able to work around the problem temporarily by disabling them.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


                                            Image
Reply
#13
phi2039 Wrote:The hang actually occurs in the GUI sounds code. You should be able to work around the problem temporarily by disabling them.

Can you explain that please?
Reply
#14
I could, but it is not particularly interesting unless you are going to re-write the GUI sounds code. In short, the GUI sounds code 'waits' for playback to complete before allowing the app to exit. A quirk in CoreAudio causes this code to spin indefinitely, as it never believes the sound finishes. Use of 'passthrough' mode requires that the audio device be 'hogged' by dvdplayer. This invalidates any other CoreAudio clients, including the one used by SDL_mixer, which handles the GUI sounds. This would be simple enough to remedy, however, differences between OSX 10.4 and 10.5 complicate the problem. The complexities of CoreAudio as they relate to passthrough and similar scenarios are not well documented, and many assumptions are made as to how an application will behave. Also, the driver developer is given an inordinate amount of latitude with regard to how clients are handled, which further complicates the problem.

Ultimately, what I will need to resolve this is DATA, so please post a log and a detailed problem description if you are experiencing the same issue.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


                                            Image
Reply
#15
I have the same (annoying) problem with the latest SVN build. If I start one movie, the sound is fine, but if I start a second one it says: failed to initialize audio device, check your audio settings.

But with a log:
http://pastebin.com/md9853a3

Edit: cranky people may be offended, so an edit.
Reply

Logout Mark Read Team Forum Stats Members Help
[MAC] Hang on exit after playing movie with DTS audio?0