Hi.
I’m using LI-AR0231-GMSL2-XAVIER-60H camera of Leopard Imaging Inc. with Jetson AGX Xavier.
This camera driver is availiable on Jetpack 4.4 but I want to use the camera in Jetpack 5.0
So, I modified dtsi files and some driver source files.
tegra194-camera-ar0231-a00.dtsi (16.9 KB)
I built the camera driver (called ‘ar0231.ko’) and checked ‘/dev/video0,1,2,3’ files.
‘ar0231’ module probe success in dmesg
:
[ 12.515693] ar0231 30-0010: probing v4l2 sensor. by jekim
[ 12.515872] ar0231 30-0010: tegracam sensor driver:ar0231_v2.0.6
[ 12.515878] ar0231 30-0010: tegra camera driver registration successed by jekim
[ 12.516125] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0231 30-0010 bound
[ 12.517563] ar0231 30-0010: tegra camera subdev registration successed by jekim
[ 12.517780] ar0231 30-0010: creating debugfs interface successed by jekim
[ 12.517929] ar0231 30-0010: Detected AR0231 sensor
[ 12.518174] ar0231 31-0010: probing v4l2 sensor. by jekim
[ 12.519407] ar0231 31-0010: tegracam sensor driver:ar0231_v2.0.6
[ 12.519416] ar0231 31-0010: tegra camera driver registration successed by jekim
[ 12.519658] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0231 31-0010 bound
[ 12.520617] ar0231 31-0010: tegra camera subdev registration successed by jekim
[ 12.520832] ar0231 31-0010: creating debugfs interface successed by jekim
[ 12.521022] ar0231 31-0010: Detected AR0231 sensor
[ 12.521526] ar0231 32-0010: probing v4l2 sensor. by jekim
[ 12.521862] ar0231 32-0010: tegracam sensor driver:ar0231_v2.0.6
[ 12.521868] ar0231 32-0010: tegra camera driver registration successed by jekim
[ 12.522488] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0231 32-0010 bound
[ 12.523364] ar0231 32-0010: tegra camera subdev registration successed by jekim
[ 12.523627] ar0231 32-0010: creating debugfs interface successed by jekim
[ 12.523814] ar0231 32-0010: Detected AR0231 sensor
[ 12.524979] ar0231 33-0010: probing v4l2 sensor. by jekim
[ 12.525099] debugfs: Directory 'ar0231_e' with parent '/' already present!
[ 12.525305] ar0231 33-0010: tegracam sensor driver:ar0231_v2.0.6
[ 12.525310] ar0231 33-0010: tegra camera driver registration successed by jekim
[ 12.525574] tegra-camrtc-capture-vi tegra-capture-vi: subdev ar0231 33-0010 bound
[ 12.526463] libata version 3.00 loaded.
[ 12.527708] ar0231 33-0010: tegra camera subdev registration successed by jekim
[ 12.528065] ar0231 33-0010: creating debugfs interface successed by jekim
[ 12.528271] ar0231 33-0010: Detected AR0231 sensor
sudo media-ctl -p -d /dev/video0
:
Media controller API version 5.10.65
Media device information
------------------------
driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.10.65
Device topology
- entity 1: 13e10000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
<- "ar0231 30-0010":0 [ENABLED]
pad1: Source
-> "vi-output, ar0231 30-0010":0 [ENABLED]
- entity 4: 13e10000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
<- "ar0231 31-0010":0 [ENABLED]
pad1: Source
-> "vi-output, ar0231 31-0010":0 [ENABLED]
- entity 7: 13e10000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
pad0: Sink
<- "ar0231 32-0010":0 [ENABLED]
pad1: Source
-> "vi-output, ar0231 32-0010":0 [ENABLED]
- entity 10: 13e10000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev3
pad0: Sink
<- "ar0231 33-0010":0 [ENABLED]
pad1: Source
-> "vi-output, ar0231 33-0010":0 [ENABLED]
- entity 13: ar0231 30-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev4
pad0: Source
[fmt:SGRBG12_1X12/1928x1208 field:none colorspace:srgb]
-> "13e10000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 15: vi-output, ar0231 30-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "13e10000.host1x:nvcsi@15a00000-":1 [ENABLED]
- entity 33: ar0231 31-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev5
pad0: Source
[fmt:SGRBG12_1X12/1928x1208 field:none colorspace:srgb]
-> "13e10000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 35: vi-output, ar0231 31-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
<- "13e10000.host1x:nvcsi@15a00000-":1 [ENABLED]
- entity 45: ar0231 32-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev6
pad0: Source
[fmt:SGRBG12_1X12/1928x1208 field:none colorspace:srgb]
-> "13e10000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 47: vi-output, ar0231 32-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video2
pad0: Sink
<- "13e10000.host1x:nvcsi@15a00000-":1 [ENABLED]
- entity 57: ar0231 33-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev7
pad0: Source
[fmt:SGRBG12_1X12/1928x1208 field:none colorspace:srgb]
-> "13e10000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 59: vi-output, ar0231 33-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video3
pad0: Sink
<- "13e10000.host1x:nvcsi@15a00000-":1 [ENABLED]
the topology:
I tried to verify the sensor driver but failed.
$ v4l2-compliance -d /dev/video0
v4l2-compliance SHA: not available, 64 bits
Compliance test for tegra-video device /dev/video0:
Driver Info:
Driver name : tegra-video
Card type : vi-output, ar0231 30-0010
Bus info : platform:tegra-capture-vi:0
Driver version : 5.10.65
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.65
Hardware revision: 0x00000003 (3)
Driver version : 5.10.65
Interface Info:
ID : 0x03000011
Type : V4L Video
Entity Info:
ID : 0x0000000f (15)
Name : vi-output, ar0231 30-0010
Function : V4L2 I/O
Pad 0x01000010 : 0: Sink
Link 0x02000015: from remote pad 0x1000003 of entity '13e10000.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/video0 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/video0: 45, Succeeded: 43, Failed: 2, Warnings: 0
v4l2-ctl -V --set-fmt-video width=1928,height=1208,pixelformat=BA12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=5 --stream-to=ar0231.raw -d /dev/video0
VIDIOC_S_FMT: failed: Device or resource busy
Format Video Capture:
Width/Height : 1928/1208
Pixel Format : 'BA12' (12-bit Bayer GRGR/BGBG)
Field : None
Bytes per Line : 3856
Size Image : 4658048
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
VIDIOC_REQBUFS returned -1 (Device or resource busy)
and ar0231.raw is 0 byte.
- I tried to get video from camera using
gst-launch-1.0
but I got errors
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1928 x 1208 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 48.000000; Exposure Range min 110000, max 166577000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 1928 H = 1208
seconds to Run = 0
Frame Rate = 29.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Pipeline construction is invalid, please add queues.
Additional debug info:
gstbasesink.c(1209): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Not enough buffering available for the processing deadline of 0:00:00.015000000, add enough queues to buffer 0:00:00.015000000 additional data. Shortening processing latency to 0:00:00.000000000.
Got EOS from element "pipeline0".
Execution ended after 0:00:04.010811323
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
GST_ARGUS: Cleaning up
^C