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 <dlls/winealsa.drv/mmdevdrv.c:SimpleAudioVolume_SetMasterVolume> 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