Re: How to correctly set input gain for a HAL device?
Re: How to correctly set input gain for a HAL device?
- Subject: Re: How to correctly set input gain for a HAL device?
- From: Jeff Moore <email@hidden>
- Date: Tue, 20 Dec 2005 11:43:41 -0800
On Dec 20, 2005, at 12:00 AM, Rustam Muginov wrote:
Hello all.
How to correctly set input gain for a HAL input device?
As far as I understand, i should first check if master-channel is
available for input.
If device does have master-channel, then use it to set gain.
If device does not have master-channel, iterate thru all channel
and set gain individually.
Is it correct?
It's a decent algorithm that will work for most bits of hardware. It
is ambiguous when the device has both a master volume and an
individual volume on the channel.
Should the same method be applied then setting output volume of HAL
device?
It can be.
Could anyone provide "algorithm" or pseudo-code for this?
Not as such, but the basic building blocks can all be found in the
HALLab sample code.
Yes, i know that I should use AUHAL functionality, but I need to
support two version of interfaces for interfaces, both HAL and
AUHAL for some time.
AUHAL is not necessarily going to help you here. It does reflect the
various HAL properties of the device it's talking to through the AU's
property accessors, but it doesn't really save you anything over
dealing with the HAL directly when manipulating a device's controls.
All that said, most applications have no business touching hardware
controls. There are exceptions of course, but by and large, it is
best to let the user control hardware settings through the
appropriate system UI like the Sound Prefs panel or Audio MIDI Setup.
--
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