v4l2-ctl succeed! gst-launch-1.0 fail !

dear,

i complete config ar0231 & 954 driver and dts

And succeed to get raw data through v4l2-ctl(v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1920,height=1080,pixelformat=BA12 --stream-mmap --stream-count=1 --set-ctrl bypass_mode=0 --stream-to=/tmp/stream.raw)

but fail to get data through gst-launch-1.0

(gst-launch-1.0 nvarguscamerasrc num-buffers=200 ! ‘video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12’ ! omxh264enc ! qtmux ! filesink location=test.mp4 -e)

 as follow:
root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake# clear
eam.rawtream-mmap --stream-count=1 --set-ctrl bypass_mode=0 --stream-to=/tmp/stre
Opening in BLOCKING MODE 
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
        Width/Height      : 1928/1208
        Pixel Format      : 'BA12'
        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: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
        Index    : 0
        Type     : Video Capture
        Flags    : mapped
        Field    : None
        Sequence : 0
        Length   : 4658048
        Bytesused: 4658048
        Timestamp: 2197.386198s (Monotonic, End-of-Frame)

VIDIOC_STREAMOFF: ok

root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake# 
root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake# 
root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake# 
root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake# 
n=test.mp4 -eramerate=30/1, format=NV12' ! omxh264enc ! qtmux ! filesink location
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
Framerate set to : 30 at NvxVideoEncoderSetParameterNew clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
H264: Profile = 66, Level = 40 
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:521 No cameras available
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
^C
root@cidi-desktop:/home/cidi/Desktop/tegra_multimedia_api/argus/cmake#

@JiaZW
ISP pipeline not support BA12.

@ShaneCCC

Same configuration (same BA12)I succeed to grab data on Xavier;

but fail get data in myself board (Modified hardware)

Please enable the pcl log to check.

sudo su
kill the process of argus_daemon/nvargus_daemon or nvcamera-daemon 
export enableCamPclLogs=5
/usr/sbin/argus_daemon(nvargus_daemon)      option for argus
/usr/sbin/nvcamera-daemon   option for gst-launch
 
launch camera from another console

@ShaneCCC

The effect is the same

root@cidi-desktop:/tmp# 
root@cidi-desktop:/tmp# 
root@cidi-desktop:/tmp# export enableCamPclLogs=5
root@cidi-desktop:/tmp# 
root@cidi-desktop:/tmp# 
12' ! omxh264enc ! qtmux ! filesink location=test1.mp4 -eamerate=30/1, format=NV 
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
H264: Profile = 66, Level = 40 
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:521 No cameras available

kill the process of argus_daemon/nvargus_daemon or nvcamera-daemon
export enableCamPclLogs=5
/usr/sbin/argus_daemon(nvargus_daemon) option for argus
/usr/sbin/nvcamera-daemon option for gst-launch

launch camera from another console

@ShaneCCC

what‘s your mean?

how to operate??

I didn’t see you run the nvargus_daemon by sudo console and launch the camera from another console(terminal)

@ShaneCCC

-desktop:~$ argus_camera --device=0
Executing Argus Sample Application (argus_camera)
Argus Version: 0.97.3 (multi-process)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:831 No cameras available
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, Dispatcher:784 (propagating)
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:823 Failed to create CameraProvider
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:831 No cameras available
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:823 Failed to create CameraProvider
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:831 No cameras available
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 258)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:823 Failed to create CameraProvider
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
Argus Version: 0.97.3 (multi-process)
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, initialize:831 No cameras available
Error generated. /home/cidi/Desktop/tegra_multimedia_api/argus/apps/camera/modules/Dispatcher.cpp, getInstance:807 Initalization failed
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

@ShaneCCC

can you help me check the dts?? thanks

*/

/ {
	host1x {
		vi@15c10000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					liar0231_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&liar0231_csi_out0>;
					};
				};
			};
		};

		nvcsi@15a00000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						liar0231_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&liar0231_ar0231_out0>;
						};
					};
					port@1 {
						reg = <1>;
						liar0231_csi_out0: endpoint@1 {
							remote-endpoint = <&liar0231_vi_in0>;
						};
					};
#define CAM0_RST_L	TEGRA194_MAIN_GPIO(T, 5)
#define CAM0_PWDN	TEGRA194_MAIN_GPIO(T, 6)
#define CAM1_RST_L	TEGRA194_MAIN_GPIO(T, 3)
#define CAM1_PWDN	TEGRA194_MAIN_GPIO(T, 4)

#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)

/* camera control gpio definitions */

/ {
	gpio@2200000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <CAM0_RST_L 0 CAM0_PWDN 0>;
			label = "cam0-rst", "cam0-pwdn";
		};
	};

	i2c@c240000 {
		ar0231_a@10 {
					/* Define any required hw resources needed by driver */
  1. You didn’t follow the step to enable the log from nvargus_daemon.
  2. Did you remove the camera plugin manager for your sensor? Have a check the sensor programing guide.
    https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_sensor_prog.html%23

@ShaneCCC

I didn’t remove the camera plugin manager for your sensor

  1. on Xavier, i succeed to get data through gst-launch-1.0;
    dts is ok

  2. on myself board, i fail to get data through gst-launch-1.0

    dts only modify two point
    (1)remove tca9546, Hang directly on i2c
    (2)change I2C2 (3180000) to I2C1(C240000)

What do you mean on your board? Please list the configure show be help.

@ShaneCCC

The configuration has been posted on it. Please look at it

myself board dts config

v4l2 capture succeed
gst-lanch    failed
{
	host1x {
		vi@15c10000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					liar0231_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&liar0231_csi_out0>;
					};
				};
			};
		};

		nvcsi@15a00000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						liar0231_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <4>;
							remote-endpoint = <&liar0231_ar0231_out0>;
						};
					};
					port@1 {
						reg = <1>;
						liar0231_csi_out0: endpoint@1 {
							remote-endpoint = <&liar0231_vi_in0>;
						};
					};
				};
			};
			

		};
	};

	i2c@c240000{
				ar0231_a@10 {
					compatible = "nvidia,ar0231";
					/* I2C device address */
					reg = <0x10>;

					/* V4L2 device node location */
					devnode = "video0";

					/* Physical dimensions of sensor */
					physical_w = "3.674";
					physical_h = "2.738";

					sensor_model = "ar0231";

					/* Define any required hw resources needed by driver */
					/* ie. clocks, io pins, power sources */
					avdd-reg = "vana";
					iovdd-reg = "vif";

					/* Defines number of frames to be dropped by driver internally after applying */
					/* sensor crop settings. Some sensors send corrupt frames after applying */
					/* crop co-ordinates */

Everything else software is the same

What’s “myself board”?
Have a check the context is as your dt define at /proc/device-tree/tegra-camera-platform/modules/*

@ShaneCCC

The base plate is designed according to the core plate    ---- myself board

check my dts at /proc/device-tree/tegra-camera-platform/modules/ is correct , as follow

isp_bw_margin_pct        min_bits_per_pixel  vi_bw_margin_pct
isp_peak_byte_per_pixel  modules             vi_peak_byte_per_pixel
max_lane_speed           name
root@cidi-desktop:/proc/device-tree/tegra-camera-platform# cd modules/
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules# ls
module0  name
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules# cat name 
modulesroot@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules# cd name 
bash: cd: name: Not a directory
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules# ls
module0  name
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules# cd module0/
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules/module0# ls
badge  drivernode0  drivernode1  name  orientation  position
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules/module0# cat badge 
ar0231_bottom_A6V26
root@cidi-desktop:/proc/device-tree/tegra-camera-platform/modules/module0#

Still need the log from nvargus_daemon.
open another console
sudo su
ps aux | grep -i nvargus_daemon
kill the process of nvargus_daemon
ps aux| grep -i nvargus_daemon
export enableCamPclLogs=5
/usr/sbin/nvargus_daemon
You should be able see messages out while you launch camera from another console.

@ShaneCCC

nvargus_daemon hasn’t started at all ; how to kill???

-desktop:/usr/sbin$ ps aux | grep -i argus_camera
      8798  0.0  0.0   7416   620 ttyTCU0  S+   14:08   0:00 grep --color=auto -i argus_camera
-desktop:/usr/sbin$ kill 8798
-bash: kill: (8798) - No such process
i-desktop:/usr/sbin$ ps aux | grep -i argus_camera
      8800  0.0  0.0   7416   720 ttyTCU0  S+   14:08   0:00 grep --color=auto -i argus_camera
-desktop:/usr/sbin$ export enableCamPclLogs=5
-desktop:/usr/sbin$ nvargus-daemon 
(Argus) Error OverFlow: Server already operational.  NOT restarting (in libs/rpc_socket_server/RpcSocketServer.cpp, function create(), line 69)