Open smzahraee opened 4 weeks ago
it seems a cache issue for using cpu copy pixel data
I also checked /proc/meminfo
, mpp doesn't use the cma area.
I enabled kernel CMA but I face the following problem:
0.000000] Hardware name: Rockchip (Device Tree)
[ 0.000000] [<b000f50d>] (unwind_backtrace) from [<b000e027>] (show_stack+0xb/0xc)
[ 0.000000] [<b000e027>] (show_stack) from [<b0646449>] (memblock_alloc_range_nid+0x29/0x98)
[ 0.000000] [<b0646449>] (memblock_alloc_range_nid) from [<b06471ef>] (cma_declare_contiguous_nid+0x123/0x17c)
[ 0.000000] [<b06471ef>] (cma_declare_contiguous_nid) from [<b0643e47>] (dma_contiguous_reserve_area+0x27/0x4c)
[ 0.000000] [<b0643e47>] (dma_contiguous_reserve_area) from [<b0643e9d>] (dma_contiguous_reserve+0x31/0x40)
[ 0.000000] [<b0643e9d>] (dma_contiguous_reserve) from [<b0640609>] (arm_memblock_init+0x7d/0xe0)
[ 0.000000] [<b0640609>] (arm_memblock_init) from [<b063fbd1>] (setup_arch+0xe1/0x324)
[ 0.000000] [<b063fbd1>] (setup_arch) from [<b063d889>] (start_kernel+0x35/0x350)
[ 0.000000] [<b063d889>] (start_kernel) from [<00000000>] (0x0)
[ 0.000000] cma: Failed to reserve 0 KiB
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x000000000fffffff]
[ 0.000000] Movable zone start for each node"
is there a way to enable rk-dma-heap-cma
for mpp?
it seems that it does not use it.
Check .config for CONFIG_DMABUF_HEAPS_ROCKCHIP ? system-heap is more commonly used.
I'm not sure why, but enabling only CONFIG_DMABUF_HEAPS_ROCKCHIP
doesn’t make the encoder work.
./mpi_enc_test -t 7 -w 480 -h 272 -i ./ds_480x272.yuv -o t1.h264
mpp[239]: mpi_enc_utils: cmd parse result:
mpp[239]: mpi_enc_utils: input file name: ./ds_480x272.yuv
mpp[239]: mpi_enc_utils: output file name: t1.h264
mpp[239]: mpi_enc_utils: width : 480
mpp[239]: mpi_enc_utils: height : 272
mpp[239]: mpi_enc_utils: format : 0
mpp[239]: mpi_enc_utils: type : 7
mpp[239]: mpi_enc_test: ./mpi_enc_test start
mpp[239]: mpp_rt: can NOT found any allocator
mpp[239]: mpp_log: allocator_std_open Warning: std allocator should be used on simulation mode only
mpp[239]: mpp_buffer: mpp_buffer_group_init leave
mpp[239]: mpp_buffer: mpp_buffer_get_unused enter
mpp[239]: mpp_buffer: mpp_buffer_get_unused leave
mpp[239]: mpp_buffer: mpp_buffer_create enter
mpp[239]: mpp_log: allocator_std_alloc Warning: std allocator should be used on simulation mode only
mpp[239]: mpp_buffer: mpp_buffer_create failed to create buffer with size 245760
mpp[239]: mpp_buffer: mpp_buffer_create leave
mpp[239]: mpi_enc_test: enc_test failed to get buffer for input frame ret -1
mpp[239]: mpp_buffer: mpp_buffer_group_deinit enter
mpp[239]: mpp_buffer: mpp_buffer_group_deinit leave
mpp[239]: mpi_enc_test: chn 0 encode 0 frames time 0 ms delay 0 ms fps 0.00 bps 0
mpp[239]: mpi_enc_test: ./mpi_enc_test average frame rate 0.00
it seems that it creates /dev/rk_dma_heap/
but mpp needs/dev/dma_heap
The following configurations are also needed to get it working, but with these settings, I end up with a distorted image. extra configuration that I set:
CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_SYSFS_STATS=y
CONFIG_DMABUF_HEAPS_DEFERRED_FREE=y
CONFIG_DMABUF_HEAPS_PAGE_POOL=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y
Try remove -i option and mpi_enc_test will draw a color bar for test.
here is the default pattern
I checked the /proc/meminfo
it seems that it does not use the cma
The luma part is correct and the chroma part has error. Is the buffer size enough for w h 3 / 2?
Or there is something corrupt the chroma part memory
Where can I check the image buffer size in mpp? is there any env variable for that?
For encoder the image buffer is not provided by mpp. The image buffer is from outside the mpp encoder.
As I tested, the board can not start encoding without heap DMA, which will be enabled by those kernel configs that I mentioned earlier configs. if you look at the MppRuntimeService, it tries to allocate memory from one of the followings:
my CPU doesn't have DRI(GPU) and ion(Android-specific), so I have to allocate buffers from DMA or CMA.
As I tested mpp
tries to get buffers from /dev/dma_heap
which is a generic Linux kernel driver. and it doesn't care about rk-dma-heap-cma
that already exists in rockchip kernel driver!
rk-dma-heap-cma
driver for buffer allocation?
using rk3528
Issue: Unable to Achieve 60 FPS with Distorted Image Output on
gst-launch-1.0
PipelinePipeline Command:
Problem: I am attempting to stream video at 1280x720 resolution with a frame rate of 120 fps using the above
gst-launch-1.0
pipeline. However, I'm facing two issues:Could you please help identify possible causes or suggest configurations that might resolve these issues?