-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
High
-
Linux Core SDK
-
LCPD-46301
-
-
12.00
-
While debugging an issue with a Gstreamer application (switch between two or more video streams). The issue occurs when switching after receiving an EOS. The CMA memory looks like it leaks after every switch.
Log:
2026-01-08 14:54:49.174] — Switching to first stream (switch #22) —
[2026-01-08 14:54:49.174] Cleaning up pipeline...
[2026-01-08 14:54:49.174] Sending EOS to pipeline...
[2026-01-08 14:54:49.190] Setting pipeline to NULL state...
[2026-01-08 14:54:49.302] [13220.133229] sh (23009): drop_caches: 3
[2026-01-08 14:54:49.302] Forced drop_caches to release CMA memory
[2026-01-08 14:54:49.557] CMA Total: CmaTotal: 589824 kB
[2026-01-08 14:54:49.558] CMA Free: CmaFree: 77284 kB
[2026-01-08 14:54:49.574] Setting source to video_1.264
[2026-01-08 14:54:49.606] Started new pipeline with video_1.264
[2026-01-08 14:54:49.622] Set up new timer with ID: 69
[2026-01-08 14:54:49.622] Pipeline state changed from NULL to READY
[2026-01-08 14:54:49.686] Pipeline state changed from READY to PAUSED
[2026-01-08 14:54:49.686] Pipeline state changed from PAUSED to PLAYING
[2026-01-08 14:54:49.686] CMA Total: CmaTotal: 589824 kB
[2026-01-08 14:54:49.702] CMA Free: CmaFree: 17188 kB
[2026-01-08 14:54:50.678] End of stream
[2026-01-08 14:54:50.678] Cancelling timer ID: 69 due to EOS
[2026-01-08 14:54:50.694]
[2026-01-08 14:54:50.694] — Switching to second stream (switch #23) —
[2026-01-08 14:54:50.694] Cleaning up pipeline...
[2026-01-08 14:54:50.694] Sending EOS to pipeline...
[2026-01-08 14:54:50.709] Setting pipeline to NULL state...
[2026-01-08 14:54:50.822] [13221.649760] sh (23028): drop_caches: 3
[2026-01-08 14:54:50.822] Forced drop_caches to release CMA memory
[2026-01-08 14:54:51.078] CMA Total: CmaTotal: 589824 kB
[2026-01-08 14:54:51.078] CMA Free: CmaFree: 54948 kB
[2026-01-08 14:54:51.078] Setting source to video_2.264
[2026-01-08 14:54:51.126] Started new pipeline with video_2.264
[2026-01-08 14:54:51.126] Set up new timer with ID: 72
[2026-01-08 14:54:51.141] Pipeline state changed from NULL to READY
[2026-01-08 14:54:51.157] [13221.990954] cma: __cma_alloc: linux,cma: alloc failed, req-size: 518 pages, ret: -12
[2026-01-08 14:54:51.158] [13221.998742] cma: number of available pages:
After analyzing the logs, looks like the input buffers are being free'd after EOS, but capture buffers are not being released in the gstv4l2allocator.
Created this bug to track this to clean resources correctly after every decode is complete.