Re: missing the first IOAudioSelectorControl notification?
Re: missing the first IOAudioSelectorControl notification?
- Subject: Re: missing the first IOAudioSelectorControl notification?
- From: Brett George <email@hidden>
- Date: Fri, 25 Jan 2008 13:41:41 -0800
Jeff Moore wrote:
On Jan 25, 2008, at 10:29 AM, Brett George wrote:
I receive the notification when the user changes the control in AMS
and everything usually works great. The trouble is that when the
driver is first loaded (either manually, or after install and reboot),
the value of the source parameter is recalled (presumably from the
CoreAudio daemon), but I do not get a notification that this change
has occured.
Yes. When coreaudiod first launches, it will blast back the values for
your controls that it saved the last time the daemon shut down.
So on startup, the driver is out of sync with the value of the
controls. If I toggle the control, everything works as expected.
Am I doing something incorrectly to not receive this first
notification, or is there another way I can recall this "default" state?
From my reading of the IOAudio family's IOAudioControl code, when the
HAL sets a value on your control, it ends up calling
IOAudioControl::setProperties which ultimately calls
IOAudioControl::setValue(OSObject*). The main area I can see that might
cause trouble is if IOAudioControl::validateValue() returned an error or
the value member of your IOAudioControl object is somehow already set to
the value that is coming in or is NULL or something like that.
I created a subclass of IOAudioSelectorControl and overrode the setValue
virtuals. As you say, they are being called when the driver loads, but
their value always returns kIOReturnSuccess (=0).
I just noticed that the change handler is being called correctly when
the selection value is non-zero. Maybe the selection values cannot be
zero (as one of mine is)?
Anyway, I changed the values and its working now.
Thanks,
Brett.
_______________________________________________
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