Page 1 of 1

Mac AC3: Trying to figure out how DVDPlayer does it

Posted: 11 Mar 2005 21:15
by gusax
I downloaded the CHUD tools from Apple and it included an application called Shark that is supposed to help when developing programs because it shows how often different parts of the source code is run. Or something like that :-)

Anyway I let Shark work on DVDPlayer, once with ac3 passthrough turned on and once with it turned off. I have tried to make something out of the files but I don't understand all the calls to this and that.
The conversion to PCM-audio is pretty visible though.

I saved the outputs from Shark in the following archive:
http://c51.ib.student.liu.se/~gusax840/ ... c3Pcm.sitx (7 MB)
(You'll need Shark to view them, it's comes with the CHUD tools from Apple)

I'm asking because I'm trying to make a very simple program that only has one function - to play an ac-3 file just to try to find out how it "should" be done so that coreaudio.c can be fixed later on.

To DJ or a similar pro - do you think you can make something out of the Shark files?

Also I noticed that when DVDPlayer starts up with ac3 activated, the sound from iTunes mutes. That to me sounds like DVDPlayer is in "hog mode". Can't tell if thats true from the Shark files though :-(

Posted: 12 Mar 2005 17:05
by The DJ
not so much hog mode (though it probaly does that as well) but it sets "no mixing" mode. I'll try to look at this later, but i'm not really sure if i can do anything with it. I know very little about CoreAudio.

Posted: 14 Mar 2005 17:14
by gusax
CoreAudio is :-(
But thanks for taking your time!

I don't think Dvd player takes hog mode either.
I did a search for "hog" in shark and got no hits...

However when in PCM-mode it uses an AUHAL-object (can be found on two rows) that is completely missing when in ac3-mode. The AUHAL seems to be used when converting the ac3 to ordinary stereo sound.

Looks like we'll have to wait and see how much they have fixed in Tiger, it seems that Quicktime 7 supports multichannel audio so maybe there is a way to use that it instead of CoreAudio.

Posted: 14 Mar 2005 20:57
by The DJ
AUHAL is the method that should be used to send audio output to CoreAudio. It is basically a wrapper object around the functions that we still use. It was only created after 10.2

The fact that we still not fully understand how SPDIF output is supposed to be done on OSX is one of the reasons we still haven't done ONE thing about the problems with our VLC audio output core on OSX.

QT also uses CoreAudio. QT is no more than a media framework that drives the hardware wrappers (Quartz, CoreAudio and others)