memory leak generated by audiotestsrc

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

memory leak generated by audiotestsrc

Charlie Laub
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: memory leak generated by audiotestsrc

Sean DuBois
On Tue, Feb 06, 2018 at 04:33:08PM -0800, Charlie Laub wrote:

> I have been doing some pipeline debugging and testing using gst-launch. I
> noticed that my gst-launch process was increasing its footprint by about 1
> MB PER SECOND! I only spotted this initially when I was hearing some
> glitches in the audio (the pipeline is processing audio). I looked at my
> resource usage and noticed that all of the physical memory on the machine
> was being used. I killed the gstreamer process, restarted it, and looked at
> resource usage for all processes running on my system. That's when the
> memory leak rate became very apparent.
>
>
>
> My pipeline, which I will not bother to reproduce here, uses two
> audiotestsrc elements. After some experimentation, I found that when I
> removed these and instead sourced the data from an existing input via a tee
> the memory leak completely disappeared.
>
>
>
> To give you some idea of the scope of the memory leak, the memory used by
> the process with the audiotestsrc elements removed is only 5.5 MB. The
> memory leak rate is ONE MB PER SECOND! Something is seriously wrong.
>
>
>
> Gstreamer developers: check into this, s'il vous plait?
>

Hey!

I tried a few simple pipelines with multiple audiotestsrces and was not
able to see any obvious leaks (Using 1.13.0 (GIT))

I would be happy to fix this if you can give me an exact version +
pipeline to reproduce.

thanks!
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: memory leak generated by audiotestsrc

Charlie Laub
In reply to this post by Charlie Laub
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: memory leak generated by audiotestsrc

Sean DuBois
On Thu, Feb 08, 2018 at 10:27:52AM -0800, Charlie Laub wrote:

> This is a follow up on my previous post about memory leaks that I have
> observed using gst-launch-1.0.
>
>
>
> System:
>
> Ubuntu 16.04
>
> Asrock Q1900DC-ITX mother board
>
> alsa src and sink are from/to onboard audio codec ALC892 via rear panel
> jacks
>
> Gstreamer version: 1.8.3
>
>
>
> Purpose of pipeline:
>
> test how to incorporate LADSPA plugins (plugins require
> channels=1,format=F32LE data)
>
> test how to assign channels via channel-mask
>
> test using deinterleave, tee, and interleave for LADSPA processing
>
>
>
> Intended behavior of this test pipeline:
>
> 2 (stereo audio) input channels are reassigned to some other channels in the
> 8 channel output stream
>
> the other channels should be silent
>
>
>
> Observed behavior:
>
> At first I used audiotestsrc wave=silence to create silent channels. After I
> discovered the memory leak I instead tried the volume element with mute=true
> but this also produced a memory leak. As a workaround I used a LADSPA plugin
> that I wrote with the gain level set to -90dB and this did not leak.
> Needless to say, the memory leaks with audiotestsrc and volume should not be
> happening. Since leaking occurs without when there are no LADSPA plugins in
> the pipeline it does not seem to be related to these elements.
>
>
>
> Example pipelines are provided below.
>
>
>
>
>
> (1) THIS PIPELINE RESULTS IN MEMORY LEAK, LEAKRATE ~ 1MB/sec
>
>
>
> gst-launch-1.0 -v \
>
> alsasrc device="hw:1,0" ! audio/x-raw,format=S32LE,rate=44100 ! deinterleave
> name=d \
>
> d.src_0 ! tee name=t0 \
>
> d.src_1 ! tee name=t1 \
>
> audiotestsrc wave=silence ! audio/x-raw,channels=1,format=S32LE,rate=44100 !
> tee name=audio_silence \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x4" ! i.sink_0   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x8" ! i.sink_1   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x1" ! i.sink_2   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x2" ! i.sink_3   \
>
> t0. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x400" ! i.sink_4   \
>
> t1. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x800" ! i.sink_5   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x10" ! i.sink_6   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x20" ! i.sink_7   \
>
> interleave name=i ! audioconvert ! audio/x-raw,format=S32LE ! alsasink
> device="hw:1,0"
>
>
>
>
>
>
>
>
>
>
>
> (2) THIS PIPELINE WITH LADSPA PLUGINS REMOVED ALSO RESULTS IN MEMORY LEAK,
> LEAKRATE ~ 1MB/sec
>
>
>
> gst-launch-1.0 -v \
>
> alsasrc device="hw:1,0" ! audio/x-raw,format=S32LE,rate=44100 ! deinterleave
> name=d \
>
> d.src_0 ! tee name=t0 \
>
> d.src_1 ! tee name=t1 \
>
> audiotestsrc wave=silence ! audio/x-raw,channels=1,format=S32LE,rate=44100 !
> tee name=audio_silence \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x4" ! i.sink_0   \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x8" ! i.sink_1   \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x1" ! i.sink_2   \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x2" ! i.sink_3   \
>
> t0. ! queue ! audioconvert ! "audio/x-raw,channel-mask=(bitmask)0x400" !
> i.sink_4   \
>
> t1. ! queue ! audioconvert ! "audio/x-raw,channel-mask=(bitmask)0x800" !
> i.sink_5   \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x10" ! i.sink_6   \
>
> audio_silence. ! queue ! audioconvert !
> "audio/x-raw,channel-mask=(bitmask)0x20" ! i.sink_7   \
>
> interleave name=i ! audioconvert ! audio/x-raw,format=S32LE ! alsasink
> device="hw:1,0"
>
>
>
>
>
>
>
>
>
>
>
> (3) THIS WORKS WITHOUT MEMORY LEAK:
>
> The only difference from the first example is that I replaced the
> audiotestsrc with a teed input channel
>
>
>
> gst-launch-1.0 -v \
>
> alsasrc device="hw:1,0" ! audio/x-raw,format=S32LE,rate=44100 ! deinterleave
> name=d \
>
> d.src_0 ! tee name=t0 \
>
> d.src_1 ! tee name=t1 \
>
> t0. ! tee name=audio_silence \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x4" ! i.sink_0   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x8" ! i.sink_1   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x1" ! i.sink_2   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x2" ! i.sink_3   \
>
> t0. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x400" ! i.sink_4   \
>
> t1. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x800" ! i.sink_5   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x10" ! i.sink_6   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x20" ! i.sink_7   \
>
> interleave name=i ! audioconvert ! audio/x-raw,format=S32LE ! alsasink
> device="hw:1,0"
>
>
>
>
>
>
>
>
>
>
>
> (4) USING VOLUME ELEMENT ALSO CREATES MEMORY LEAK, LEAKRATE ~ 1MB/sec
>
> I took pipeline (3) above and inserted the volume element
>
> Pipeline runs but leaks at same rate
>
>
>
> gst-launch-1.0 -v \
>
> alsasrc device="hw:1,0" ! audio/x-raw,format=S32LE,rate=44100 ! deinterleave
> name=d \
>
> d.src_0 ! tee name=t0 \
>
> d.src_1 ! tee name=t1 \
>
> t0. ! volume mute=true ! tee name=audio_silence \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x4" ! i.sink_0   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x8" ! i.sink_1   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x1" ! i.sink_2   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x2" ! i.sink_3   \
>
> t0. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x400" ! i.sink_4   \
>
> t1. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-20 !
> ladspa-acdf-so-acdf type=0 gain=10 !
> "audio/x-raw,channel-mask=(bitmask)0x800" ! i.sink_5   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x10" ! i.sink_6   \
>
> audio_silence. ! queue ! audioconvert ! ladspa-acdf-so-acdf type=0 gain=-90
> ! "audio/x-raw,channel-mask=(bitmask)0x20" ! i.sink_7   \
>
> interleave name=i ! audioconvert ! audio/x-raw,format=S32LE ! alsasink
> device="hw:1,0"
>
>
>
>
>

> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Hey Charlie!
Sorry I responded to your email, but sbcglobal keeps bouncing me.

If you replace your alsasrc with an audiotestsrc (so two
audiotestsrc) does it still happen?

If you use a fakesink instead of an alsasink does it still happen?

Just trying to remove as much complexity as possible from the pipeline,
I tried really quickly with git but didn't see anything.

1.8.3 is getting old (March 2016) so hopefully has been fixed since then! I will get a docker up and grab
that tag this weekend. See if you can make it happen with just
audiotestsrc/fakesink makes it a lot easier to debug.

thanks
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: memory leak generated by audiotestsrc

Charlie Laub
In reply to this post by Charlie Laub
CONTENTS DELETED
The author has deleted this message.