Hello team,
For my application I needed to interleave two mono streams into a stereo, for quick test I am using the following pipeline with gst-launch:
gst-launch-1.0 -e interleave name=hp_i ! audioconvert ! alsasink
audiotestsrc wave=5 ! audioconvert ! “audio/x-raw,channels=1,channel-mask=(bitmask)0x1” ! queue ! hp_i.sink_0
audiotestsrc wave=0 freq=1000 ! audioconvert ! “audio/x-raw,channels=1,channel-mask=(bitmask)0x2” ! queue ! hp_i.sink_1
This pipeline appeared to work fine initially, but when repeatedly invoked, I noticed that sometimes audio from left channel is heard on right one and vice versa, I am using the primary headphone jack for playback. To isolate the problem between gstreamer elements and ALSA, I recorded the above stream with following pipeline:
gst-launch-1.0 -e interleave name=hp_i ! audioconvert ! wavenc ! filesink location=“stereo-test.wav” audiotestsrc wave=5 ! audioconvert ! queue ! “audio/x-raw,channels=1,channel-mask=(bitmask)0x1” ! hp_i.sink_0 audiotestsrc wave=0 freq=1000 ! audioconvert ! queue ! “audio/x-raw,channels=1,channel-mask=(bitmask)0x2” ! hp_i.sink_1
And cross verified the wave file with audacity, now with aplay stereo-test.wav also I am noticing the same channel swapping issue, out of 10 times at-least twice it is happening for me. Next I tried out the speaker-test program provided here, again the same observation, initial few attempts it appears to work fine but repeated playbacks will lead to channels getting swapped.
Is there a workaround for this problem?
Thanks,
Ravikiran