Re: Allowing a user-space driver to be the default system driver
Re: Allowing a user-space driver to be the default system driver
- Subject: Re: Allowing a user-space driver to be the default system driver
- From: Jeff Moore <email@hidden>
- Date: Tue, 05 May 2009 11:25:17 -0700
FWIW, I went back and took a peek at the code from as far back as I
had on hand. If the Sound Prefs is getting
kAudioHardwareBadDeviceError when it is setting
kAudioHardwarePropertyDefaultSystemOutputDevice, it pretty much means
that the HAL failed to convert the AudioDeviceID that was passed as
the data to AudioHardwareSetProperty() into an internal representation.
Generally, this means that your plug-in might have some issues with
managing the life cycle of the devices. This would be more of a reason
to pop open HALLab on Tiger and see how your device looks and make
sure that everything works properly.
On May 5, 2009, at 11:02 AM, Jeff Moore wrote:
On May 4, 2009, at 11:14 PM, Eric Gorouben wrote:
Hi, Jeff,
Thanks for the reply,
I started by checking the properties. I first looked for any
obvious difference between Leopard and Tiger. I thought that, for
some reason, a call could send back a differnt status, but all
replies are identical, but
kAudioDevicePropertyDeviceCanBeDefaultSystemDevice never gets
called on Tiger.
I vaguely recall fixing a bug about that between Tiger and Leopard.
While incorrect, it's not a fatal problem.
Do you have any hint about more "sensitive" properties?
My driver gets asked for
kAudioDevicePropertyDeviceCanBeDefaultDevice
kAudioStreamPropertyTerminalType
kAudioDevicePropertyStreamFormat
kAudioDevicePropertyHogMode
kAudioDevicePropertyStreams
kAudioDevicePropertyUsesVariableBufferFrameSizes
kAudioDevicePropertyBufferFrameSize
kAudioDevicePropertyPreferredChannelsForStereo
kAudioDevicePropertyIOProcStreamUsage
If what you are returning for the value for these properties is the
same between the two versions of the system, I'd be hard pressed to
explain the difference in behavior regardless of what changed in the
HAL.
I wonder if the problem might be somewhere else? How does your
device perform in HALLab? Do all the properties display properly?
Thanks
Eric
Le 5 mai 09 à 01:47, Jeff Moore a écrit :
The default device management changed a good deal between Tiger
and Leopard. All the advice I was giving to Stéphane was geared
toward Leopard. In fact on Tiger, the criteria the HAL uses are
less stringent even.
That said, if System Prefs is spitting out
kAudioHardwareBadDeviceError when trying to set the system default
output device, it most likely means that the HAL didn't like the
answer it got back from the device about some of the properties it
was probing. It's difficult to remember that far back to give you
any guidance on what to look for, but you can start by seeing what
properties the HAL is querying on your device and what answers you
are returning. It might become clear what's going on just from that.
On May 4, 2009, at 2:14 PM, Eric Gorouben wrote:
I've found this post from 2005 and Jeff Moore's reply that
matches exactly my problem... but not the solution.
On Mar 24, 2005, at 7:40 AM, Stéphane Letz wrote:
We are developing a user-space driver (that implement the
AudioHardwarePlugIn.h API). What is the right way to allow this
kind of driver to be the default system output or input driver?
(When selecting our driver in AudioMidi setup as the default
system output or input, this "state" is not saved, thus when
opening again the AudioMidi setup, our driver does not appear as
default system output or input anymore.)
Jeff's reply
You need to implement the following properties in each device:
kAudioDevicePropertyDeviceCanBeDefaultDevice = 'dflt',
// a UInt32 where 0 means that the device cannot be selected as
the default
// device and 1 menas that it can. The isInput argument selects
which kind
// of default device is being queried.
kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = 'sflt',
// a UInt32 where 0 means that the device cannot be selected as
the default
// system device and 1 menas that it can. The isInput argument
selects which
// kind of default system device is being queried. Note that
this property can
// only be queried for output.
In addition, the HAL shell adds other restrictions including
(but not limited to) disallowing non-mixable devices as well as
non-linear PCM devices.
I implement both properties, my device is mixable and linear PCM.
I can't however, select it as the default system output device in
Tiger. It works perfectly in Leopard, but not in Tiger.
Sytem Prefernces sends me that error
2009-05-04 21:51:46.061 System Preferences[28053] Error !dev
occurred while trying to set default sOut device to 262
which means,
kAudioHardwareBadDeviceError: The AudioDeviceID passed to the
function doesn't map to a valid AudioDevice.
Is it related to the "...(but not limited to)..." above?
Does anybody have a solution?
Thanks in advance
--
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