RPi-Distro / vlc

GNU General Public License v2.0
41 stars 4 forks source link

mmal_avcodec CMA buf pool alloc buf failed #67

Open ziza69 opened 2 years ago

ziza69 commented 2 years ago

OS: Raspbian buster minimal, kernel 5.10.103-v7l+ on RPI4 My application runs on X11 using embedded vlc player plays camera stream, it works nice if I start it from command line but fails if run as systemd service. When run as service screen is blank and this is log: ` [b07add68] mmal_codec decoder debug: OpenDecoder: <<< (hevc/----)[----] 352x288 0/0=0/0 o:0 -> (----/----) 0x0 0/0 o:0

[b07add68] mmal_avcodec decoder debug: MmalAvcodecOpenDecoder: <<< (hevc/----)[----] 352x288 -> (----/----) 0x0 [CMA/536870912] xb:5 [b07add68] mmal_avcodec decoder debug: using ffmpeg Lavc58.35.100 [b07add68] mmal_avcodec decoder debug: CPU flags: 0x0000003f [b07add68] mmal_avcodec decoder: Looking for HEVC decoder 'hevc' [b07add68] mmal_avcodec decoder debug: allowing 3 thread(s) for decoding [b07add68] mmal_avcodec decoder debug: codec (hevc) started [b07add68] mmal_avcodec decoder debug: using frame thread mode with 3 threads [b07add68] main decoder debug: using video decoder module "mmal_avcodec" [b07add68] mmal_avcodec decoder debug: Pool size: (3+5) 165888 [b07add68] mmal_avcodec decoder warning: Failed to preallocate decoder pool (3+5) 165888 [b07add68] mmal_avcodec decoder error: CMA buf pool alloc buf failed rpi_get_display_buffer: Failed to get buffer from pool [hevc @ 0xb0d1e040] Failed to allocate output frame [hevc @ 0xb0d1e040] hardware accelerator failed to decode picture [b07add68] mmal_avcodec decoder error: avcodec_send_packet critical error [b07add68] main decoder error: buffer deadlock prevented [030e6d70] main input debug: Decoder wait done in 89 ms [b07add68] mmal_avcodec decoder error: CMA buf pool alloc buf failed ` And if I run it from command line runs OK:

` [b0f1e170] main decoder debug: looking for video decoder module matching "any": 18 candidates

[b0f1e170] mmal_codec decoder debug: OpenDecoder: <<< (hevc/----)[----] 352x288 0/0=0/0 o:0 -> (----/----) 0x0 0/0 o:0 [b0f1e170] mmal_avcodec decoder debug: MmalAvcodecOpenDecoder: <<< (hevc/----)[----] 352x288 -> (----/----) 0x0 [CMA/536870912] xb:5 [b0f1e170] mmal_avcodec decoder debug: using ffmpeg Lavc58.35.100 [b0f1e170] mmal_avcodec decoder debug: CPU flags: 0x0000003f [b0f1e170] mmal_avcodec decoder: Looking for HEVC decoder 'hevc' [b0f1e170] mmal_avcodec decoder debug: allowing 3 thread(s) for decoding [b0f1e170] mmal_avcodec decoder debug: codec (hevc) started [b0f1e170] mmal_avcodec decoder debug: using frame thread mode with 3 threads [b0f1e170] main decoder debug: using video decoder module "mmal_avcodec" [027969f0] main input debug: Buffering 60% [b0f1e170] mmal_avcodec decoder debug: Pool size: (3+5) * 165888 [027969f0] main input debug: Stream buffering done (310 ms in 161 ms) [aba584d8] main spu text debug: looking for text renderer module matching "any": 2 candidates [aba584d8] freetype spu text debug: Building font databases. [aba584d8] freetype spu text debug: Took -13938 microseconds [aba584d8] main spu text debug: using text renderer module "freetype" [aba59600] main scale debug: looking for video converter module matching "any": 17 candidates [aba59600] swscale scale debug: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality) [aba59600] main scale debug: using video converter module "swscale" [b40440f8] main scale debug: looking for video converter module matching "any": 17 candidates [b40440f8] yuvp scale debug: YUVP to YUVA converter [b40440f8] main scale debug: using video converter module "yuvp" [aba56190] main video output debug: Deinterlacing available [aba56190] main video output debug: deinterlace -1, mode auto, is_needed 0 [aba16b20] main window debug: looking for vout window module matching "embed-xid,any": 6 candidates [aba16b20] main window debug: resized to 1011x531 ...`

What is the cause for such behaviour? Can it be fixed?