Hi,
I’ve created a virtual audio device by implementing AudioHardwarePluginInterface.
If I build the plugin on 10.6, and then install the plugin on 10.6, I’m
unable to set it to be the default output device in Audio MIDI Setup. The
weird thing is if I build the plugin on 10.5, and then install the plugin on
10.6, I can successfully set it to be the default output device in Audio MIDI
Setup.
I’ve tried directly calling AudioObjectSetPropertyData,
and I’m able to set the default output device to other audio devices, but
I’m unable to set it to be mine. When I try to set the default output
to my device, AudioObjectSetPropertyData fails silently, i.e. it returns 0.
AudioObjectPropertyAddress inAddress;
inAddress.mSelector =
kAudioHardwarePropertyDefaultOutputDevice;
inAddress.mScope = kAudioDevicePropertyScopeGlobal;
inAddress.mElement = kAudioObjectPropertyElementMaster;
AudioObjectSetPropertyData (kAudioObjectSystemObject,
&inAddress, 0, NULL, sizeof(AudioObjectID), &defaultOutputID);
One thing that I’ve noticed is that when DoInitializeWithObjectID
is called, it passes in an AudioObjectID that is effectively ignored. The
initialization code calls AudioObjectCreate to create the virtual audio device,
and this function returns an AudioObjectID for the new AudioObject. The
AudioObjectID returned by AudioObjectCreate is the one that is used (for
publishing, attaching streams, etc.), rather than the AudioObjectID passed into
DoInitializeWithObjectID.
This seems problematic, because when I translate the virtual
audio device’s bundle ID to an AudioObjectID (using
kAudioHardwarePropertyPlugInForBundleID), the AudioObjectID that is returned is
the one that was passed into DoInitializeWithObjectID.
Is it possible to change the AudioObjectID of the new
AudioObject that is returned from AudioObjectCreate, so that I can properly
assign the AudioObjectID argument passed into DoInitializeWithObjectID to my
virtual audio device? And could the ignoring of this AudioObjectID
parameter be causing problems with setting my virtual audio device to the
system’s default output device?
Thanks,
Alex