Memory leak when gstreamer playing RTSP with libgstvpu

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory leak when gstreamer playing RTSP with libgstvpu

3,180 Views
jiaxingliang
Contributor I

Command:

gst-launch-1.0 playbin uri=rtsp://192.168.1.88:556/vga

The memory of gst-launch-1.0 will increase more than 30M every hour, then the video stop, but audio soud ok。

 Delete the libgstvpu.so , use the same commad. memory will not increase,  but play the high resolution (1920x1080) not smooth.

Anybody  has faced the same problem and resolved? Please help

karinavalencia

I do more test.

Compare playing local video file and RTSP:

1)  play 1920x1080 (MPEG4\AVC_H_L3local files, that seems not has memory leak.  (log file : gplay-test-AVC_H_L3_Schindlers.log、gplay-test-MPEG4_Schindlers.log)

2) play 1920x1080 (AVC_H) RTSP, memory increase about 16M. (log file: gplay-test-AVC_H_RTSP.log)

Compare playing RTSP(960x540 AVC_H)  with vpudec and avdec_h264 lib:

a) use vpudec , memory increase about 10M in 20 mins.( log file: gplay-test-AVC_H_RTSP_with_VPU.log)

b) use avdec_h264(delete /usr/lib/gstreamer-1.0/libgstvpu.so) , memory not increase. (log file: gplay-test-AVC_H_RTSP_with_avdec_h264.log)

 

CPU: IMX6DL

Kernel: 4.1.15

BSP: 2.0.1 GA

vpudec: imx-gst1.0-plugin-4.1.4

avdec_h264:gst-libav-1.8.1

Labels (1)
0 Kudos
46 Replies

878 Views
karina_valencia
NXP Employee
NXP Employee

b36401, do you have an update about this case?

0 Kudos

878 Views
b36401
NXP TechSupport
NXP TechSupport

Karina,

I escalated it to Experts Team.

Then internal ticket was created last monday.

Let's wait for the answer.

0 Kudos

878 Views
jiaxingliang
Contributor I

HI, Victor,

     Did the   Experts Team repeat this problem?  Is there any good news?

karinavalencia

Qiang_FSL

0 Kudos

878 Views
b36401
NXP TechSupport
NXP TechSupport

R&D Team will provide an update next week due an urgent task for this week.
Sorry for the delay.

0 Kudos

878 Views
jiaxingliang
Contributor I

Thanks, waitting for your good news.

0 Kudos

878 Views
b36401
NXP TechSupport
NXP TechSupport

They did not reproduce the issue by VLC as the RTSP server.

Please provide us more details.
If the issue occurs only with your special RTSP sender, it is hard to identy the root cause.

0 Kudos

878 Views
jiaxingliang
Contributor I

Hi, Victor. 

      I found use this commad for VLC server will cause this issue.

vlc -vvv \\192.168.1.253\work\mynfs\AVC_H_L3_Schindlers.list.1993.HDTV.mkv --loop :sout=#transcode{vcodec=h264,vb=1024,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{mux=ts,sdp=rtsp://:8554/vga} :sout-keep

      

      I do not know the "mux=ts" meaning, but your team can try it. 

Our RTSP sender is https://detail.tmall.com/item.htm?id=521274714573

When the RTSP_Format choose TS, gstreamer1.0 will cause memory leak, but ES will not.

pastedImage_3.png

But using the TS format,  the memory will not increase when playing by gstream0.10(kernel is  use the same one).

Also playing good with gstreamer1.0 by using libav_h264_dec.

I  found mfw_gst_avc_fix_nalheader function  /* size of SPS&PPS in NALs */in src/video/vpu_dec.full/src/mfw_gst_vpu_decoder.c(gst-fsl-plugins-4.0.3 in gstreamer0.10), but gstreamer1.0's vpudec didn't



Qiang_FSL

0 Kudos

878 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Liang JiaXing ,

Please try with attached libgstvpu.so, there is a known issue on memory alignment.

Can you replace the original vpu library on board with command "cp libgstvpu.so /usr/lib/gstreamer-1.0/ " to see if can still reproduce memory leak issue?

The HDMI encoder had been received, but the test condition is not ready yet.

0 Kudos

878 Views
jiaxingliang
Contributor I

Hi,Li,

      thanks for replay.  but this lib is not work for our board.

root@imx6dlsabresd:/home# gst-inspect-1.0 vpudec

(gst-plugin-scanner:14042): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstvpu.so': libunwind.so.8: cannot open shared object file: No such file or directory
No such element or plugin 'vpudec'

my BSP is : BSP: 2.0.1 GA

bitbake config is :

===================================

MACHINE ??= 'imx6dlsabresd'
DISTRO ?= 'upt-mx6dl-eglfs'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"

PACKAGECONFIG_append_pn-qtbase = " sql-sqlite"

IMAGE_INSTALL_append += " \
gstreamer1.0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-bad \
qtmultimedia \
qtmultimedia-plugins \
qtmultimedia-qmlplugins \
qtbase-plugins \
tslib \
tslib-calibrate \
tslib-conf \
tslib-tests \
"


DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "8"

0 Kudos

878 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Please apply the patch to your BSP and test it, thanks!

0 Kudos

868 Views
jiaxingliang
Contributor I

HI,Li:

      Has the testing environment with HDMI encoder   been setup?  this problem can repeat now?

0 Kudos

868 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Liang JiaXing 

When pc, imx6 board, hdmi encoder are connected to the same router, neither http://192.168.1.98/ nor the default IP address http://192.168.1.168/  can be reached to set the software parameters.

So, it seems we can't reproduce the issue on our side.

How about your network connection?

Some debug suggestion.

0 Kudos

868 Views
jiaxingliang
Contributor I

Hi,Qiang_FSL‌:

      可以ping通192.168.1.98吗?是不是你们的路由器不在同一网段呢?

如果ping不通,可以复位背后的reset键,恢复出厂设置后默认ip是192.168.1.168.

0 Kudos

868 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

寄过来的HDMI编码器是静态IP地址吗?固定192.168.1.98?

0 Kudos

868 Views
jiaxingliang
Contributor I

对的,固定192.168.1.98。

0 Kudos

868 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

This week's update:

With the received HDMI encoder, there will be a 9 bytes package for each 30 frames, this is not a video frame, so it will be held in VPU.

0 Kudos

868 Views
jiaxingliang
Contributor I

Has this issue fixed?

0 Kudos

868 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Please try attached patch for gst-plugins-bad, h264paerser. From our side testing, no memory leak now.

 

0 Kudos

868 Views
jiaxingliang
Contributor I

Hi,Qiang:

      I test this patch , it still has memory leak.,from 373m to 423m. 

and gplay-1.0 exit.

Please check the log in 

链接:https://pan.baidu.com/s/1KUgtP7Atw6UPMcEbjcMWMQ
提取码:9j1g

0 Kudos

868 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Can you zip the log file and attach here? Thanks!

0 Kudos