GStreamer dmabufheaps problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GStreamer dmabufheaps problem

跳至解决方案
1,765 次查看
MicMoba
Contributor V

After switching to Kernel 6.6 I am not able to get GStreamer running.

I suppose that there is problem with the dma.

imx8mp:~$ GST_DEBUG=*dma*:5 gst-launch-1.0 videotestsrc ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.072033375   889 0xffff88000b70 WARN       dmabufheapsmemory gstdmabufheaps.c:98:gst_dmabufheaps_allocator_mem_init: Could not open dmabufheaps driver
0:00:00.072123500   889 0xffff88000b70 WARN       dmabufheapsmemory gstdmabufheaps.c:119:gst_dmabufheaps_allocator_obtain: No allocator named dmabufheapsmem found

(gst-launch-1.0:889): GStreamer-CRITICAL **: 06:27:14.679: gst_buffer_pool_config_set_allocator: assertion 'allocator != NULL || params != NULL' failed
0:00:00.077851750   889 0xffff88000b70 WARN       dmabufheapsmemory gstdmabufheaps.c:119:gst_dmabufheaps_allocator_obtain: No allocator named dmabufheapsmem found

(gst-launch-1.0:889): GStreamer-CRITICAL **: 06:27:14.684: gst_buffer_pool_config_set_allocator: assertion 'allocator != NULL || params != NULL' failed

(gst-launch-1.0:889): GStreamer-CRITICAL **: 06:27:14.685: gst_object_unref: assertion 'object != NULL' failed
0:00:00.078302375   889 0xffff88000b70 DEBUG              wl_dmabuf gstwllinuxdmabuf.c:141:gst_wl_linux_dmabuf_construct_wl_buffer:<GstWlDisplay@0xaaaaec76ec60> Creating wl_buffer from DMABuf of size 307200 (320 x 240), DRM fourcc AR24

(gst-launch-1.0:889): GStreamer-Allocators-CRITICAL **: 06:27:14.685: gst_dmabuf_memory_get_fd: assertion 'gst_is_dmabuf_memory (mem)' failed
error marshalling arguments for add: dup failed: Bad file descriptor
Error marshalling request: Bad file descriptor
0:00:01.078829000   889 0xffff88000b70 ERROR              wl_dmabuf gstwllinuxdmabuf.c:217:gst_wl_linux_dmabuf_construct_wl_buffer:<allocatorsysmem0> zwp_linux_buffer_params_v1 time out
0:00:01.078882000   889 0xffff88000b70 ERROR              wl_dmabuf gstwllinuxdmabuf.c:225:gst_wl_linux_dmabuf_construct_wl_buffer:<allocatorsysmem0> can't create linux-dmabuf buffer
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:02.173458875
Setting pipeline to NULL ...

 I use the wayland display server, weston (v 12.0.4) as compositor and gstreamer v1.24.0

Is there a missmatch of versions between VPU, GPU, DMA, ...? How can I check this? In the output abov is a warning "Could not open dmabufheaps driver". What driver is meant? Who provides this driver?

Actually I use the meta-imx layer for the graphics and multimedia stuff. Maybe it's a rights issue.
I miss myself a idea to investigate this problem. So I will be thankfull to get any suggestions.

0 项奖励
回复
1 解答
1,731 次查看
MicMoba
Contributor V

I found the reason for the renaming. If the kernel config CONFIG_CMA_SIZE_MBYTES is below the

given size of linux,cma item in the devicetree the new kernel rename the device to "reserved".
 
In my case the kernel config was:

 

CONFIG_CMA_SIZE_MBYTES=320

 

 
The devicetree (imx8mp.dtsi):

 

resmem: reserved-memory {
   #address-cells = <2>;
   #size-cells = <2>;
   ranges;

   ocram: ocram@900000 {
      no-map;
      reg = <0 0x900000 0 0x70000>;
   };

/*
*    Memory reserved for optee usage. Please do not use.
*    This will be automaticky added to dtb if OP-TEE is installed.
*    optee@56000000 {
*       reg = <0 0x56000000 0 0x2000000>;
*       no-map;
*    };
*/
   /* global autoconfigured region for contiguous allocations */
   linux,cma {
      compatible = "shared-dma-pool";
      reusable;
      size = <0 0x3C000000>;
      alloc-ranges = <0 0x40000000 0 0xC0000000>;
      linux,cma-default;
   };
...

 

0x3C000000 is 960MiB. So it was over the 320MiB from the kernel configuration. After I changed the size to 0x14000000 the device names in /dev/dma_heap were as expect with linux,cma and linux,cma-uncached.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,754 次查看
MicMoba
Contributor V

I made some investigations and found out that there were two devices renamed.

/dev/dma_heap/linux,cma is called now /dev/dma_heap/reserved

/dev/dma_heap/linux,cma-uncached is called now /dev/dma_heap/reserved-uncached

I made two symbolic links to this new devices with the old names and now the gstreamer works well.

Why are the devices renamed? And how can I change this?

0 项奖励
回复
1,732 次查看
MicMoba
Contributor V

I found the reason for the renaming. If the kernel config CONFIG_CMA_SIZE_MBYTES is below the

given size of linux,cma item in the devicetree the new kernel rename the device to "reserved".
 
In my case the kernel config was:

 

CONFIG_CMA_SIZE_MBYTES=320

 

 
The devicetree (imx8mp.dtsi):

 

resmem: reserved-memory {
   #address-cells = <2>;
   #size-cells = <2>;
   ranges;

   ocram: ocram@900000 {
      no-map;
      reg = <0 0x900000 0 0x70000>;
   };

/*
*    Memory reserved for optee usage. Please do not use.
*    This will be automaticky added to dtb if OP-TEE is installed.
*    optee@56000000 {
*       reg = <0 0x56000000 0 0x2000000>;
*       no-map;
*    };
*/
   /* global autoconfigured region for contiguous allocations */
   linux,cma {
      compatible = "shared-dma-pool";
      reusable;
      size = <0 0x3C000000>;
      alloc-ranges = <0 0x40000000 0 0xC0000000>;
      linux,cma-default;
   };
...

 

0x3C000000 is 960MiB. So it was over the 320MiB from the kernel configuration. After I changed the size to 0x14000000 the device names in /dev/dma_heap were as expect with linux,cma and linux,cma-uncached.

0 项奖励
回复
1,721 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

ok you reduced the cma address and it works for you.

Regards

0 项奖励
回复
1,739 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

which BSP are you using? which target board? since you don't need to change the dma or cma memories and its not changing between bsps.

Regards

0 项奖励
回复