Hi,
We are encoding Full HD data using ducatih264enc. We are providing 1920x1080@60,YUYV16bit data from fpga to AM5728 evk.
Since data format is YUYV, so we are using vpe plugin to convert data into NV12 before feeding to encoder.
pipeline flow is as below:
fpga -----------> vip -----------> vpe ----------> ducatih264enc ---------> filesink
YUYV YUYV NV12 mp4
We are using following command:
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=4 ! \
'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)60/1' ! \
vpe num-input-buffers=8 ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080' ! queue ! ducatih264enc level=level-51 profile=high ! queue ! h264parse ! mp4mux ! filesink location=temp.mp4
The above pipeline works fine for few minutes. After that, the memory allocation fails as per following log
root@am57xx-evm:~# [ 2629.912733] vip 48990000.vip: dma_alloc_coherent of size 4149248 failed
** (gst-launch-1.0:1151): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed
** (gst-launch-1.0:1151): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed
** (gst-launch-1.0:1151): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed
** (gst-launch-1.0:1151): CRITICAL **: gst_fd_memory_get_fd: assertion 'GST_IS_FD_ALLOCATOR (mem->allocator)' failed
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
../../../../gstreamer-1.8.3/libs/gst/base/gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason error (-5)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:02:06.188277213
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
[ 2630.106452] *** fpga_s_stream ***
Setting pipeline to NULL ...
Freeing pipeline ...
I increased the cma size(cma=512M) from bootargs, the recording time increased but the error still persists. The following log shows
still 487MB cma memory available when the memory allocation failed
#cat /proc/meminfo
MemTotal: 1866148 kB
MemFree: 1167520 kB
MemAvailable: 1512168 kB
Buffers: 14272 kB
Cached: 369416 kB
SwapCached: 0 kB
Active: 93176 kB
Inactive: 343328 kB
Active(anon): 54540 kB
Inactive(anon): 44440 kB
Active(file): 38636 kB
Inactive(file): 298888 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 1307648 kB
HighFree: 779508 kB
LowTotal: 558500 kB
LowFree: 388012 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 8 kB
Writeback: 52 kB
AnonPages: 52812 kB
Mapped: 80644 kB
Shmem: 46168 kB
Slab: 40420 kB
SReclaimable: 26976 kB
SUnreclaim: 13444 kB
KernelStack: 1272 kB
PageTables: 1532 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 933072 kB
Committed_AS: 342940 kB
VmallocTotal: 245760 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
CmaTotal: 688128 kB
CmaFree: 487020 kB
This issue, I don't find when we use io-mode=5. Since we are getting YUYV data from fpga & duncatih264enc expects data in NV12 format, So we can't set the pad capabilty YUY2, we need to set the pad capability NV12. When we set the capability as NV12, the data is swapped(UYVY) at encoding.
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=5 ! 'video/x-raw,format=(string)NV12, width=(int)1920, height=(int)1080, framerate=(fraction)60/1'! ducatih264enc level=level-51 profile=high ! queue ! h264parse ! mp4mux ! filesink location=temp1.mp4
We are using SDK version 04.00.00.04.
Please help us why it is failing for io-mode=4.
Thanks,
Praveen