Volume issue with CoreAudio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm currently working on an application that uses PJSip. I just integrated the latest 1.10 version.

I'm facing issues under MacOSX, when trying to change the volume of the device. I was previously using pa_dev and then I changed to coreaudio_dev, so that I could use the capabilities settings.

So now, I call the following code:

if(g_media_data.snd_port)
{
	pjmedia_aud_stream* stream = pjmedia_snd_port_get_snd_stream(g_media_data.snd_port);
	status = pjmedia_aud_stream_set_cap(stream,
				PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING,
				&normalized_volume);
}

which invoke the coreaudio_dev method ca_stream_set_cap.

Unfortunately, that method calls
ostatus = AudioUnitSetProperty (strm->io_units[1] ? strm->io_units[1] :
                                        strm->io_units[0],
                                        kAudioDevicePropertyVolumeScalar,
                                        kAudioUnitScope_Output,
                                        0,
                                        &volume,
                                        sizeof(Float32));

which return an error code and the volume is not set. Any idea where this issue comes from?

I read at some places on the Web that certain devices does not support setting the AudioUnit properties, and requires that you only set the Master volume. However, I only find source code related to deprecated method (AudioDeviceSetProperty, AudioHardwareSetProperty...). So in the case that is the solution, any idea how to do it?

Thanks already for any (helpful or not) answer.

Bat

PS: I'm currently working on a MacBookPro 2011.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110519/2e2e9b53/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux