memory leak generated by audiotestsrc

Charlie Laub charleslaub at sbcglobal.net
Thu Feb 8 18:27:52 UTC 2018


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"

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180208/f563da42/attachment.html>


More information about the gstreamer-devel mailing list