• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to save/load custom audio driver properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to save/load custom audio driver properties


  • Subject: Re: How to save/load custom audio driver properties
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 9 Aug 2005 12:22:37 -0700

kAudioHardwarePropertyProcessIsMaster is there for exactly what it says it is for, namely, to specify when the HAL is running in what it considers the "master" process. In Tiger, this process is coreaudiod. As I mentioned in my other reply, plug-ins aren't loaded in coreaudiod for security reasons. So a plug-in should never see this property have a value other than 0.

Prior to Tiger, the master process was the first process to initialize the HAL and stick around. Usually, this ended up being the Login Window process. As such, there weren't any security risks and the HAL will load plug-ins in those processes. So you'd see this property be 1 in the right process.

As for how to save the settings from your plug-in, you can read/write them using CFPreferences into the "any user", "any app" and "current host" domain. Here's the catch: the HAL is exceptionally lazy about loading plug-ins. Basically, your plug-in won't get loaded until the process actually asks the HAL about a property that your plug-in might implement. This means that you really can't count on your plug- in being loaded in any specific application. It might be loaded on one run of an app, but a different run using a different code path in the same app could leave your plug-in unloaded.

What this means is that you really can't rely on your plug-in for saving/restoring your device's settings. You need to do it outside of the plug-in somehow.

On Aug 8, 2005, at 6:10 AM, Fabian Renn wrote:

Hello list members,

i'm programming a driver for a usb audio device. The device has some custom features like setting the speed of the led level meter on the device. To allow the user to change this setting, i programmed an audio driver plugin that implements the custom property 'METR', a boolean value to set the led meter speed mode either to 'fast' or to 'slow'. Now i'd like to somehow save this value. So that when the user removes the device and plugs it in again at some other time, it should change the meter speed to the last set value. My idea was: that the audio driver plugin loads in the setting from a preference file when the function AudioDriverPlugInOpen of my audio driver plugin gets called . In the Core Audio headers I found a property called kAudioHardwarePropertyProcessIsMaster, commented that a driver plugin should load it's settings if this property is set. But my audio driver plugin never gets loaded with this property set to true, further more, my audio driver plugin only gets loaded when i open Audio MIDI Setup, iTunes etc. What should i do? What would be the common way to load/save settings of the driver? And whats the kAudioHardwarePropertyProcessIsMaster property for?

Greetings

Fabian_______________________________________________
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



--

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
References: 
 >How to save/load custom audio driver properties (From: Fabian Renn <email@hidden>)

  • Prev by Date: Re: iTunes stuttering, and don't shoot me--it might involve Core Audio
  • Next by Date: Re: IO Cycle Telemetry, USB Audio and AC-3 questions
  • Previous by thread: How to save/load custom audio driver properties
  • Next by thread: IO Cycle Telemetry, USB Audio and AC-3 questions
  • Index(es):
    • Date
    • Thread