[PATCH] Mac OS X Audio with AudioUnits and AudioToolbox format converters
Hello, after some fiddling, it became apparent (to me, atleast) that using the "raw" CoreAudio for audio output is not going to work in all cases, and "fixing" it is troublesome: for example changing the sample rate takes a random amount of time, because all the applications involved in audio output must be notified, all the conversion filter chains must be rebuilt and so on. The way ao_macosx.c handles that simply can't be fixed. This patch proposes a move from the "raw" CoreAudio to the AudioUnit +AudioToolbox frameworks. The change provides several advantages, for example a better cooperation with other audio playing applications and (potential) usage of hardware accelerated sample rate and sample format conversion. (Atleast with my hardware case, the "clicks" in AC3 conversion are gone too.) The changed files are: libao2/ao_macosx.c use AudioUnits instead CoreAudio and provide sample rate and format conversion via AudioToolbox configure added the -framework AudioUnits and -framework AudioToolbox to the list of required frameworks.
This patch proposes a move from the "raw" CoreAudio to the AudioUnit +AudioToolbox frameworks. The change provides several advantages, for example a better cooperation with other audio playing applications and (potential) usage of hardware accelerated sample rate and sample format conversion.
Are those framework available on osx release prior to 10.3? if not, a new ao module should be created or a path for both system most be available in ao_macosx. Thank you for fixing the ao module. ==== Nicolas Plourde <nicolas.plourde@sympatico.ca>
Hi, On May 30, 2005, at 14:47 , Nicolas Plourde wrote:
This patch proposes a move from the "raw" CoreAudio to the AudioUnit+AudioToolbox frameworks. The change provides several advantages, for example a better cooperation with other audio playing applications and (potential) usage of hardware accelerated sample rate and sample format conversion.
Are those framework available on osx release prior to 10.3? if not, a new ao module should be created or a path for both system most be available in ao_macosx.
The V2 of the frameworks should be available since MacOS X 10.2, but I currently can't test it. As soon as I have some spare time I will extract my old 10.3 partition from the backup and try.
On Mon, May 30, 2005 at 08:49:11PM -0400, Nicolas Plourde wrote:
The V2 of the frameworks should be available since MacOS X 10.2, but I currently can't test it. As soon as I have some spare time I will extract my old 10.3 partition from the backup and try.
Ok, let me know, The point is not to break stuff for older release of OSX.
Do we run on anything below 10.2 or even 10.3 at all? Diego
Hello, On 31 May 2005, at 10:58 , Diego Biurrun wrote:
Ok, let me know, The point is not to break stuff for older release of OSX. Do we run on anything below 10.2 or even 10.3 at all?
The current CVS version (plus my AudioUnits patch) builds without changes under OSX 10.3 and 10.4 Under OSX 10.2 there's an issue with lrintf detection and with altivec code (you need to add -maltivec -faltivec to CFLAGS). I think it would be quite easy to create a configure switch to cross compile for older Mac OS X versions.
On 5-Jun-05, at 7:22 AM, Chris Roccati wrote:
The current CVS version (plus my AudioUnits patch) builds without changes under OSX 10.3 and 10.4 Under OSX 10.2 there's an issue with lrintf detection and with altivec code (you need to add -maltivec -faltivec to CFLAGS). I think it would be quite easy to create a configure switch to cross compile for older Mac OS X versions.
Geat! I will commit it. Hopefully it will also fix problem with m- audio device. Thank you ==== Nicolas Plourde <nicolas.plourde@sympatico.ca>
On May 31, 2005, at 02:49 , Nicolas Plourde wrote:
The V2 of the frameworks should be available since MacOS X 10.2, but I currently can't test it. As soon as I have some spare time I will extract my old 10.3 partition from the backup and try. Ok, let me know, The point is not to break stuff for older release of OSX.
Everything compiles and works fine as-is under Mac OS X 10.4.1 and Mac OS X 10.3.9. I could test under Mac OS X 10.2.x too but it will take some more time.
On 29-May-05, at 10:03 AM, Chris Roccati wrote:
Hello, after some fiddling, it became apparent (to me, atleast) that using the "raw" CoreAudio for audio output is not going to work in all cases, and "fixing" it is troublesome: for example changing the sample rate takes a random amount of time, because all the applications involved in audio output must be notified, all the conversion filter chains must be rebuilt and so on. The way ao_macosx.c handles that simply can't be fixed.
This patch proposes a move from the "raw" CoreAudio to the AudioUnit +AudioToolbox frameworks. The change provides several advantages, for example a better cooperation with other audio playing applications and (potential) usage of hardware accelerated sample rate and sample format conversion.
(Atleast with my hardware case, the "clicks" in AC3 conversion are gone too.)
The changed files are:
libao2/ao_macosx.c use AudioUnits instead CoreAudio and provide sample rate and format conversion via AudioToolbox
configure added the -framework AudioUnits and -framework AudioToolbox to the list of required frameworks.
<ao_macosx_audiounits.patch>
commited. ==== Nicolas Plourde <nicolas.plourde@sympatico.ca>
participants (3)
-
Chris Roccati -
Diego Biurrun -
Nicolas Plourde