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 775176 - directsoundsrc: Fixating to mono if 1-8 channels are possible
directsoundsrc: Fixating to mono if 1-8 channels are possible
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.10.x
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-27 15:14 UTC by Bob Squirrell
Modified: 2018-11-03 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screen shot of output (743.06 KB, image/jpeg)
2016-11-28 09:37 UTC, Bob Squirrell
Details

Description Bob Squirrell 2016-11-27 15:14:10 UTC
Left and right channels are combined to form two mono channels.  If source has left channel or right channel only, then the output is on both channels with no panning.
Comment 1 Nicolas Dufresne (ndufresne) 2016-11-27 16:26:58 UTC
If I remember well, Opus works by pair, and does not remember things like mono. This is solved by using a container format of course. What you describe seems like a suggestion for the libopus library. Do you have any pointers that GStreamer should use the library differently ?
Comment 2 Bob Squirrell 2016-11-27 19:18:25 UTC
My assumption is that if I encode a stereo source, the output after decoding should also be in stereo.  This was the case with an earlier version of GStreamer.  I have another computer with version 1.4.4-2 on it.  That version preserves the stereo.  Also a stream encoded on that computer decodes in stereo on the latest version which (I think) means that the problem is with the current (1.10.1) encoder.

Another way of looking at it, if I feed in a pair of audio channels which are different then I should get a matching pair coming out.  The encoder is making both channels the same.
Comment 3 Sebastian Dröge (slomo) 2016-11-27 20:30:32 UTC
Please provide exact steps to reproduce this, eg with gst-launch and describe what you see and how it should be different.

As Nicolas says, opus does not remember mono or stereo. It's codec configuration that is to be stored in the container (or eg sdp). There might still be a bug here though
Comment 4 Bob Squirrell 2016-11-28 09:05:36 UTC
I have a sound mixer connected to my PC so I can control the sound input.  If I use this pipeline then what I put in matches what comes out.

gst-launch-1.0 autoaudiosrc ! queue ! autoaudiosink

I then add in the opus encoder and decoder.

gst-launch-1.0 autoaudiosrc ! opusenc ! queue ! opusdec ! autoaudiosink

Now if I feed in stereo I get mono out.  If I only supply the left channel it comes out of both channels, likewise if I only supply the right hand channel.
Comment 5 Sebastian Dröge (slomo) 2016-11-28 09:14:49 UTC
Can you run that pipeline with "-v" and paste the output?
Comment 6 Bob Squirrell 2016-11-28 09:37:56 UTC
Created attachment 340883 [details]
Screen shot of output

As requested by Sebastian a screenshot showing the output with -v
Comment 7 Sebastian Dröge (slomo) 2016-11-28 10:12:44 UTC
Your source is outputting channels=1, opusdec is also outputting channels=1. Seems all expected here?

Or should your source output channels=2?
Comment 8 Bob Squirrell 2016-11-28 10:24:34 UTC
The source does output channels=(int)2 when the encoder is not in the pipeline
Comment 9 Sebastian Dröge (slomo) 2016-11-28 10:25:37 UTC
Does it work as expected with

> gst-launch-1.0 autoaudiosrc ! "audio/x-raw,channels=2" ! opusenc ! queue ! opusdec ! autoaudiosink
Comment 10 Bob Squirrell 2016-11-28 10:34:07 UTC
Yes that works as expected.
Comment 11 Sebastian Dröge (slomo) 2016-11-28 10:36:44 UTC
Then the problem is in directsoundsrc fixating to mono if 1-8 channels are possible.
Comment 12 GStreamer system administrator 2018-11-03 14:00:41 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/484.