Re: Default device notifications
Re: Default device notifications
- Subject: Re: Default device notifications
- From: Jeff Moore <email@hidden>
- Date: Fri, 28 Jul 2006 15:58:32 -0700
AMS == /Applications/Utilities/Audio MIDI Setup.app
At any rate, I just tested what you described and I saw every app on
the system notice the change in default device when I went from "line
in" to my USB mic in the Sound Prefs. HALLab (which is one of the
apps in our SDK) happily displayed the notification when it came in.
Default device notifications happen on the process's main thread as
they are transported around the system using a
CFDistributedNotificationCenter. This is different from device died
notifications, which happen on the HAL's notification thread. Perhaps
you are not tasking the main thread's run loop (hard to do in a Cocoa
app, but easy to do pretty much everywhere else)? This would
effectively prevent the HAL from receiving the notification from the
other process and so the HAL wouldn't be able to tell you.
On Jul 28, 2006, at 3:51 PM, John Haggerty wrote:
Actually, I am trying to change between Line in and a USB mic. No
notifications if I change the device in System Preferences, but I
do get a notification if the default device is the USB mic and I
remove it. And at the risk of appearing a complete gumby, what is AMS?
On 7/28/06, Jeff Moore <email@hidden> wrote: Let me guess, you
are switching from "line in" to "built-in mic" or
something like that?
The Sound Prefs panel has an expanded view of what a device is when
it comes to the built-in hardware. Instead of just listing the built-
in hardware as one device, it lists each entry in the built-in
hardware's data source selector control as if it was a device. You
can see the differences if you compare the device list displayed in
AMS with the Sound Prefs.
Whenever you select one of these "devices" you are in reality not
changing the default device, but rather changing the value of it's
data source selector control. So if you want notifications about
this, you need to pay attention to those notifications. Note however,
that this is complicated by the fact that not every device has a
source selector (including the built-in hadware on the various models
of Macs we have put out over the years) and that you'd only want to
listen to it when it's owning device is already selected as the
default device.
On Jul 28, 2006, at 3:09 PM, John Haggerty wrote:
> I am trying to set things up so that I get notifications when the
> default device is changed, for example via System Preferences.
>
> I am adding a callback thusly:
> AudioHardwareAddPropertyListener
> (kAudioHardwarePropertyDefaultInputDevice,...)
>
> This works if the actual hardware changes (e.g. if the default
> input device is a USB mic and I remove it) but not if I change the
> default device in System Preferences. Do I have to register another
> callback for this?
--
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:
40gmail.com
This email sent to email@hidden
--
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