recording stutters after some time

Bug #1916072 reported by simplenuity
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Audio Recorder
New
Undecided
Unassigned

Bug Description

Have been using audio-recorder on many systems for many years without any problem. Absolutely great software. One of the first I install on any system.

For some time now longer recordings (starting around 45min) start to stutter, but only the Audio output. The stream of the mic am recording at the same time is OK.

system: Ubuntu 18.04
Audio-recorder: 2.1.3~bionic
Device settings: user defined audio source: Audio output AND Microphone

I've tested mp3 as well as wav format: same result, i.e. stutter of Audio output after some time
I've recorded the audio streams in parallel with different software: results are fine

Many thanks for your work!

Revision history for this message
simplenuity (simplenuity) wrote :
Revision history for this message
simplenuity (simplenuity) wrote :

a snippet when recording of Audio output is still working

Revision history for this message
moma (osmoma) wrote :

Hello,

Audio-recorder is using Gstreamer for recording.
The recording pipeline for Gstreamer can also be invoked from the command line (terminal window).

Please test the recording on command line (in a terminal).
Do this:
1) Goto [Additional settings] in the audio-recorder.
2) Then select the "Recording commands" tab.
3) And presss the [Show cmd] button.

Then follow the instruction.
Paste the given recording command to a terminal window and test the recording.
Terminate recording by pressing Cntr+C.

Please report your findings here.

Revision history for this message
simplenuity (simplenuity) wrote :

Thanks for the reply. I'll test as soon as possible in a comparable setting and report back.

Revision history for this message
simplenuity (simplenuity) wrote :

I've tested it from the command line as follows:

$ gst-launch-1.0 -e audiomixer name=mixer ! level ! audioresample ! 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.

After a while I can see the following warning message:

WARNING: from element /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0: Can't record audio fast enough
Additional debug info:
gstaudiobasesrc.c(849): gst_audio_base_src_create (): /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0:
Dropped 24696 samples. This is most likely because downstream can't keep up and is consuming samples too slowly.

So am I correct in assuming that the issue lies with the underlying Gstreamer, and not Audio Recorder itself?

PS: I have been testing it with my newest machine: 16GB RAM, i5, SSD, internet bandwidth by far not utilised.

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

Revision history for this message
simplenuity (simplenuity) wrote :

Thanks, Osmo.
I'll test and report back.

Revision history for this message
simplenuity (simplenuity) wrote :

Hi Osmo,

the following command run via CLI didn't succeed, results have been even worse on the Microphone part:

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.

error message again:

WARNING: from element /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0: Can't record audio fast enough
Additional debug info:
gstaudiobasesrc.c(849): gst_audio_base_src_create (): /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0:
Dropped 48510 samples. This is most likely because downstream can't keep up and is consuming samples too slowly.

But interestingly this time the recording with the GUI (using "audiomixer" element) was just fine!

I'll keep on testing...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.