memory leak generated by audiotestsrc

Sean DuBois sean at siobud.com
Fri Feb 9 08:56:48 UTC 2018


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
> gstreamer-devel at lists.freedesktop.org
> 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


More information about the gstreamer-devel mailing list