Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VC IMX568 DeviceTree #132

Open
nirushka opened this issue Jan 29, 2025 · 6 comments
Open

VC IMX568 DeviceTree #132

nirushka opened this issue Jan 29, 2025 · 6 comments

Comments

@nirushka
Copy link

Hi,

I am using IMX568 sensor On a custom Nvidia NX Xavier carrier board with Jetpack 5.0.2.
I would like to know which values should i put in the device tree.

I have an issue that my video seems to be wrong. I can't see a clear image.

VC_MIPI_METADATA_H = 4 // Tried 2 also
NUM_LANES = 2

My current device tree params are:

            physical_w              = "6.752";
            physical_h              = "5.655";

                num_lanes                = NUM_LANES;
                tegra_sinterface         = "serial_a";
                embedded_metadata_height = VC_MIPI_METADATA_H;
                readout_orientation      = "0";

                // ----------------------------------------------------
                // If you want to use GStreamer with nvarguscamerasrc
                // you have to adjust this settings. 
                active_w                 = "2464";
                active_h                 = "2064";
	    active_l 		     = "0";
	    active_t 		     = "0";

                mode_type                = "bayer";
                pixel_phase              = "rggb";
	    csi_pixel_bit_depth      = "10";
                min_gain_val             = "0";         // mdB
                max_gain_val             = "48000";     // mdB
                step_gain_val            = "100";       // mdB
                default_gain             = "0";         // mdB

                min_exp_time             = "1";         // us
                max_exp_time             = "10000";   // us
                step_exp_time            = "1";         // us
                default_exp_time         = "1000";     // us

                min_framerate            = "0";         // mHz
                max_framerate            = "41300";     // mHz
                step_framerate           = "100";       // mHz
                default_framerate        = "41300";     // mHz
                // ----------------------------------------------------

                gain_factor              = "1000";
                exposure_factor          = "1000000";
                framerate_factor         = "1000";
                inherent_gain            = "1";
                min_hdr_ratio            = "1";
                max_hdr_ratio            = "1";

                line_length              = "0";
                phy_mode                 = "DPHY";
                discontinuous_clk        = "no";
                mclk_khz                 = "24000";
                pix_clk_hz               = "74250000";
                mclk_multiplier          = "9.33";
                cil_settletime           = "0";
                dpcm_enable              = "false";
@nirushka
Copy link
Author

The problem I am seeing:

Screencast.from.30-01-25.19.43.17.webm

@bazo80
Copy link
Collaborator

bazo80 commented Feb 12, 2025

Hello @nirushka ,

the v4l2-ctl is recommending the metadataheight value. The PregiusS (IMX568) is needing a metadataheight value of 1 in order to stream correctly, although the datasheet is stating otherwise (#103). We have adjusted this value in the dtsi files for the next revision of the driver. Other streaming tools are a little bit less restrictive.

We had the same kind of tear-down-effect for the PregiusS on nvidia platforms, so that we had to set the end of active video bit. On which driver version are you running?
Maybe you took an older version, where this bit is not set.

Btw: which streaming tool have you used?

best regards

@nirushka
Copy link
Author

Hi Bazo,

Thanks, I'll change to the metadata height to 1.
I am actually not sure on which driver version i am running but i'll try to build the latest now.

Is it possible to print the patch you did here? - "so that we had to set the end of active video bit."

My streaming tool is Gstreamer, here is my streaming pipeline:

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM) ! nvvidconv ! video/x-raw, width=1024, height=768, format=I420 ! x264enc bitrate=8000 tune=4 speed-preset=1 ! rtph264pay ! udpsink host=X port=Y sync=false

@bazo80
Copy link
Collaborator

bazo80 commented Feb 12, 2025

@nirushka ,

I am actually not sure on which driver version i am running...

when the system is booting, the dmesg is showing a table like this:

[    9.366400] vc_mipi 9-001a: vc_probe(): Probing UNIVERSAL VC MIPI Driver (v0.18.2)
...
[    9.504520] i2c 9-0010: +--- VC MIPI Camera -----------------------------------+
[    9.504530] i2c 9-0010: | MANUF. | Vision Components               MID: 0x0427 |
[    9.504533] i2c 9-0010: | MODULE | ID:  0x0568                     REV:   0004 |
[    9.504536] i2c 9-0010: | SENSOR | SONY IMX568                                 |
[    9.504539] i2c 9-0010: +--------+---------------------------------------------+

With v0.16.0 and upward we have set the EAV bit at adress 0x3942.
In the latest versions it is called IMX56X_EAV_SELECT
https://github.com/VC-MIPI-modules/vc_mipi_nvidia/blob/master/src/driver/vc_mipi_modules.c

best regards

@nirushka
Copy link
Author

Hi Bazo,

Thx, It fixed it.
Is there any way to control the colours of the sensor?

@bazo80
Copy link
Collaborator

bazo80 commented Feb 12, 2025

From the video you posted, it looks a little bit pale.
There is the black_level control the ISP (gstreamer) is not aware of.
This control is set during initialization by the driver and the v4l2-ctl -l is showing 0 as a value.
So, you could set

v4l2-ctl -c black_level=1
v4l2-ctl -c black_level=0

The black_level gives a little offset to the pixels, the ISP thinks it is too bright and tries to regulate down the exposure/gain, but the offset stays.
So resetting the black_level would give you a more saturated image.

The other way would be to place a so called camera_override.isp file into the /var/nvidia/nvcam/settings/ directory.
In the override file, there is the possibility to handle/correct certain values like colors or autowhite balancing.
I have to ask the colleagues, whether we have something here.

best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants