Hi,
I hope you are having a good day.
I’ve Sony IMX678 sensor board which uses MIPI/CSI2 Interface. I’m able to get images with
gst-launch-1.0 nvarguscamerasrc sensor-id=1 sensor-mode=0 aeantibanding=2 aelock=true ! nvvidconv ! xvimagesink
command. Also, can access and change the parameter as seen at command. Although, can’t get imaga data over v4l2. I can monitor and change parameters by v4l2-ctl but when I try to get video/image data, it isn’t working. --stream-mmap is blank after running the command.
I’m leaving some outputs.
Jetson Orin Nano Dev Kit
Jetpack 5.1.2
The driver has 3 modes and works well with nvarguscamerasrc
orin@orin:~$ v4l2-ctl -d /dev/video1 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG12' (12-bit Bayer RGRG/GBGB)
Size: Discrete 3856x2176
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1928x1088
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 3872x4508
Interval: Discrete 0.033s (30.000 fps)
orin@orin:~$ v4l2-ctl -d /dev/video1 --all
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx678 10-001a
Bus info : platform:tegra-capture-vi:2
Driver version : 5.10.120
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : tegra-camrtc-ca
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 5.10.120
Hardware revision: 0x00000003 (3)
Driver version : 5.10.120
Interface Info:
ID : 0x0300001b
Type : V4L Video
Entity Info:
ID : 0x00000019 (25)
Name : vi-output, imx678 10-001a
Function : V4L2 I/O
Pad 0x0100001a : 0: Sink
Link 0x0200001f: from remote pad 0x1000006 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Priority: 2
Video input : 0 (Camera 2: ok)
Format Video Capture:
Width/Height : 3856/2176
Pixel Format : 'RG12' (12-bit Bayer RGRG/GBGB)
Field : None
Bytes per Line : 7712
Size Image : 16781312
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Camera Controls
group_hold 0x009a2003 (bool) : default=0 value=0 flags=execute-on-write
hdr_enable 0x009a2004 (intmenu): min=0 max=1 default=0 value=0
0: 0 (0x0)
1: 1 (0x1)
sensor_mode 0x009a2008 (int64) : min=0 max=3 step=1 default=0 value=0 flags=slider
gain 0x009a2009 (int64) : min=0 max=72000 step=300 default=1 value=900 flags=slider
exposure 0x009a200a (int64) : min=14 max=30000 step=1 default=30000 value=29999 flags=slider
frame_rate 0x009a200b (int64) : min=30000000 max=30000000 step=1 default=30000000 value=30000000 flags=slider
exposure_short 0x009a200c (int64) : min=15 max=30000 step=1 default=30000 value=15 flags=slider
sensor_configuration 0x009a2032 (u32) : min=0 max=4294967295 step=1 default=0 [22] flags=read-only, volatile, has-payload
sensor_mode_i2c_packet 0x009a2033 (u32) : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
sensor_control_i2c_packet 0x009a2034 (u32) : min=0 max=4294967295 step=1 default=0 [1026] flags=read-only, volatile, has-payload
bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=1
0: 0 (0x0)
1: 1 (0x1)
override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=1
0: 0 (0x0)
1: 1 (0x1)
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
0: 1 (0x1)
1: 65536 (0x10000)
2: 131072 (0x20000)
write_isp_format 0x009a2068 (int) : min=1 max=1 step=1 default=1 value=1
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=3 flags=read-only
There are 2 failed attempts.
orin@orin:~$ v4l2-compliance -d /dev/video1
v4l2-compliance SHA: not available, 64 bits
Compliance test for tegra-video device /dev/video1:
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx678 10-001a
Bus info : platform:tegra-capture-vi:2
Driver version : 5.10.120
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : tegra-camrtc-ca
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 5.10.120
Hardware revision: 0x00000003 (3)
Driver version : 5.10.120
Interface Info:
ID : 0x0300001b
Type : V4L Video
Entity Info:
ID : 0x00000019 (25)
Name : vi-output, imx678 10-001a
Function : V4L2 I/O
Pad 0x0100001a : 0: Sink
Link 0x0200001f: from remote pad 0x1000006 of entity '13e40000.host1x:nvcsi@15a00000-': Data, Enabled
Required ioctls:
test MC information (see 'Media Driver Info' above): OK
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second /dev/video1 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls (Input 0):
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 1 Private Controls: 22
Format ioctls (Input 0):
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
fail: v4l2-test-formats.cpp(1280): ret && node->has_frmintervals
test VIDIOC_G/S_PARM: FAIL
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)
Codec ioctls (Input 0):
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls (Input 0):
fail: v4l2-test-buffers.cpp(715): q.create_bufs(node, 1, &fmt) != EINVAL
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)
Total for tegra-video device /dev/video1: 45, Succeeded: 43, Failed: 2, Warnings: 0
Here are the kernel outputs.
First one has taken after succesful attempt with nvarguscamerasrc
[Nov 5 18:50] imx678 10-001a: sensor_power_on: power on
[ +0,006166] bwmgr API not supported
[ +0,008682] imx678 10-001a: imx678 set mode in 0!!!
[ +0,064030] imx678 10-001a: sensor_set_gain:val:900 , gain: 3
[ +0,000285] imx678 10-001a: sensor_set_exposure_shr:coarse_time is 2024,val is 29999, shs0 is 226, factor is 1000000 !!!1
[ +0,000408] imx678 10-001a: sensor_start_streaming:
[ +0,003934] bwmgr API not supported
[ +0,145170] bwmgr API not supported
[ +0,018848] bwmgr API not supported
[ +15,712223] imx678 10-001a: sensor_stop_streaming:
[ +0,007523] bwmgr API not supported
[ +0,000779] imx678 10-001a: sensor_power_off: power off
And this one after
v4l2-ctl -d /dev/video1 --stream-mmap --stream-count=1
command. I stopped it with ctrl+c because nothing was coming.
[ +6,603167] imx678 10-001a: sensor_power_on: power on
[ +0,005699] bwmgr API not supported
[ +0,009728] imx678 10-001a: imx678 set mode in 0!!!
[ +0,062216] imx678 10-001a: sensor_set_gain:val:900 , gain: 3
[ +0,000278] imx678 10-001a: sensor_set_exposure_shr:coarse_time is 2024,val is 29999, shs0 is 226, factor is 1000000 !!!1
[ +0,000402] imx678 10-001a: sensor_start_streaming:
[ +5,429831] imx678 10-001a: sensor_stop_streaming:
[ +0,005740] bwmgr API not supported
[ +0,010415] imx678 10-001a: sensor_power_off: power off
[ +0,003673] ------------[ cut here ]------------
[ +0,000027] WARNING: CPU: 1 PID: 3704 at drivers/media/common/videobuf2/videobuf2-core.c:1956 __vb2_queue_cancel+0x1b8/0x220
[ +0,011571] Modules linked in: nvidia_modeset(OE) fuse(E) xt_conntrack(E) xt_MASQUERADE(E) nf_conntrack_netlink(E) nfnetlink(E) iptable_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) libcrc32c(E) xt_addrtype(E) iptable_filter(E) br_netfilter(E) lzo_rle(E) lzo_compress(E) zram(E) overlay(E) ramoops(E) reed_solomon(E) bnep(E) loop(E) snd_soc_tegra186_asrc(E) snd_soc_tegra186_dspk(E) aes_ce_blk(E) crypto_simd(E) snd_soc_tegra210_ope(E) cryptd(E) snd_soc_tegra210_afc(E) snd_soc_tegra186_arad(E) snd_soc_tegra210_iqc(E) snd_soc_tegra210_mvc(E) aes_ce_cipher(E) snd_soc_tegra210_adx(E) rtk_btusb(E) snd_soc_tegra210_dmic(E) ghash_ce(E) snd_soc_tegra210_amx(E) snd_soc_tegra210_i2s(E) btusb(E) snd_soc_tegra210_admaif(E) sha2_ce(E) snd_soc_tegra210_mixer(E) snd_soc_tegra210_sfc(E) sha256_arm64(E) snd_soc_tegra_pcm(E) btrtl(E) sha1_ce(E) btbcm(E) btintel(E) rtl8822ce(E) snd_soc_tegra210_adsp(E) snd_soc_spdif_tx(E) snd_soc_tegra_machine_driver(E) snd_soc_tegra_utils(E)
[ +0,000161] snd_soc_simple_card_utils(E) nvadsp(E) snd_soc_tegra210_ahub(E) fusb301(E) r8168(E) cfg80211(E) snd_hda_codec_hdmi(E) tegra210_adma(E) userspace_alert(E) snd_hda_tegra(E) snd_hda_codec(E) tegra_bpmp_thermal(E) sg8_mipi_imx678(E) snd_hda_core(E) spi_tegra114(E) nvidia(OE) binfmt_misc(E) ina3221(E) pwm_fan(E) nvgpu(E) nvmap(E) ip_tables(E) x_tables(E) [last unloaded: mtd]
[ +0,000074] CPU: 1 PID: 3704 Comm: v4l2-ctl Tainted: G W OE 5.10.120-tegra #258
[ +0,000004] Hardware name: Unknown NVIDIA Orin NX Developer Kit/NVIDIA Orin NX Developer Kit, BIOS 3.0-32616947 02/21/2023
[ +0,000007] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[ +0,000007] pc : __vb2_queue_cancel+0x1b8/0x220
[ +0,000004] lr : __vb2_queue_cancel+0x40/0x220
[ +0,000003] sp : ffff80001af7bb40
[ +0,000003] x29: ffff80001af7bb40 x28: ffff790809020ec0
[ +0,000006] x27: ffffd25285287000 x26: 0000ffffae59693c
[ +0,000006] x25: fffffffffffffe00 x24: ffff7908090214c0
[ +0,000006] x23: ffff7908c5c0f1f8 x22: ffff7908c5d160a0
[ +0,000006] x21: ffff7908c5c0f680 x20: ffff7908c5c0f728
[ +0,000006] x19: ffff7908c5c0f680 x18: 0000000000000010
[ +0,000005] x17: 0000000000000000 x16: ffffd25283efe200
[ +0,000006] x15: ffff790809021430 x14: ffffffffffffffff
[ +0,000006] x13: ffff80009af7b627 x12: ffff80001af7b62f
[ +0,000006] x11: 0000000000000005 x10: 0101010101010101
[ +0,000006] x9 : 00000000fffffffe x8 : 207265776f70203a
[ +0,000006] x7 : 66666f5f7265776f x6 : 000000098892787e
[ +0,000006] x5 : 00ffffffffffffff x4 : 001948277e380c9c
[ +0,000007] x3 : 0000000000000017 x2 : ffffd25283a20d70
[ +0,000005] x1 : ffff7908c5c0f5a8 x0 : 0000000000000004
[ +0,000006] Call trace:
[ +0,000006] __vb2_queue_cancel+0x1b8/0x220
[ +0,000006] vb2_core_queue_release+0x30/0x60
[ +0,000008] _vb2_fop_release+0x88/0xb0
[ +0,000007] tegra_channel_close+0x68/0x190
[ +0,000006] v4l2_release+0xc0/0x100
[ +0,000012] __fput+0x80/0x240
[ +0,000004] ____fput+0x24/0x30
[ +0,000012] task_work_run+0x88/0x140
[ +0,000010] do_exit+0x354/0xab0
[ +0,000005] do_group_exit+0x4c/0xb0
[ +0,000006] get_signal+0x104/0x830
[ +0,000011] do_notify_resume+0x184/0xa00
[ +0,000005] work_pending+0xc/0x738
[ +0,000004] ---[ end trace 8e36c9fdf8188824 ]---
[ +0,004801] videobuf2_common: driver bug: stop_streaming operation is leaving buf 000000007d630dd1 in active state
[ +0,010692] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000074f0beeb in active state
[ +0,010698] videobuf2_common: driver bug: stop_streaming operation is leaving buf 0000000003fe32b3 in active state
[ +0,010677] videobuf2_common: driver bug: stop_streaming operation is leaving buf 00000000f2f9c83e in active state
Outputs of these 2 commands are same.
v4l2-ctl -d /dev/video1 --set-fmt-video=width=3856,height=2176,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
v4l2-ctl -d /dev/video1 --set-fmt-video=width=3840,height=2160,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
[ +5,011754] imx678 10-001a: sensor_power_on: power on
[ +0,008066] bwmgr API not supported
[ +0,011155] imx678 10-001a: imx678 set mode in 0!!!
[ +0,059825] imx678 10-001a: sensor_set_gain:val:900 , gain: 3
[ +0,000268] imx678 10-001a: sensor_set_exposure_shr:coarse_time is 2024,val is 29999, shs0 is 226, factor is 1000000 !!!1
[ +0,000393] imx678 10-001a: sensor_start_streaming:
[ +2,665934] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ +0,009160] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ +0,010088] (NULL device *): vi_capture_control_message: NULL VI channel received
[ +0,007753] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ +0,010672] (NULL device *): vi_capture_control_message: NULL VI channel received
[ +0,007747] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ +0,010814] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ +1,559915] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 61312, flags: 0, err_data 512
[ +0,166383] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 65429, flags: 0, err_data 512
[ +0,033167] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 65414, flags: 0, err_data 512
[ +0,100152] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 65417, flags: 0, err_data 512
##### I press CTRL+C here #########
[ +7,174425] imx678 10-001a: sensor_stop_streaming:
[ +0,004707] bwmgr API not supported
[ +0,009461] imx678 10-001a: sensor_power_off: power off
.dtsi files are attached
sg-mipi-imx678-4lane.txt (10.8 KB)
tegra234-p3768-sg-mipi-cam.txt (1.2 KB)
Also gst-launch-1.0 not works. I tried various combinations.
Why is it like that ? Can you suggest any idea ?
Thanks in advance,