Re: plugin to query hardware status
Re: plugin to query hardware status
- Subject: Re: plugin to query hardware status
- From: Jeff Moore <email@hidden>
- Date: Mon, 8 May 2006 15:18:12 -0700
On May 8, 2006, at 12:22 PM, david tay wrote:
I currently use a HALPlugin to provide some custom controls to a
user space application.
From the exisiting HAL documentation,
values for controls are obtained as follows
valueAsCFTypeRef = IORegistryEntryCreateCFProperty
(controlConnection, CFSTR("IOAudioControlValue"),
kCFAllocatorDefault, 0 );
if (valueAsCFTypeRef) {
CFNumberGetValue((CFNumberRef) valueAsCFTypeRef, ...);
...
}
This allows one to take values stored in the IORegistry.
I see. You already have a HAL plug-in but you are looking to do
something specific with it.
How would one set things up so that the user client can call a
specific function in the driver that sends commands querying the
hardware like the custom user client which bypasses the HAL?
One easy way to do this is to just use the IORegistry. The user-land
code would just get/set values in the IORegistry entries of your
driver objects. The upside of this is that it is really easy to
implement both in user-space and in your kernel objects. The downside
of it is that the IORegistry has to do a lot of work to move the data
between the kernel and user-space. So, you wouldn't want to do it
this way if you are expecting to have to query/change this
information a lot.
Otherwise, you have to do this the same way as any other IOKit driver
does. You have have to write your own sub-class of IOUserClient.
Then, your user-land code can call IOServiceOpen() to specifically
open your special user-client object. From there, you have all the
services of IOKit for passing information back and forth between the
driver and your plug-in.
I would like to keep everything as a custom HAL client so that the
application developers can use the standard AudioDeviceGetProperty
(), AudioDeviceSetProperty() calls without having to resort to
using an alternate user client interface.
Most, if not all, applications aren't going to know a single thing
about your custom properties. As such, it would be unwise to rely on
the applications to do the right thing (or really do anything) with
them. If you are trying to expose some aspect of your hardware that
isn't covered by the standard set of properties, your best bet is to
just write an application yourself that can do the right thing, like
what MotU or Metric Halo do. Otherwise, your great hardware feature
will languish in anonymity.
David
Date: Mon, 8 May 2006 11:23:25 -0700
From: Jeff Moore <email@hidden>
Subject: Re: plugin to query hardware status
To: CoreAudio API <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
You'll need to provide more context before I can give you a good
answer.
On May 6, 2006, at 3:19 PM, david tay wrote:
How would one create a HAL plugin that sends commands directly to
the hardware asking for various status bits?
--
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