Closed mdegans closed 3 years ago
Notes:
metadata=false
(gst-launch-1.0 nvmanualcamerasrc metadata=false ! autovideosink
gives same error).ptzf
element in the code aboves makes a copy of the metadata but does not remove it.nvarguscamerasrc
does work in the same pipelinecommon.cfg
, but this file seems be nowhere on the system in question. Seems to be part of driver source.gst-launch-1.0 nvmanualcamerasrc digitalgain=4.0 gain=8.0 metadata=true bayer-sharpness-map=true ! ptzf device=$DEVICE ! autovideosink
Tests and demos in mdegans/dev
that work:
demo_sharpness
demo_sharpness_overlay
test_properties
has a separate issue likely related to the chosen mode:
SCF: Error OverFlow: Temp BufferPool exceeds max expected size: 10 (4032x3040 BL U8_V8_ER 420SP) (in src/services/buffermanager/BufferPool.cpp, function allocBuffer(), line 218)
SCF: Error OverFlow: Possibly due to pipeline slowdown, can cause memory bloat. (in src/services/buffermanager/BufferPool.cpp, function allocBuffer(), line 220)
Session 1 has 11 CCs in-flight:
test_metadata
After flashing to 4.5, same issue occurs on the same machine so it appears JetPack is unrelated. One works. One consistently produces the above error. Problem is something else:.
Differences between the machines:
uname -a
: Linux test45477 4.9.201-tib #1 SMP PREEMPT Thu Feb 4 17:07:40 PST 2021 aarch64 aarch64 aarch64 GNU/Linux
identical
rootfs
: was identical on flash and both devices are fully updated using the r32.5
repos
/boot/extlinux/extlinux.conf
: identical (sha512 checked)
/boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb
: identical (sha512 checked)
/etc/nv_tegra_release
: identical (sha512 checked)
/var/nvidia/nvcam/settings/camera_overrides.isp
identical
Seems Issue occurs on TX2 as well (with unmodified source):
Likely related to AeRegion edit: nope
Created thread on Nvidia forum to ask for external help with this: https://forums.developer.nvidia.com/t/nvarguscamerasrc-built-from-source-isp-error/178939/2
Tried commenting out any reference to aeRegions
(only in metadata). Same issue.
ruled out clearing cache on both machines by rm ${HOME}/.cache/gstreamer-1.0/registry.aarch64.bin
(GST_REGISTRY_UPDATE=yes
was already set, but why not).
Driver info for both nanos;
Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, imx477 7-001a
Bus info : platform:54080000.vi:0
Driver version: 4.9.201
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
both using this driver revision for JetPack 4.5:
So, I used GDB to take a look at what gst-launch is doing. when this is reached:
SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 992)
nvmanualcameras
thread is blocked at g_cond_wait
while (!self->stop_requested && !self->unlock_requested &&
g_queue_is_empty(self->nvmm_buffers)) {
g_cond_wait(&self->nvmm_buffers_queue_cond, &self->nvmm_buffers_queue_lock);
}
consumer_thread
is blocked at g_cond_wait
while (g_queue_is_empty(self->manual_buffers)) {
g_cond_wait(&self->manual_buffers_queue_cond,
&self->manual_buffers_queue_lock);
}
ditto with manual_thread
(producer.cpp
)
if (src->stop_requested == FALSE) {
g_mutex_lock(&src->eos_lock);
g_cond_wait(&src->eos_cond, &src->eos_lock);
g_mutex_unlock(&src->eos_lock);
}
another manual_thread
is stuck at:
UniqueObj<Frame> frame(iFrameConsumer->acquireFrame());
So the camera source is waiting on buffers, but they're not coming from libargus, so it stalls forever.
Why it works in a C app but breaks with gst-launch or with a gui app. idk. gst-launch
is just a c app that (presumably) calls gst_parse_launch
, yet the test_string_pipeline
test that does exactly that and it works.
It would sure help if there were source code available for the Nvidia parts.
same error in this thread: https://forums.developer.nvidia.com/t/writing-a-custom-gstreamer-plugin/154362/10?u=mdegans
YAY. Found the fix: https://forums.developer.nvidia.com/t/writing-a-custom-gstreamer-plugin/154362/11?u=mdegans
Replace -largus with -largus_socketclient.
and it works!
ninja: Entering directory `/home/dev/code/gst-nvmanualcamerasrc/builddir'
ninja: no work to do.
1/4 test metadata OK 4.12s
2/4 test properties OK 16.93s
3/4 test string pipeline OK 4.25s
4/4 gstlaunch test OK 4.25s
Ok: 4
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /home/dev/code/gst-nvmanualcamerasrc/builddir/meson-logs/testlog.txt
Works on one nano but not another. Issue occurs on both JetPack 4.4 and 4.5.
gst-launch-1.0 nvmanualcamerasrc ! autovideosink
This happens with some pipelines but not others. This test works perfectly: