Failed to initialize linux tool Capture process failed with code 1

Hello @FIRAS,

Maybe this thread can help you: Using raspberry pi camera - #2 by louis

Let me know if it fixes your issue.

Best,

Louis

Actually I have the same problem too

Error: “failed to run impulse capture process failed with code 1”

How to solve this problem would anyone like to share ??

Hello i am having the same problem. my error message is:

[SER] Using microphone hw:1,0
[GST] checking for /etc/os-release
Failed to initialize linux tool Capture process failed with code 1

I am using camera Arducam 12MP IMX708, Raspberry Pi 5 with Bookworm.

the camera works perfectly fine in the command line with rpicam

For RPI5, make sure you install: sudo apt install -y gstreamer1.0-libcamera

Then look for your device with : gst-device-monitor-1.0

Device found:

	name  : /base/axi/pcie@1000120000/rp1/usb@200000-2:1.0-03f0:654a
	class : Source/Video
	caps  : image/jpeg, width=160, height=120
	        image/jpeg, width=320, height=240
	        image/jpeg, width=640, height=360
	        image/jpeg, width=640, height=480
	        image/jpeg, width=800, height=600
	        image/jpeg, width=1024, height=768
	        image/jpeg, width=1280, height=720
	        image/jpeg, width=1920, height=1080
	        image/jpeg, width=2560, height=1440
	        image/jpeg, width=2592, height=1944
	        video/x-raw, format=YUY2, width=160, height=120
	        video/x-raw, format=YUY2, width=320, height=240
	        video/x-raw, format=YUY2, width=640, height=360
	        video/x-raw, format=YUY2, width=640, height=480
	        video/x-raw, format=YUY2, width=800, height=600
	        video/x-raw, format=YUY2, width=1024, height=768
	        video/x-raw, format=YUY2, width=1280, height=720
	        video/x-raw, format=YUY2, width=1920, height=1080
	        video/x-raw, format=YUY2, width=2560, height=1440
	        video/x-raw, format=YUY2, width=2592, height=1944
	gst-launch-1.0 libcamerasrc camera-name="/base/axi/pcie\@1000120000/rp1/usb\@200000-2:1.0-03f0:654a" ! ...

Grab the camera-name section and start edge-impulse-linux with:

edge-impulse-linux --gst-launch-args "libcamerasrc camera-name="/base/axi/pcie\@1000120000/rp1/usb\@200000-2:1.0-03f0:654a" ! video/x-raw,width=640,height=480,format=YUY2 ! videoconvert ! jpegenc"

I was having the same problem starting Edge Impulse on Arduino Uno Q until I plugged in two cameras to my USB-C hub, then I was prompted on which camera to use and it started up properly.

1 Like

Hey @CapperLabs first of all welcome to the Edge Impulse community!

how did you run Edge Impulse? Did you use the command

edge-impulse-linux --gst-launch-args "libcamerasrc camera-name="/base/axi/pcie\@1000120000/rp1/usb\@200000-2:1.0-03f0:654a" ! video/x-raw,width=640,height=480,format=YUY2 ! videoconvert ! jpegenc"

or similar?

That didn’t work for me. When I ran
gst-device-monitor-1.0 The name of the device was “Streaming Camera: Streaming Cam”
and if I tried to use that name in the edge-impulse-linux command it didn’t like the colon and the spaces in the name and gave me an error “could not find device Streaming”
However, when I plugged in two cameras, then when I ran edge-impulse-linux with no args, it gave me a choice of the two cameras \dev\video0 and \dev\video3, and then connected to edge impulse correctly.

1 Like

Thanks for sharing @CapperLabs

Could you please share more details about your cameras? Did you try with 1 or the other? What do you get when you try gst-device-monitor-1.0 with each one separated? and together?

Please do share all the logs here!

I will do some experiments with different configurations and capture the screens for you this week. I’m using the Arduino Uno Q and a ABIWAZY 9-n-1 USB-C hub. I have a few different cameras I can try. I have never used Edge Impulse before this project, so I’m still learning.

2 Likes

Tonight’s session log…

With no camera and the Q just plugged into the PC USB-C port this command works:
arduino@Q:~$ edge-impulse-linux --disable-microphone --disable-camera

If I plug in the first camera (no name webcam - Device USB\VID_0C45&PID_636B&MI_00\8&315a9f63&0&0000)

arduino@Q:~$ edge-impulse-linux
Edge Impulse Linux client v1.20.1

[SER] Using microphone hw:0,0
[GST] checking for /etc/os-release
Failed to initialize linux tool Capture process failed with code 1

command: gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! videoconvert ! jpegenc ! multifilesink location=resized%05d.jpg post-messages=true sync=false
Re-run this command with --verbose to enable debug logs
arduino@Q:~$

arduino@Q:~$ gst-device-monitor-1.0
Probing devices…
Device found:
name : Streaming Camera: Streaming Cam
class : Video/Source
…cut some lines here
udev-probed = true
device.bus_path = platform-xhci-hcd.2.auto-usb-0:1.3.4:1.0
sysfs.path = /sys/devices/platform/soc@0/4ef8800.usb/4e00000.usb/xhci-hcd.2.auto/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.0/video4linux/video0
device.bus = usb
device.subsystem = video4linux
device.vendor.id = 0c45
device.vendor.name = SONix\x20Technology\x20Co.\x2c\x20Ltd.
device.product.id = 636b
device.product.name = Streaming Camera: Streaming Cam
device.serial = SONix_Technology_Co.__Ltd._Streaming_Camera_SN0001
device.capabilities = :capture:
device.api = v4l2
device.path = /dev/video0
v4l2.device.driver = uvcvideo
v4l2.device.card = Streaming Camera: Streaming Cam
v4l2.device.bus_info = usb-xhci-hcd.2.auto-1.3.4
v4l2.device.version = 397312 (0x00061000)
v4l2.device.capabilities = 2225078273 (0x84a00001)
v4l2.device.device_caps = 69206017 (0x04200001)
gst-launch-1.0 v4l2src ! …
arduino@Q:~$ edge-impulse-linux --gst-launch-args “libcamerasrc camera-name=“Streaming Camera: Streaming Cam””
Edge Impulse Linux client v1.20.1

[SER] Using microphone hw:0,0
[GST] checking for /etc/os-release
Failed to initialize linux tool Capture process failed with code 1

command: gst-launch-1.0 libcamerasrc camera-name=Streaming ! multifilesink location=resized%05d.jpg post-messages=true sync=false
Re-run this command with --verbose to enable debug logs
arduino@Q:~$

If I plug in both cameras - the first time it gave me a choice, this time it just started video0.

arduino@Q:~$ edge-impulse-linux
Edge Impulse Linux client v1.20.1

[SER] Using microphone hw:0,0
[GST] checking for /etc/os-release
[SER] Connected to camera Streaming Camera: Streaming Cam (/dev/video0)
[SER] Connected to camera Streaming Camera: Streaming Cam (/dev/video0)
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device “Q” is now connected to project “CapperLabs-Sensor-Fusion-Challenge”. To connect to another project, run edge-impulse-linux --clean.
[WS ] Go to Login - Edge Impulse to build your machine learning model!

The second camera is a Logitech C920

arduino@Q:~$ gst-device-monitor-1.0
Probing devices…
Device found:
name : HD Pro Webcam C920
class : Video/Source
…cut some lines here
udev-probed = true
device.bus_path = platform-xhci-hcd.2.auto-usb-0:1.3.2:1.0
sysfs.path = /sys/devices/platform/soc@0/4ef8800.usb/4e00000.usb/xhci-hcd.2.auto/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/video4linux/video3
device.bus = usb
device.subsystem = video4linux
device.vendor.id = 046d
device.vendor.name = 046d
device.product.id = 082d
device.product.name = HD Pro Webcam C920
device.serial = 046d_HD_Pro_Webcam_C920_B58C4E9F
device.capabilities = :capture:
device.api = v4l2
device.path = /dev/video3
v4l2.device.driver = uvcvideo
v4l2.device.card = HD Pro Webcam C920
v4l2.device.bus_info = usb-xhci-hcd.2.auto-1.3.2
v4l2.device.version = 397312 (0x00061000)
v4l2.device.capabilities = 2225078273 (0x84a00001)
v4l2.device.device_caps = 69206017 (0x04200001)
gst-launch-1.0 v4l2src device=/dev/video3 ! …

If I just use the Logitech camera, it works the first time

arduino@Q:~$ edge-impulse-linux
Edge Impulse Linux client v1.20.1

? Select a microphone USB-Audio - HD Pro Webcam C920
[SER] Using microphone hw:0,0
[GST] checking for /etc/os-release
[SER] Connected to camera HD Pro Webcam C920 (/dev/video0)
[SER] Connected to camera HD Pro Webcam C920 (/dev/video0)
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device “Q” is now connected to project “CapperLabs-Sensor-Fusion-Challenge”. To connect to another project, run edge-impulse-linux --clean.
[WS ] Go to Login - Edge Impulse to build your machine learning model!

I noticed that if there is no hub or webcam attached, it doesn’t see the Q microphone, but if a camera is plugged in then it gives me a choice

? Select a microphone (Use arrow keys)
❯ USB-Audio - HD Pro Webcam C920
qcm2290 - Arduino-Imola-HPH-LOUT