I have a few questions about the PWL HDR camera device tree

Hi

I am developing an ox08b40 camera. The ox08b40 has uncompanded 24-bit, 20/16/14/12-bit (PWL) combined HDR features. So I referenced the imx185 camera with PWL WDR feature, but I have a few questions due to device tree creation issues, so I leave a question.

  1. If PWL 12 is selected, the MIPI RAW image data type is RAW 12, so should the csi_pixel_bit_depth value be set to 12? And can the dynamic_pixel_bit_depth value be set to 24 because the uncompanded value is 24-bit?

  2. When sending uncompanded 24-bit as it is, can I set the dynamic_pixel_bit_depth value to 24 and the csi_pixel_bit_depth value to match the MIPI RAW image data types? And in this case, can the control_point_x(or_y) values ​​be deleted from the device tree?

  3. If the control_point_x(or_y) values ​​are incorrect, is the following message output?
    tracer.txt (110.8 KB)

  4. The physical_w/physical_h values ​​are described as Physical dimensions of sensor. What exactly do you mean? Are you talking about chip size? Or something else?

Please help me.

hello user20915,

>> Q1, Q2
FYI, the maximum PWL-WDR supported is Raw 20-bits.
it’s ISP take maximum 16-bits input, PWL compressed/de-compress internally as 20-bit before processing.
please see-also developer guide, Sensor Software Driver Programming, you may check [Property-Value Pairs] and review those PWL-WDR specific device tree settings.

>> Q3
there’s CHANSEL_NOMATCH according to your tracing logs.
it usually caused by no match pixel types. please review your device tree configurations.
such as, mode_type, csi_pixel_bit_depth, and pixel_phase.

     kworker/0:1-723   [000] ....    71.781474: rtcpu_vinotify_error: tstamp:2894542790 tag:CHANSEL_NOMATCH channel:0x01 frame:3 vi_tstamp:2894539975 data:0x00000589
     kworker/0:1-723   [000] ....    71.781475: rtcpu_vinotify_event: tstamp:2894651226 tag:CHANSEL_PXL_EOF channel:0x23 frame:2 vi_tstamp:2894113208 data:0x01df0002

>> Q4
it’s physical dimensions of sensor. you may set physical_w/physical_h as horizontal width/vertical height of active surface.

Does maximunm 16-bits input mean that CSI/VI accepts up to 16-bits?

hello user20915,

yes, your understanding is correct.

FYI,
for Nano and TX2 series, the max input bit for CSI/VI is 14.
for Xavier series, the max input bit for CSI/VI is 16.

I am getting the same CHANSEL_NOMATCH message despite changing the mode_type, csi_pixel_bit_depth, and pixel_phase values as advised.

Is there a way to check the data type of the incoming data?

hello user20915,

it’s pixel parser to check data type, and it used configuration from device tree.
you may probe the signal or review the register values to examine the incoming data.

however, may I know which JetPack release you’re using?

hello JerryChang

I am using NVIDIA L4T 32.6.1.

I guess the register you mentioned is VI_CSIMUX_INJECT_HEADER, so I tried:

$ sudo devmem2 0x15C05654

/dev/mem opened.
Memory mapped at address 0x7f9e730000.
Bus error

hello user20915,

are you able to probe the MIPI signaling? please check you have high speed signal sending to CSI brick.

hello JerryChang

I checked the MIPI RX clock with an oscilloscope. I also checked that other cameras are working.

The kernel message looks like this:

[  +0.002003] ox08b40 32-0036: ox08b40_probe: probing v4l2 sensor.
[  +0.000009] ox08b40 32-0036: TEGRA_CAMERA_CID_GAIN
[  +0.000007] ox08b40 32-0036: TEGRA_CAMERA_CID_EXPOSURE
[  +0.000003] ox08b40 32-0036: TEGRA_CAMERA_CID_FRAME_RATE
[  +0.000005] ox08b40 32-0036: TEGRA_CAMERA_CID_FUSE_ID
[  +0.000119] ox08b40 32-0036: ox08b40_parse_dt: Entered.
[  +0.000131] ox08b40 32-0036: ox08b40_power_get: Entered
[  +0.000003] ox08b40 32-0036: ox08b40_power_get: mclk_name: extperiph1
[  +0.023999] ox08b40 32-0036: tegracam sensor driver:ox08b40_v2.0.6
[  +0.000021] ox08b40 32-0036: ox08b40_board_setup: Entered
[  +0.000008] ox08b40 32-0036: ox08b40_power_on: Entered
[  +0.014260] ox08b40 32-0036: ox08b40_power_off: Entered
[  +0.002182] ox08b40 32-0036: ox08b40_power_on: Entered
[  +0.013082] ox08b40 32-0036: ox08b40_power_off: Entered
[  +0.001649] ox08b40 32-0036: ox08b40_i2c_if_check: i2c I/F Check Success.
[  +0.000095] ox08b40 32-0036: ox08b40_fill_string_ctrl: Entered
[  +0.000040] tegra194-vi5 15c10000.vi: subdev ox08b40 32-0036 bound
[  +0.003438] ox08b40_debugfs_create:    devnode:video0, debugfs_dir:camera-video0
[  +0.000070] ox08b40 32-0036: ox08b40_probe: size: 1319
[  +0.000007] ox08b40 32-0036: ox08b40_probe: Detected OX08B40 Sensor.
[  +0.010524] ox08b40 32-0036: ox08b40_power_on: Entered
[  +0.000254] ox08b40 32-0036: ox08b40_open.
[  +0.046346] vi5_setup_surface: height: 480, width: 640, format: 196, data type: 44
[  +0.000071] vi5_setup_surface: height: 480, width: 640, format: 196, data type: 44
[  +0.000011] vi5_setup_surface: height: 480, width: 640, format: 196, data type: 44
[  +0.000009] vi5_setup_surface: height: 480, width: 640, format: 196, data type: 44
[  +0.007701] ox08b40 32-0036: ox08b40_set_mode: Entered
[  +0.000007] ox08b40 32-0036: ox08b40_set_mode: s_data->mode: 2
[  +0.000005] ox08b40 32-0036: ox08b40_set_mode: size: 1319
[  +0.037419] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[  +0.148949] ox08b40 32-0036: ox08b40_start_streaming: Entered
[  +0.026228] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 160

hello user20915,

it actually a warning message.
this message indicate there’s capture failure, it’ll drop the capture buffer and re-queue the frames again.

is the VI tracing logs keep shown CHANSEL_NOMATCH tags?
please double check sensor register settings of embedded_metadata_height .
if you set embedded_metadata_height = 1 for sensors that does NOT really output embedded data, the capture will not works for Xavier series.

may I also know what’s the camera connections,
is it a bayer camera which connect to CSI connecter directly?
or, you’re having external physical device (such as, SerDes) between sensor module and CSI connector?

hello JerryChang

It still marks the CHASEL_NOMATCH tag the same.

For the camera connection, it is connected like this: xavier - camera interposer module - camera. The clock was checked on xavier’s camera connector (J509).

Embedded_metadata_height is 2 top and 2 bottom enabled, so I tried setting it to 4, and the Statistics line was also enabled, so I set it to 6 as well.

In order to receive the compressed data because it said that it does not support decompressing additionally compressed 12-bit data to 24-bit. The
csi_pixel_bit_depth value was set to 12 and the mode_type was set to bayer.

The device tree looks like this:

mode0 { /* MODE_3840X2160_HDR_30FPS */
    mclk_khz = "24000";
    num_lanes = "4";
    tegra_sinterface = "serial_a";
    phy_mode = "DPHY";
    discontinuous_clk = "no";
    dpcm_enable = "false";
    cil_settletime = "0";
    csi_pixel_bit_depth = "12";
    mode_type = "bayer";
    pixel_phase = "rggb";

    active_w = "3840";
    active_h = "2160";
    readout_orientation = "0";
    line_length = "2376"; /* Refer to the sensor's register value */
    inherent_gain = "1";
    mclk_multiplier = "11.11";
    pix_clk_hz = "266666667"; /* 800Mbps * 4lane / 12-bits */

    gain_factor = "10";
    min_gain_val = "0";
    max_gain_val = "120";
    step_gain_val = "3";
    default_gain = "0";
    min_hdr_ratio = "16";
    max_hdr_ratio = "16";
    framerate_factor = "1000000";
    min_framerate = "1500000";
    max_framerate = "30000000";
    step_framerate = "1";
    default_framerate= "30000000";
    exposure_factor = "1000000";
    min_exp_time = "2433";
    max_exp_time = "660000";
    step_exp_time = "1";
    default_exp_time = "33334"

    embedded_metadata_height = "4"; /* or 6 */
};

hello user20915,

oh… embedded metadata behind active region is not supported.
if you configure embedded_metadata_height as four, it’ll looking for 4-line ahead of active regions.
could you please configure sensor to disable bottom of embedded metadata, and update the DT settings.

don’t you works with PWL camera sensor? it should configure mode type as bayer_wdr_pwl.
if your settings is bayer, it determine the camera as Raw12 SDR.

hello JerryChang

I set it to bayer for two reasons.

  1. You mentioned that the maximum supported bit for PWL-WDR is 20-bit, but it is because I am having a hard time changing from ncompaned 24-bit to uncompaned 20-bit.
  2. In the case of compressed data, it is compressed as RAW 12, so even if the image is strange, I think it can be received if the data type is correct.

okay, please try revise embedded_metadata_height accordingly.

hello JerryChang

Line length is the value of the register’s horizontal total size, and pix_clk_hz is the value calculated using the D-phy clock. Can I input it like that?

pix_clk_hz is a value calculated using the D-phy clock, can I enter it like that?

Sorry for so many requests and greatly appreciate your support.

hello user20915,

please refer to Sensor Software Driver Programming for the details.
for example,

line_length
Pixel line width horizontal timing size for the sensor mode. Used to calibrate the features in the camera stack.
The value must be greater than or equal to active_w.

please see-also Sensor Pixel Clock session for the formula to calculate the correct sensor pixel clock rate.
there’re three different formulas, they might output a little different calculation results.
in generally, you may assign the biggest calculation results to pixel_clk_hz device tree settings.