IMX519 on Jetson Nano with no Autofocus option

  1. Where did you get the camera module(s)?
    Arducam

  2. Model number of the product(s)?
    IMX519

  3. What hardware/platform were you working on?
    Jetson Nano 2GB with all updates and upgrades installed. Running Headless.

  4. Instructions you have followed. (link/manual/etc.)
    Followed this link for installing the drivers, and the focus example.
    IMX519 16MP Autofocus Camera on Jetson Nano and Xavier NX - Arducam
    I followed the instructions from the following to check both the video0 and /dev/v4l-subdev1
    How to access and program the Pivariety Camera using Command Line, Python, OpenCV, and GStreamer

  5. Problems you were having?
    The autofocus does not respond when using the python example. When running v4l2-ctl -l get the following read outs.
    ~$ v4l2-ctl -l -d /dev/v4l-subdev1

Camera Controls

                 group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                sensor_mode 0x009a2008 (int64)  : min=0 max=4 step=1 default=0 value=0 flags=slider
                       gain 0x009a2009 (int64)  : min=16 max=256 step=1 default=16 value=16 flags=slider
                   exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=13 flags=slider
                 frame_rate 0x009a200b (int64)  : min=2000000 max=10000000 step=1 default=10000000 value=2000000 flags=slider

~$ v4l2-ctl -l -d /dev/video0

Camera Controls

                 group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                sensor_mode 0x009a2008 (int64)  : min=0 max=4 step=1 default=0 value=0 flags=slider
                       gain 0x009a2009 (int64)  : min=16 max=256 step=1 default=16 value=16 flags=slider
                   exposure 0x009a200a (int64)  : min=13 max=683709 step=1 default=2495 value=13 flags=slider
                 frame_rate 0x009a200b (int64)  : min=2000000 max=10000000 step=1 default=10000000 value=2000000 flags=slider
                bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
            override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
               height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                 size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
           write_isp_format 0x009a2068 (bool)   : default=0 value=0
   sensor_signal_properties 0x009a2069 (u32)    : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
    sensor_image_properties 0x009a206a (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
  sensor_control_properties 0x009a206b (u32)    : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
          sensor_dv_timings 0x009a206c (u32)    : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
           low_latency_mode 0x009a206d (bool)   : default=0 value=0
           preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
               sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=4 flags=read-only
  1. The dmesg log from your hardware?
    The dmesg area pertaining to the device.

[ 1.259260] i2c /dev entries driver
[ 1.261481] imx519 6-001a: tegracam sensor driver:imx519_v2.0.6
[ 1.275643] tegradc tegradc.0: blank - powerdown
[ 1.322135] extcon-disp-state extcon:disp-state: cable 47 state 0
[ 1.322138] Extcon AUX1(HDMI) disable
[ 1.365123] tegradc tegradc.0: unblank
[ 1.371545] tegradc tegradc.0: nominal-pclk:65000000 parent:65000000 div:1.0 pclk:65000000 64350000~70850000
[ 1.371652] tegradc tegradc.0: hdmi: tmds rate:65000K prod-setting:prod_c_hdmi_54m_75m
[ 1.372735] tegradc tegradc.0: hdmi: get YCC quant from EDID.
[ 1.407671] extcon-disp-state extcon:disp-state: cable 47 state 1

  1. Troubleshooting attempts you’ve made?
    The system was running the IMX477 before I switched over to this camera. Initially I was having issues where the gstream would not run modes 1 or 2 with an error that the framerate was not supported. I resolved that issue by removing and purging the configs for arducam-nvidia-l4t-kernal. Followed by running the install directions for the IMX519 again.

The list devices gives

v4l2-ctl --list-devices
vi-output, imx519 6-001a (platform:54080000.vi:0):
/dev/video0

I when trying to set the focus on the video0, or the v4l-subdev1 I get

unknown control ‘focus_absolute’

I have verified that I’m running the correct jetpack version

head -n 1 /etc/nv_tegra_release

R32 (release), REVISION: 6.1, GCID: 27863751, BOARD: t210ref, EABI: aarch64, DATE: Mon Jul 26 19:20:30 UTC 2021

when running the FocuserExample I get the following output.
nvbuf_utils: Could not get EGL display connection
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 4656 x 3496 FR = 10.000000 fps Duration = 100000000 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3840 x 2160 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 3
Output Stream W = 1280 H = 720
seconds to Run = 0
Frame Rate = 120.000005
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[ 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
7
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success

(python3:8938): GStreamer-CRITICAL **: 12:22:52.288: gst_mini_object_unref: assertion ‘GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0’ failed

I get the interface that is shown in the instructions, as well as a small live video window. adjusting the value from 0 to 1000 has no effect on the video feed. I have tried hitting enter after each adjustment, as well as ‘f’ and enter with the same lack of results.

  1. What help do you need?

I need assistance in getting the focus_absolute option to be available. Really at a loss for what else I can try. Without this option the camera is dead in the water.

@CBPSaga

Can you tell me the sku number of your camera, or a link to buy it?

Item # B0371
16MP Autofocus Camera for Raspberry Pi and Nvidia Jetson Nano/NX
Purchased on July 17th of this year. Looking at the transaction info on paypal and the ship info is from arducam. But the payment appears to have been to UCTRONICS.com.

@CBPSaga

imx519 is not controlled using focus_absolute. focus_absolute works with our jetvariety series cameras. It is controlled by i2c, which you can call with our wrapped classes.

v4l-subdev1 is a Raspberry Pi node, on Jetson please use video0.

Please follow the link below for development.

By the way, you have a link about Raspberry Pi, please don’t follow the steps in it.

The link you provided is the same one that I posted up in question #4. The python script does not change the at all. At this point I’m beginning to believe that the device is none functional.

when I run 12cdetect, nothing shows up unless I force it with -a. But even then it is only showing stuff on 5x addresses. The none probed values on the first line are on 0,1,and 2. From what I have read those are system reserved. I see from the code on the focuser.py file that it is attempting to map “i2cset -y {} 0x{:02x} 0x02 0x00”

sudo i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

sudo i2cdetect -F 0
Functionalities implemented by /dev/i2c-0:
I2C yes
SMBus Quick Command no
SMBus Send Byte yes
SMBus Receive Byte yes
SMBus Write Byte yes
SMBus Read Byte yes
SMBus Write Word yes
SMBus Read Word yes
SMBus Process Call yes
SMBus Block Write yes
SMBus Block Read no
SMBus Block Process Call no
SMBus PEC yes
I2C Block Write yes
I2C Block Read yes

sudo i2cdetect -a -y 0x02
Warning: Can’t use SMBus Quick Write command, will skip some addresses
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
10:
20:
30: – – – – – – – –
40:
50: 50 – – – – – – 57 – – – – – – – –
60:
70:

I will keep trying to troubleshoot this for a little bit longer. I am new to i2c and will see what I can get from going down the rabbit hole.

I also am not fluent in Python. I can write, java,javascript,C++, C, and C# all day long… but never liked the look of Python… with that said… I need to correct some of my assumptions above.

so it looks like it is supposed to write to 0x0C not 0x02. I’m running through the documentation for i2c and attempting to figure out how to console the i2c tools so I have a bit more control and understanding of what is needed to run this. Fingers crossed I get some results.

when I try to run the AutoFocusTest it says that i2c-7 does not exist. This is the output when I list the devices setup for i2c
ls /dev/i2c*
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2 /dev/i2c-3 /dev/i2c-4 /dev/i2c-5 /dev/i2c-6

@CBPSaga

Sorry, this doc is not perfect, for Jetson Nano 2G you should use

python3 FocuserExample.py -i 6

Thank you Thank you Thank you!!! You have really helped me in understanding not only the correct software tools for working with the camera, but the correct address as well. Now the fun begins!