Hi,
I am newer, I use xs9922b chip to convert 4 ahd cameras to mipi data, and connect with csi2 port. I have add device tree and driver, and can list /dev/video0...3, when I execute "gst-launch-1.0 -v v4l2src device="/dev/video0" ! video/x-raw,framerate=25/1,width=1920,height=1080,format=UYVY ! xvimagesink &
" to open camera, it show green image, and I found that set_mode/start_streaming callback not called. so:
how need to debug it?
or need I change the flow? because my flow need to call set_mode and start_streaming
attach my driver and dts, Hope got help, Thanks!
tegra234-camera-rbpcv2-xs9922.dtsi.log (12.0 KB)
xs9922_mode_tbls.h.log (13.4 KB)
nv_xs9922.c.log (19.3 KB)
dmesg.log (81.4 KB)
hello 1010622394,
here’re couple of questions..
may I know which Jetpack public release version you’re working with?
is this porting issue? had you verified this sensor driver before?
you may refer to developer guide, Module Properties .
please set different position property for your camera sensors. you may set bottomleft, bottomright, centerleft, centerright for your 4 camera nodes.
please also check Applications Using V4L2 IOCTL Directly ,
let’s try use V4L2 IOCTL to verify basic camera functionality.
for instance,
$ v4l2-ctl -d /dev/video0 --list-formats-ext
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
Hi JerryChang:
Thanks for your quick response!
my jetpack version is r35.3.1 with orin nano
it is the new driver, not used before
I will try the suggestion for position and v4l2-ctl first and then feedback
Hi JerryChang:
I have changed the code, and can call set_mode and start streaming now, I have 2 questions need your confirm:
1. is the driver developed all for my camera? even if have some problem
2. if driver developed all, how to debug next?
for example:
1. I need to confirm reg
2. I need to measure the mipi data
3. what are the commands to debug?
attach my logs:
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
[1]: 'NV16' (Y/CbCr 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
[2]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
nv_xs9922.c.log (19.7 KB)
dmesg.log (8.0 KB)
hello 1010622394,
v4l2-ctl -d /dev/video0 --list-formats-ext it checks the sensor driver for the available sensor formats.
for testing the stream, please see-also developer guide, Approaches for Validating and Testing the V4L2 Driver .
Hi JerryChang:
can you help me confirm whether the dts’s pixel_clk_hz is right? pixel_clk_hz is only for one csi channel or total?
1920x1080x8x25(fps)x4(lanes)x1.15(overload)=1907712000, so I set to 2000000000
mclk_khz = "27000";
num_lanes = "1";
tegra_sinterface = "serial_c";
vc_id = "2";
phy_mode = "DPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
lane_polarity = "0";
active_w = "1920";
active_h = "1080";
mode_type = "yuv";
pixel_phase = "uyvy";
csi_pixel_bit_depth = "8";
readout_orientation = "0";
line_length = "1920";
inherent_gain = "1";
mclk_multiplier = "8";
pix_clk_hz = "2000000000";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "170"; /* 10.66x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "25000000"; /* 25.0 fps */
max_framerate = "25000000"; /* 25.0 fps */
step_framerate = "1";
default_framerate = "25000000"; /* 25.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "2495"; /* us */
embedded_metadata_height = "0";
how to check mipi status?
hello 1010622394,
you should check developer guide, Sensor Pixel Clock for several ways to obtain the correct sensor pixel clock rate.
I usually check the pixel clock rate by using sensor CSI lane output rate.
Hi JerryChang:
I have changed the sensor_pix_clock, and vi show the log as follows:
test command:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --set-ctrl bypass_mode=0 --stream-count=100
tegra234-camera-rbpcv2-xs9922.dtsi.log
kworker/1:3-124 [001] .... 892.747980: rtcpu_nvcsi_intr: tstamp:28570364185 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747981: rtcpu_nvcsi_intr: tstamp:28570364185 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747982: rtcpu_nvcsi_intr: tstamp:28570365057 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x00000008
kworker/1:3-124 [001] .... 892.747982: rtcpu_nvcsi_intr: tstamp:28570365057 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747983: rtcpu_nvcsi_intr: tstamp:28570365057 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747983: rtcpu_nvcsi_intr: tstamp:28570365057 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x00000008
kworker/1:3-124 [001] .... 892.747984: rtcpu_nvcsi_intr: tstamp:28570365057 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747984: rtcpu_nvcsi_intr: tstamp:28570365057 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747984: rtcpu_nvcsi_intr: tstamp:28570365057 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747985: rtcpu_nvcsi_intr: tstamp:28570367196 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747985: rtcpu_nvcsi_intr: tstamp:28570367196 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747985: rtcpu_nvcsi_intr: tstamp:28570367196 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747986: rtcpu_nvcsi_intr: tstamp:28570367196 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747986: rtcpu_nvcsi_intr: tstamp:28570367196 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747987: rtcpu_nvcsi_intr: tstamp:28570367196 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747987: rtcpu_nvcsi_intr: tstamp:28570369067 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747987: rtcpu_nvcsi_intr: tstamp:28570369067 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747987: rtcpu_nvcsi_intr: tstamp:28570369067 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747988: rtcpu_nvcsi_intr: tstamp:28570369067 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:1 status:0x00000008
kworker/1:3-124 [001] .... 892.747988: rtcpu_nvcsi_intr: tstamp:28570369067 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
kworker/1:3-124 [001] .... 892.747988: rtcpu_nvcsi_intr: tstamp:28570369067 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:3 status:0x00000008
kworker/1:3-124 [001] .... 892.747989: rtcpu_nvcsi_intr: tstamp:28570370949 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:2 status:0x00000008
hello 1010622394,
is it complete error logs? please try to collect the tracing logs as single text file for reference.
Hi JerryChang:
attach full log. and I can get some broken images for color bar test mode
trace.log (613.4 KB)
hello 1010622394,
it looks like alignment issue, may I know what’s your commands to enable camera preview stream through gst pipeline?
besides.. are you able to fetch the camera stream with v4l2 standard IOCTL?
Hi JerryChang:
I use gst-launch to preview the video:
gst-launch-1.0 -v v4l2src device="/dev/video0" ! video/x-raw,framerate=25/1,width=1920,height=1080,format=UYVY ! xvimagesink &
the following v4l2 command is ok?
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-to=mode0.bin --stream-count=100
hello 1010622394,
let’s try to test the camera stream with v4l2 standard IOCTL.
you’ll need to assign the sensor supported formats to the pipeline.
for instance,
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
Size: Discrete 3840x2160
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
it shows < for each capture frame, and report the sensor frame-rate for every second.
for instance,
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
[1]: 'NV16' (Y/CbCr 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
[2]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.040s (25.000 fps)
and I use the follwing command no any output:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
hello 1010622394,
may I know the error logs? such as $ dmesg > klogs.txt
or.. is it the same failure as you’ve seen on post #14 ?
please give it another try by boosting the clocks.
for instance,
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate
Hi JerryChang:
full log with boost clock, if i open video2 seems more error log.
and updatethe previous description :
the broken color bar image only for video1/2/3
only green screen with video0
trace_video2.log (4.7 MB)
trace_video0.log (2.1 MB)
dmesg.log (89.3 KB)
tegra234-camera-rbpcv2-xs9922.dtsi.log (12.1 KB)
Please also help check my device tree, Thanks!
hello 1010622394,
can you debug into sender side to ensure it’s outputting MIPI data follow the MIPI Alliance Specification for CSI-2
will check again and then feedback, please keep continue, Thanks!
system
Closed
September 24, 2025, 3:23am
24
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.