After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796386 - wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume
wasapi: add a new volume property and implement volume/mute using ISimpleAudi...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.14.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-24 13:31 UTC by Christoph Reiter (lazka)
Modified: 2018-11-03 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume (9.05 KB, patch)
2018-05-24 13:31 UTC, Christoph Reiter (lazka)
reviewed Details | Review
wasapi: add a new volume property and implement volume/mute using ISimpleAudioVolume (9.36 KB, patch)
2018-05-27 16:07 UTC, Christoph Reiter (lazka)
none Details | Review

Description Christoph Reiter (lazka) 2018-05-24 13:31:55 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.
Comment 1 Christoph Reiter (lazka) 2018-05-24 13:33:20 UTC
(this is on top of the patches in bug 796354)
Comment 2 Nirbheek Chauhan 2018-05-25 13:34:50 UTC
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?
Comment 3 Christoph Reiter (lazka) 2018-05-25 18:36:14 UTC
(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.
Comment 4 Christoph Reiter (lazka) 2018-05-25 19:50:52 UTC
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.
Comment 5 Christoph Reiter (lazka) 2018-05-27 16:07:28 UTC
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()
Comment 6 GStreamer system administrator 2018-11-03 14:24:03 UTC
-- 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.