Re: User-land CoreAudio driver and Leopard
Re: User-land CoreAudio driver and Leopard
- Subject: Re: User-land CoreAudio driver and Leopard
- From: Jeff Moore <email@hidden>
- Date: Thu, 8 Nov 2007 12:27:36 -0800
On Nov 8, 2007, at 2:04 AM, Stéphane Letz wrote:
On Nov 7, 2007, at 3:36 AM, Stéphane Letz wrote:
Our user-land CoreAudio driver does not completely work on Leopard:
- it can not be seen as "default input/output" driver for
applications like iTunes or QuickTime player that use default input/
output devices. What has change under Leopard that could explain
this new behaviour?
The most likely change is that your plug-in is failing to work
properly when loaded by coreaudiod. Prior to Leopard, your plug-in
would not be loaded by coreaudiod, so you probably never had to cope
with running in a daemon outside of any user login session. This
usually leads to problems where the plug-in can't communicate with
it's daemon because of the bootstrap session differences.
Can you explain a little more what this "coreaudiod" deamon is about?
Coreaudiod's purpose in life prior to Leopard was to save/restore
device settings at shutdown/boot and to provide a home for the System
Sound Server, which is what plays interface sounds, alert sounds, and
what not (see <AudioToolbox/AudioServices.h> for more info).
In Leopard, we expanded some of cordaudiod's duties. First and
foremost, we created the new AudioHardwareServices API (found in
<AudioToolbox/AudioServices.h>). This API allows you to query audio
hardware without having to incur the overhead of the HAL. For example,
you can enumerate all the devices, check their physical formats, and
change the volume with this API without directly calling into the HAL.
This API is implemented by having the client API calls message
coreaudiod for the requested information. As part of this, the
management of the default device setting for each user has also passed
to coreaudiod.
In order to make this work for all audio devices, regardless of what
driver mechanism they use, we had to change coreaudiod so that it
would now load user-land drivers in addition to supporting the IOAudio-
based drivers. The environment that coreaudiod operates in is outside
of any user's login session or any user's bootstrap session.
- we still implement the kAudioHardwarePlugInInterface2ID version of
the AudioHardwarePlugIn.h header, but the header has now a
kAudioHardwarePlugInInterface4ID version whith much more functions.
Can we stay with the kAudioHardwarePlugInInterface2ID version?
While your version 2 plug-in should continue to work just fine modulo
getting it to work in coreaudiod, I strongly advise moving to version
4 for two reasons. First, you really ought to support the full API
natively (v3 and v4 added several new calls). Second, only v4 plug-
ins
will be loaded into 64 bit processes.
To help you out, we have included a full HAL plug-in SDK in Leopard.
You can find it in /Developer/Examples/HAL/SampleHardwarePlugIn.
- some function like AudioHardwareDevicePropertyChanged,
AudioHardwareStreamsDied... are now deprecated. What has to be used
instead?
They are deprecated in favor of AudioObjectCreate,
AudioObjectsPublishedAndDied and AudioObjectPropertiesChanged. Note
that you can see these calls in action in the plug-in SDK.
Thanks! This finally should allows us to develop a cleaner and more
compatible driver. This is really nice, even if we have now a bit of
work to use the SDK.
Please feel free to ask questions here. I'm happy to help you use that
code.
Will a driver developed with the SDK still load under Tiger or is it
a Leopard only thing?
Yes. It should work OK on Tiger. File bugs about anything that
doesn't. It's possible I missed some bit of compatibility support.
I compiled the SampleHardwarePlugIn, put it in /Library/Audio/Plug-
Ins/HAL/. The driver is correctly seen by HALLab and AMS, but it
seems it can not be used as the default input/output device (in
AMS). What has to be done for that?
The HAL doesn't dynamically load plug-ins, so you have to re-launch a
process for it to notice new ones. My guess is that you need to kill
coreaudiod so that it relaunches and loads the new plug-in or just
reboot.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden