• 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: Stereo panning with the HAL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stereo panning with the HAL


  • Subject: Re: Stereo panning with the HAL
  • From: "Mikael Hakman" <email@hidden>
  • Date: Wed, 7 May 2008 19:00:40 +0200
  • Organization: Datakonsulten AB

On May 07, 2008 3:25 AM, Andrew MacDonald wrote:


I'm trying to control the stereo panning on a Macbook using the HAL.
(Essentially I want the same functionality as provided by the
Balance bar in System Preferences -> Sound -> Output).

In principle it would seem pretty straightforward to use the
kAudioDevicePropertyStereoPan parameter with
AudioDeviceSetProperty(). However when checking for the property on
the "Built-in Output" device:

AudioDeviceGetPropertyInfo(device, channel, false,
kAudioDevicePropertyStereoPan, NULL, NULL);

kAudioHardwareUnknownPropertyError is returned for every channel. Is
this typical behaviour, and if so, is anyone aware of a different
way to obtain stereo panning functionality through the HAL?

If you want to implement balance then you could do that by controlling volume of the left and the right channel. I think this is was system does, but Jeff may correct me here. I also noticed that if a driver presents both master and separate channel volume controls, then the system will use the master when controlling the volume. If master control is not present then the system loops through channel controls and adjusts channel volume accordingly.


When implementing balance by controlling channel volumes, you may consider whether you want, during balance changes, to keep overall volume constant or not. Probably you would also need to register for volume change notifications so that you could readjust volumes to the desired balance when the user changes the volume itself.

If you by "panning" mean changing the width of stereo stage then this is much more difficult to do - you would need to continuously replace left and right signals by new computed ones.

Also, when an optical jack is inserted into built-in output connector then all volume controls disappear and the only alternative is to intercept the signals and make continuous signal change yourself. This is what I do in my virtual volume control.

/Mikael

_______________________________________________
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


  • Follow-Ups:
    • RE: Stereo panning with the HAL
      • From: Andrew MacDonald <email@hidden>
References: 
 >Stereo panning with the HAL (From: Andrew MacDonald <email@hidden>)

  • Prev by Date: Re: Stereo panning with the HAL
  • Next by Date: RE: Stereo panning with the HAL
  • Previous by thread: Re: Stereo panning with the HAL
  • Next by thread: RE: Stereo panning with the HAL
  • Index(es):
    • Date
    • Thread