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 744383 - directsoundsrc: volume and mute control
directsoundsrc: volume and mute control
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-12 10:39 UTC by Victor Toso
Modified: 2015-03-31 10:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
directsoundsrc: volume and mute control (13.63 KB, patch)
2015-02-12 10:41 UTC, Victor Toso
none Details | Review
directsoundsrc: v2 (13.62 KB, patch)
2015-03-13 10:12 UTC, Victor Toso
committed Details | Review

Description Victor Toso 2015-02-12 10:39:24 UTC
This patch is about DirectSoundSRC implementing GstStreamVolume and controlling volume and mute with Mixer API [0] as IDirectSoundCapture [1] interface doesn't have volume control.

[0] https://msdn.microsoft.com/en-us/library/ms932053.aspx

I've tested mainly with Windows 7 and Windows XP.
Comment 1 Victor Toso 2015-02-12 10:41:35 UTC
Created attachment 296667 [details] [review]
directsoundsrc: volume and mute control
Comment 2 Julien Isorce 2015-03-11 14:44:32 UTC
Review of attachment 296667 [details] [review]:

Hi, thx for the patch. That's good you implemented the gststreamvolume interface for directsoundsrc.
I don't see anything wrong. I am not against using the MIXER interface. Was it not possible to do something similar than directsoundsink ? (http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/sys/directsound/gstdirectsoundsink.c#n829)
It has the advantage to avoid looking for the right device.

::: sys/directsound/Makefile.am
@@ +6,3 @@
 libgstdirectsoundsrc_la_LIBADD = \
 	$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \
+	$(DIRECTX_LDFLAGS) -lwinmm -ldsound

It should be $(DIRECTSOUND_LIBS) (like for directsounsink element in -good package)
Comment 3 Victor Toso 2015-03-13 10:10:59 UTC
(In reply to Julien Isorce from comment #2)
> Review of attachment 296667 [details] [review] [review]:

Thank you for the review.
 
> I don't see anything wrong. I am not against using the MIXER interface. Was
> it not possible to do something similar than directsoundsink ?
> (http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/sys/directsound/
> gstdirectsoundsink.c#n829)
> It has the advantage to avoid looking for the right device.

It is a bit easier for IDirectSoundBuffer as it has SetVolume which is not the case for the CaptureBuffer :-(
I looked for a way to avoid the search for the right device but looks like this is how this Mixer API works. I'm not a windows expert so I could be wrong here.

> 
> ::: sys/directsound/Makefile.am
> @@ +6,3 @@
>  libgstdirectsoundsrc_la_LIBADD = \
>  	$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \
> +	$(DIRECTX_LDFLAGS) -lwinmm -ldsound
> 
> It should be $(DIRECTSOUND_LIBS) (like for directsounsink element in -good
> package)

Thanks, fixed!

It is worth noting that I've tested it with 1.4 as I'm building with mingw-packages in fedora.
Comment 4 Victor Toso 2015-03-13 10:12:25 UTC
Created attachment 299297 [details] [review]
directsoundsrc: v2

v2: fix Makefile.am to use $DIRECTSOUND_LIBS
Comment 5 Julien Isorce 2015-03-30 12:48:53 UTC
Review of attachment 299297 [details] [review]:

You are right there is no other way. Also I missed your comment in commit message, thx for the update. I'll push it soon.
Comment 6 Julien Isorce 2015-03-31 10:00:33 UTC
Comment on attachment 299297 [details] [review]
directsoundsrc: v2

commit 1b564bfb8b0db43a24cf311dca24038558b80a68
Author: Victor Toso <victortoso@redhat.com>
Date:   Tue Mar 31 10:53:55 2015 +0100

    directsoundsrc: Implement volume and mute
    
    Using the MixerAPI as IDirectSoundCaptureBuffer doesn't implement volume
    control.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744383