AM62A7-Q1: AM62A7: Request for LCPD-46301 patch details for GStreamer v4l2videoenc CMA memory leak on SDK 10.0

Part Number: AM62A7-Q1
Other Parts Discussed in Thread: AM62P

Hi TI team,

 

We are currently using:

 

- Processor SDK Linux 10.0
- GStreamer 1.22.12
- AM62A7-Q1 platform

 

We are encountering a CMA memory leak issue when repeatedly creating/destroying GStreamer pipelines using v4l2h264enc/v4l2videoenc.

 

After continuous encoding pipeline switching or repeated encoder usage, CMA memory is not fully released. Eventually the system reports errors such as:

 

"Failed to process frame"
"not enough memory or failing driver"

 

We investigated the issue and found a similar TI internal Jira issue:

 

LCPD-46301
[EXT_EP-13152] AM62A/AM62P: Gstreamer V4L2allocator CMA leak

 

From the Jira description, this issue appears very similar to the problem we are currently facing.

 

Our project is restricted to SDK 10.0 and unfortunately we cannot upgrade to SDK 11.x or 12.x.

 

Therefore, we would like to ask:

 

1. Could you share the related patch/code changes for LCPD-46301?
2. Which specific modules/files were modified to resolve the CMA leak?
3. Was the fix related to:
   - gstv4l2allocator
   - v4l2videoenc
   - buffer pool release
   - OUTPUT/CAPTURE queue cleanup
   - DMA/CMA buffer unref timing
   - EOS/state transition handling
4. Is there any recommended backport patch for SDK 10.0 / GStreamer 1.22.12?

 

We checked the gstreamer git history and found several potentially related commits in v4l2videoenc, such as:

 

- Fix codec frame leak on error
- unref buffer pool after usage properly
- fix activation of internal pool
- always allocate CAPTURE buffer from our pool

 

Could you help identify which changes are related to LCPD-46301 CMA leak fix?

 

Our usage scenario:
- Multiple video streams
- Repeated encoder start/stop
- Frequent pipeline switching after EOS
- YUYV input -> NV12 conversion -> v4l2h264enc

 

The issue can be observed by monitoring:

 

cat /proc/meminfo | grep -i Cma

 

CMA free memory continuously decreases after each pipeline restart and does not fully recover.

 

Any guidance or patch information would be greatly appreciated.

 

Thanks.image.pngimg_v3_0212g_31722710-0b97-49ea-a7f4-2fdb2c5b425g.jpg