Re: WASAPI ISimpleAudioVolume::SetMasterVolume appears to not work

2012-04-16 Thread Andrew Eikum
Hi Adam,

On Sun, Apr 15, 2012 at 12:06:14AM +0100, adam smith wrote:
> I've been trying to get WASAPI audio output working for our app as
> Directsound output was very glitchy post the new audio stack.
> 

Sorry to hear that. We do have a large sequence of patches just about
ready to go into Wine which will improve directsound greatly, but
they're not in quite yet.

> All seems to work great with WASAPI however I need to able to set the
> volume level independently for individual audio sessions / streams for
> crossfading however I'm having problems controlling the volume levels of a
> shared mode audio session / stream. specifically,
> 
> ISimpleAudioVolume::SetMasterVolume ... returns success but does not
> change the volume level though interestingly
> 

Yes, this is a limitation of the ALSA and OSS drivers. You can see
that 
actually doesn't do anything. This is because ALSA and OSS don't
support per-stream volume control. For example, if we set the volume
on an ALSA device, it will actually affect the volume of _every_
stream that uses that ALSA device, which isn't what we want.

> HRESULT hr;
> hr=audioClient_->GetService(IID_ISimpleAudioVolume,(void**)&simpleAudioVolume_);
> if (SUCCESS(hr))
> hr=simpleAudioVolume_->SetMute(TRUE,NULL);
> 
> does work and mute the volume.
> 

Yes, we have some logic to allow muting to work, by just setting the
samples sent to ALSA to silence. Again, this is because muting the
ALSA device would result in muting _every_ stream using that device.

> Does anyone have any experience of these interfaces or know equivalent
> interfaces to use instead
> 

Sorry, Linux's audio systems just don't have the capabilities to let
Wine do this. We would need to build a software mixer into Wine to do
volume control, and we don't have that (yet).

Andrew




WASAPI ISimpleAudioVolume::SetMasterVolume appears to not work

2012-04-14 Thread adam smith
Hi,

I've been trying to get WASAPI audio output working for our app as
Directsound output was very glitchy post the new audio stack.

All seems to work great with WASAPI however I need to able to set the
volume level independently for individual audio sessions / streams for
crossfading however I'm having problems controlling the volume levels of a
shared mode audio session / stream. specifically,

ISimpleAudioVolume::SetMasterVolume

http://msdn.microsoft.com/en-us/library/windows/desktop/dd316537(v=vs.85).aspx

Doesn't seem to work under Wine i.e.

HRESULT hr;
hr=audioClient_->GetService(IID_ISimpleAudioVolume,(void**)&simpleAudioVolume_);
if (SUCCESS(hr))
 hr=simpleAudioVolume_->SetMasterVolume(0.1,NULL);

returns success but does not change the volume level though interestingly

HRESULT hr;
hr=audioClient_->GetService(IID_ISimpleAudioVolume,(void**)&simpleAudioVolume_);
if (SUCCESS(hr))
hr=simpleAudioVolume_->SetMute(TRUE,NULL);

does work and mute the volume.

I've also tried usingsthe IAudioStreamVolume interface to control the
volume again to no avail.

Does anyone have any experience of these interfaces or know equivalent
interfaces to use instead working I've tested on :

Ubuntu 10.04, 11.10
Wine 1.4 , 1.5 , 1.5.2
PulseAudio  0.9.21 , 1.0 , no pulse audio

(and windows 7 where the code works fine)


Thanks,

Adam