Comment 6 for bug 1916072

Revision history for this message
moma (osmoma) wrote :

Hello,

Very good.
You are recording from two different sources by using a mixer (audiomixer) element. Maybe it is too busy consuming the audio packages (buffers).

Gstreamer has at least three different kind of mixer elements for audio.
It has "adder" element.
https://gstreamer.freedesktop.org/documentation/adder/index.html?gi-language=c

And "liveadder" element.
https://gstreamer.freedesktop.org/documentation/audiomixer/liveadder.html?gi-language=c

And "audiomixer" element.
https://gstreamer.freedesktop.org/documentation/audiomixer/audiomixer.html?gi-language=c

They seems to be similar in usage. There maybe even more audio mixer elements.

Please try to change the mixer element from "audiomixer" to "liveadder" (or even to the older "adder" element).

For example:

gst-launch-1.0 -e liveadder name=mixer ! level ! audioconvert ! audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2 ! filesink location=test.mp3 pulsesrc device=alsa_output.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-stereo.monitor ! queue ! mixer. pulsesrc device=alsa_input.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-mono ! queue ! mixer.

Also remove the "queue" and from the pipeline (it may even make it worse)
And remove the "audioresample" from the pipeline. Seems the elements can negotiate their format without it.

Try this:

gst-launch-1.0 -e liveadder name=mixer ! level ! audioconvert ! audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2 ! filesink location=test.mp3 pulsesrc device=alsa_output.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-stereo.monitor ! mixer. pulsesrc device=alsa_input.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-mono ! mixer.

Some of the mixer elements (adder, liveadder or audiomixer, etc) can take parameters (properties) on the command line (or by/in c-code).

Study the properties with gst-inspect-1.0 or in the online manual.
$ gst-inspect-1.0 liveadder
...
latency
min-upstream-latency
...

Try to fine-tune the element by setting its properties.
Eg. liveadder latency=90

gst-launch-1.0 -e liveadder name=mixer latency=90 ! level ! audioconvert ! audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2 ! filesink location=test.mp3 pulsesrc device=alsa_output.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-stereo.monitor ! mixer. pulsesrc device=alsa_input.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_00024508911A07-00.analog-mono ! mixer.

Etc.
Please tell me if you find a working solution.
----

You can also debug the Gstreamer pipeline by setting the GST_DEBUG variable. Google for "debugging Gstreamer" for more info.

$ GST_DEBUG=2 gst-launch-1.0 -e liveadder latency=100 name=mixer ! level ! audioconvert ! audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2 ! filesink location=test.mp3 pulsesrc device=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor ! mixer. pulsesrc device=alsa_input.pci-0000_00_1f.3.analog-stereo ! mixer.

Please tell me if you find a working solution. It would be very helpfull.

Cumprimentos
 Osmo Antero
 Portugal