Hi everyone, hoping someone can point me in the right direction. I’ve got a Jetson Nano 4G with an Arducam HAT and four IMX519 cameras (SKU: B0388). A few weeks ago 3 of the 4 cameras were coming up, but now I can’t get any of them to work at all. The video device is still there, but no images. At first the cameras were unstable and I’d see “select time out” messages on the Nano. Then I found the mini cable on one of the cameras was off. After I reseated it, everything stopped. I honestly can’t tell if it’s a camera, the HAT, or the software.
Let’s pin down the setup first. Can you run ll /dev/video0 and paste the result? Also list the exact commands you’ve been running so we’re on the same page.
Sure. The node looks like this:
crw-rw----+ 1 root video 81, 0 Sep 30 18:14 /dev/video0
Commands I’ve been using:
python AutofocusTest.py -i 8
python FocuserExample.py -i 7
i2cset -y 8 0x24 0x24 0x22
v4l2-ctl -d /dev/video0 --set-fmt-video=width=4656,height=3496, --set-ctrl bypass_mode=0,sensor_mode=0 --stream-mmap --stream-count=2 --stream-to=111a.raw --verbose
One more thing: if I connect a camera straight to the CSI port with the white MIPI ribbon (bypassing the HAT), that camera isn’t detected either. That’s why I can’t figure out which part is actually broken.
OK. Let’s capture the actual failure from the autofocus script. Run python AutofocusTest.py -i 8 and paste the complete output including the traceback.
Here’s what I get:
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 Failed to create CaptureSession
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Error: Write failed
Traceback (most recent call last):
File “AutofocusTest.py”, line 44, in
cv2.imshow(“Test”, frame)
The imshow is just where it happens to blow up because the frame is empty — the real failure is the CaptureSession part.
Right, “Failed to create CaptureSession” from gstnvarguscamerasrc usually means the sensor never initialized on I2C. Let’s see what the bus actually detects. Run i2cdetect -r -y 8 and paste the grid.
Here’s the current i2cdetect output:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – UU – – – – –
20: – – – – 24 – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: UU – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – 6a – – – – –
70: – – – – – – – –
I see 0x24 and 0x6a, and 0x40 shows UU (kernel driver holding it). But that alone doesn’t prove the sensor will stream. Let’s try a raw capture with:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=4656,height=3496, --set-ctrl bypass_mode=0,sensor_mode=0 --stream-mmap --stream-count=2 --stream-to=111a.raw --verbose
Paste the verbose output.
First run:
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 4656/3496
Pixel Format : ‘RG10’
Field : None
Bytes per Line : 9344
Size Image : 32666624
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
^C
It got all the way to STREAMON ok, then just hung. I had to Ctrl-C it and no frames were shown.
Interesting — STREAMON succeeded but no buffer was ever dequeued, which smells like a sensor init/timing race. Run the exact same command a second time, right after, and paste that output.
Second run worked this time:
VIDIOC_STREAMON: ok
Index : 1
Type : Video Capture
Flags : mapped
Field : None
Sequence : 1
Length : 32666624
Bytesused : 32666624
Timestamp : 732.310656s (Monotonic, End-of-Frame)
Index : 2
Type : Video Capture
Flags : mapped
Field : None
Sequence : 2
Length : 32666624
Bytesused : 32666624
Timestamp : 732.416699s (Monotonic, End-of-Frame)
VIDIOC_STREAMOFF: ok
So two frames captured fine on the second attempt. This ‘works sometimes, fails sometimes’ behavior is exactly what I was seeing before.
That confirms it’s intermittent rather than fully dead. For comparison, do you have an older i2cdetect -r -y 8 from when things were partially working? I want to see which addresses were present back then. I also have my own earlier capture with only two cameras on ports 1 and 2 to compare.
Here’s the older one from before:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – 0c – – – –
10: – – – – – – – – – – UU – – – – –
20: – – – – 24 – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: UU – – – – – – – – – – – – – – –
50: 50 – – – – – – – – – – – – – – –
60: – – – – – – – – – – 6a – – – – –
70: – – – – – – – –
Notice 0x0c and 0x50 were there before, and they’re gone in the current capture.
Here’s my earlier capture for reference, with only two cameras on ports 1 and 2:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – 0c – – –
10: – – – – – – – – – – UU – – – – –
20: – – – – 24 – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: UU – – – – – – – – – – – – – – –
50: 50 – – – – – – – – – – – – – – –
60: – – – – – – – – – – 6a – – – – –
70: – – – – – – – –
So 0x0c and 0x50 were still present even with only two cameras connected. Which addresses appear depends on which ports have cameras, so i2cdetect alone can’t tell us if a camera is actually healthy.
Two more checks while you’re in there: does python FocuserExample.py -i 7 still show images? And what happens when you run i2cset -y 8 0x24 0x24 0x22?
python FocuserExample.py -i 7 used to show images but now it doesn’t do anything. I also ran i2cset -y 8 0x24 0x24 0x22 with only two cameras on ports 1 and 2 — no output. During the v4l2-ctl tests I also only had two cameras connected, on ports 1 and 2. I’ve tried connecting all four cameras to the HAT at once and using the gstreamer preview, but I’m still stuck. Is there any tool to diagnose whether the HAT or the camera is the problem?
Let me lay out where we are. Arducam HAT + IMX519 (B0388) on the Jetson Nano 4G, unstable from the start — 3 of 4 worked, then zero after the mini cable issue. The same command works sometimes and fails other times. A camera directly on the CSI port via the white MIPI ribbon isn’t detected. So right now the root cause is still open: it’s either a defective camera module or a defective HAT board. Instead of more blind testing, let’s isolate it by swapping.
Connect all four cameras to the HAT at the same time and preview them with the gstreamer command. If two cameras are bad, two of the four preview windows will be black — post a screenshot of the preview at that moment so we can see which positions are failing.
OK, that makes sense. If I do see two black windows, how exactly do I prove whether it’s the cameras or the HAT ports?
Swap them. Take the two working cameras and exchange them with the two not-working cameras on the HAT. If the problem follows the cameras, the cameras are the faulty part; if it stays on the same HAT ports, the HAT is the faulty part.
Even better, do a single swap: exchange the position of one known-good camera and one suspect camera on the HAT board, then run the gstreamer command again. That tells you cleanly whether the fault moves with the camera or stays with the port.
Got it. Which example repo should I use for the gstreamer preview so I’m running the right thing?
For reference, the example code is here: GitHub - ArduCAM/Jetson_IMX519_Focus_Example · GitHub
To sum up the current conclusion:
i2cdetect -r -y 8shows devices at 0x24 and 0x6a (and earlier at 0x0c and 0x50), and /dev/video0 exists, but AutofocusTest.py still fails with “Failed to create CaptureSession” plus the GStreamer “Cannot query video position” warning. So bus presence alone isn’t enough.- Identify the bad part by controlled swapping of known-good and suspect cameras between HAT ports while previewing with gstreamer — don’t rely only on i2cdetect or /dev/video0 showing up.
- Connecting only two cameras on the same side of the HAT board is not a valid test configuration.
- Since a camera isn’t detected even when directly connected via the white MIPI ribbon, the problem may not be limited to the HAT board.
If the fault follows the camera when you swap, the camera is the problem. If it stays with the HAT port, the HAT is the problem. Let us know what the swap test shows.