GNOME Bugzilla – Bug 796386
wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume
Last modified: 2018-11-03 14:24:03 UTC
Created attachment 372385 [details] [review] wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume Implement mute/volume getters setters using ISimpleAudioVolume. This allows setting those properties without delay and volume/mute changes will show up in sndvol.exe. ISimpleAudioVolume only works in shared mode, so keep the old way of muting around by setting the buffer to silent, to not break any existing code. Volume changes in exclusive mode have no effect atm. Also missing is event handling of external volume/mute changes through IAudioSessionEvents.
(this is on top of the patches in bug 796354)
Review of attachment 372385 [details] [review]: Thanks for working on this, it was on my TODO list. There's also https://bugzilla.gnome.org/show_bug.cgi?id=793059 which you might be interested in. :) ::: sys/wasapi/gstwasapisink.c @@ +248,3 @@ + IUnknown_Release (simple_audio_volume); + HR_FAILED_AND (hr, ISimpleAudioVolume::SetMute, return); + } Shouldn't this short-circuit in exclusive mode? @@ +257,3 @@ + HRESULT hr; + + /* FIXME: support exclusive mode */ Maybe this should be a GST_FIXME_OBJECT instead? @@ +275,3 @@ + float volume; + + /* FIXME: support exclusive mode */ ditto. @@ +302,3 @@ + HR_FAILED_AND (hr, ISimpleAudioVolume::GetMute, goto err); + self->mute = mute; + } Shouldn't this short-circuit in exclusive mode?
(In reply to Nirbheek Chauhan from comment #2) > Review of attachment 372385 [details] [review] [review]: > > Thanks for working on this, it was on my TODO list. There's also > https://bugzilla.gnome.org/show_bug.cgi?id=793059 which you might be > interested in. :) Do you happen to know if the wasapisink is worse in that area (switching/removing devices) compared to directsoundsink? > ::: sys/wasapi/gstwasapisink.c > @@ +248,3 @@ > + IUnknown_Release (simple_audio_volume); > + HR_FAILED_AND (hr, ISimpleAudioVolume::SetMute, return); > + } > > Shouldn't this short-circuit in exclusive mode? It still sets the volume so if the element would be restarted in shared mode the volume would be restored to that set value, it just has no noticeable effect in exclusive mode. But I can skip it if you want.
I've tested this in a win10 VM and it works, but I get: gstwasapiutil.c:342:gst_wasapi_util_get_simple_audio_volume:<wasapisink37> IAudioClient::GetService failed (88890001): AUDCLNT_E_NOT_INITIALIZED so something is missing there.
Created attachment 372436 [details] [review] wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume The volume getter can be called between open() and prepare(), so handle AUDCLNT_E_NOT_INITIALIZED in gst_wasapi_util_get_simple_audio_volume()
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/715.