NvMMLiteVideoEncDoWork: Surface resolution (0 x 0) smaller than encode resolution (1920 x 1080)

Hello,

I have two separate Jetson TX2 devices, on both I installed OS with Nvidia SDK choosing the JetPack 4.2.3 option. They also have the same camera attached - Leopard Imaging LI-JEVA-AR0231-FPDLINKIII-060H.
On both I run the same pipeline, but only on one it works, not on the other.

I’ve stripped the pipeline from all parts that are not relevant for this problem and ended up with this part:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 maxperf=1 bufapi-version=1 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12’ ! mux.sink_0 nvstreammux name=mux batch-size=1 live-source=1 width=1920 height=1080 ! omxh264enc ! fakesink

On one of the TX2’s it just works and on the other it produces the following error:

NvMMLiteVideoEncDoWork: Surface resolution (0 x 0) smaller than encode resolution (1920 x 1080)
VENC: NvMMLiteVideoEncDoWork: 4231: BlockSide error 0x4
Event_BlockError from 0BlockAvcEnc : Error code - 4
Sending error event from 0BlockAvcEncERROR: from element /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0: GStreamer encountered a general supporting library error.
Additional debug info:
/dvs/git/dirty/git-master_linux/3rdparty/gst/gst-omx/omx/gstomxvideoenc.c(1331): gst_omx_video_enc_loop (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
OpenMAX component in error state Bad parameter (0x80001005)

I can supply the log with GST_DEBUG set to another level if you think it will be relevant. Myself I’ve not found any other relevant logs.

I’m not sure what this error means and why it happens, but it seems to be caused by the maxperf=1 bufapi-version=1 part because I can successfully run a pipeline without those parameters and see the camera feed, however I’ve found those parameters obligatory to use nvstreammux.

I will appreciate help!

Regards,
Arek Kulczycki

Maybe omxh264enc cannot handle the new bufapi. OMX plugins are going deprecated. Try nvv4l2h264enc instead:

st-launch-1.0 nvarguscamerasrc sensor-id=0 maxperf=1 bufapi-version=1 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12’ ! mux.sink_0 nvstreammux name=mux batch-size=1 live-source=1 width=1920 height=1080 ! nvv4l2h264enc bufapi-version=1 ! fakesink

Thanks for your suggestion!

The nvv4l2h264enc with parameter maxperf-enabled=1 that I initially set crashed, but later I removed that parameter and it works!

I’m getting a warning though:

WARN v4l2bufferpool gstv4l2bufferpool.c:1463:gst_v4l2_buffer_pool_dqbuf:nvv4l2h264enc0:pool:sink V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0

So likely I could improve the pipeline further. My actual pipeline looks like this:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 maxperf=1 bufapi-version=1 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=30/1’ ! mux.sink_0 nvstreammux name=mux batch-size=1 live-source=1 width=1920 height=1080 ! nvinfer model-engine-file=<ENGINE_PATH> config-file-path=<CONFIG_PATH> batch-size=6 unique-id=1 interval=5 ! nvtracker ll-lib-file=<TRACKER_PATH> ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! videorate ! ‘video/x-raw, framerate=30/1’ ! nvvideoconvert ! nvv4l2h264enc bufapi-version=1 bitrate=3000000 ! h264parse ! tee name=t t. ! queue ! flvmux ! rtmpsink location=‘rtmp://localhost:1935/local live=1’ t. ! queue ! splitmuxsink muxer=qtmux location=<VIDEO_PATH> max-size-time=40000000000 max-files=4

I will judge the stability over the next few days, but if the warning doesn’t backfire then my problem is solved :)

Seems to be stable on several devices.

On one other TX2 the same pipeline now causes nvargus-daemon to crash. Below is the complete log from the nvargus-daemon.

mars 23 18:05:43 sentinel-aev-4 systemd[1]: Started Argus daemon.
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: === NVIDIA Libargus Camera Service (0.97.3)=== Listening for connections…=== gst-launch-1.0[15922]: Connection established (7F75D021D0)OFParserListModules: module list: /proc/device
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module2
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module3
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module4
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module5
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: NvPclHwGetModuleList: No module data found
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: ---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
mars 23 18:06:58 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
**mars 23 18:07:07 sentinel-aev-4 nvargus-daemon[15748]: CAM: serial no file already exists, skips storing again=== gst-launch-1.0[15922]: CameraProvider initialized (0x7f70833cc0)CAM: serial no file already exists, skips storing againSCF: **
mars 23 18:07:07 sentinel-aev-4 nvargus-daemon[15748]: Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
mars 23 18:07:15 sentinel-aev-4 nvargus-daemon[15748]: === gst-launch-1.0[15922]: Connection closed (7F75D021D0)=== gst-launch-1.0[15922]: WARNING: CameraProvider was not destroyed before client connection terminated.=== gst-launch-1.0[15
mars 23 18:07:15 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error InvalidState: (propagating from src/services/gl/EGLStreamProducer.cpp, function ~EGLStreamProducer(), line 50)
mars 23 18:07:20 sentinel-aev-4 nvargus-daemon[15748]: === gst-launch-1.0[15922]: WARNING: Cleaning up 1 outstanding stream settings…=== gst-launch-1.0[15922]: WARNING: Cleaning up 1 outstanding sessions…PowerServiceCore:handleRequest
mars 23 18:07:20 sentinel-aev-4 nvargus-daemon[15748]: waitForIdleLocked remaining request 102
mars 23 18:07:20 sentinel-aev-4 nvargus-daemon[15748]: waitForIdleLocked remaining request 101
mars 23 18:07:20 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: waitForIdle() timed out (in src/api/Session.cpp, function waitForIdleLocked(), line 920)
mars 23 18:07:20 sentinel-aev-4 nvargus-daemon[15748]: (Argus) Error Timeout: (propagating from src/api/CaptureSessionImpl.cpp, function destroy(), line 166)
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 478)
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: Error: waitCsiFrameStart timeout guid 0
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI Stream Id = 0 Virtual Channel = 0
**mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI Debug Registers
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_CSIMUX_STAT_FRAME_0 = 0x00010029
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_CSIMUX_FRAME_STATUS_0 = 0x00000001
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_CFG_INTERRUPT_STATUS_0 = 0x3f000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_ISPBUFA_ERROR_0 = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_FMLITE_ERROR_0 = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: VI_NOTIFY_ERROR_0 = 0x00000000
**mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: *******************************************
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: CSI Stream Id = 0 Brick Id = 0
**mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: CSI Debug Registers
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: CILA_INTR_STATUS_CILA[0x10400] = 0x00000089
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: CILB_INTR_STATUS_CILB[0x10c00] = 0x00000088
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: INTR_STATUS[0x100a4] = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: ERR_INTR_STATUS[0x100ac] = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: ERROR_STATUS2VI_VC0[0x10094] = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: ERROR_STATUS2VI_VC1[0x10098] = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: ERROR_STATUS2VI_VC2[0x1009c] = 0x00000000
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: ERROR_STATUS2VI_VC3[0x100a0] = 0x00000000
**mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: *******************************************
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error BadValue: timestamp cannot be 0 (in src/services/capture/NvViCsiHw.cpp, function waitCsiFrameStart(), line 624)
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error BadValue: (propagating from src/common/Utils.cpp, function workerThread(), line 116)
mars 23 18:07:23 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error BadValue: Worker thread ViCsiHw frameStart failed (in src/common/Utils.cpp, function workerThread(), line 133)
mars 23 18:07:31 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/NvIspHw.cpp, function waitIspStatsFinished(), line 561)
mars 23 18:07:31 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP Stats timed out! (in src/services/capture/NvIspHw.cpp, function waitIspStatsFinished(), line 561)
mars 23 18:07:31 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 990)
mars 23 18:07:32 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP port 0 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 478)
mars 23 18:07:34 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP port 1 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 501)
mars 23 18:07:35 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: ISP port 2 timed out! (in src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 512)
mars 23 18:07:35 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: (propagating from src/services/capture/NvIspHw.cpp, function waitIspFrameEnd(), line 519)
mars 23 18:07:35 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: (propagating from src/common/Utils.cpp, function workerThread(), line 116)
mars 23 18:07:35 sentinel-aev-4 nvargus-daemon[15748]: SCF: Error Timeout: Worker thread IspHw frameComplete failed (in src/common/Utils.cpp, function workerThread(), line 133)

Hi,
It looks like the sensor driver is not ready. Please try the command and check if you can see video preview:

gst-launch-1.0 nvarguscamerasrc ! nvoverlaysink