GNOME Bugzilla – Bug 775176
directsoundsrc: Fixating to mono if 1-8 channels are possible
Last modified: 2018-11-03 14:00:41 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.
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 ?
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.
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
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.
Can you run that pipeline with "-v" and paste the output?
Created attachment 340883 [details] Screen shot of output As requested by Sebastian a screenshot showing the output with -v
Your source is outputting channels=1, opusdec is also outputting channels=1. Seems all expected here? Or should your source output channels=2?
The source does output channels=(int)2 when the encoder is not in the pipeline
Does it work as expected with > gst-launch-1.0 autoaudiosrc ! "audio/x-raw,channels=2" ! opusenc ! queue ! opusdec ! autoaudiosink
Yes that works as expected.
Then the problem is in directsoundsrc fixating to mono if 1-8 channels are possible.
-- 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.