Error using libcamera-apps

I can’t run it. I would like to run the utilities headless, but I always get an X window for a second, then this:

libcamera-jpeg -t 0 -camera 0 -o test.jpg
Made X/EGL preview window
[0:14:59.557579350] [2959]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3572-e13ccdd5
[0:14:59.574874805] [2972]  WARN CameraSensorProperties camera_sensor_properties.cpp:163 No static properties available for 'imx519'
[0:14:59.574922398] [2972]  WARN CameraSensorProperties camera_sensor_properties.cpp:165 Please consider updating the camera sensor properties database
[0:14:59.575513042] [2972] ERROR CameraSensor camera_sensor.cpp:591 'imx519 10-001a': Camera sensor does not support test pattern modes.
[0:14:59.592187446] [2972]  WARN RPI raspberrypi.cpp:1263 Mismatch between Unicam and CamHelper for embedded data usage!
[0:14:59.592906015] [2972] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:14:59.593107995] [2972]  INFO RPI raspberrypi.cpp:1386 Registered camera /base/soc/i2c0mux/[email protected]/[email protected] to Unicam device /dev/media2 and ISP device /dev/media0
[0:14:59.593761843] [2959]  INFO Camera camera.cpp:1029 configuring streams: (0) 2328x1748-YUV420
[0:14:59.594110063] [2972]  INFO RPI raspberrypi.cpp:764 Sensor: /base/soc/i2c0mux/[email protected]/[email protected] - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to import fd 20
Aborted

This is 5.15.30-v8+ #1533 SMP PREEMPT Mon Mar 21 16:14:33 GMT 2022 aarch64 GNU/Linux

If I try with -n, I get this

libcamera-jpeg -n -t 0 -camera 0 -o test.jpg
[0:17:50.407080368] [3093]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3572-e13ccdd5
[0:17:50.427735343] [3094]  WARN CameraSensorProperties camera_sensor_properties.cpp:163 No static properties available for 'imx519'
[0:17:50.427809027] [3094]  WARN CameraSensorProperties camera_sensor_properties.cpp:165 Please consider updating the camera sensor properties database
[0:17:50.428393890] [3094] ERROR CameraSensor camera_sensor.cpp:591 'imx519 10-001a': Camera sensor does not support test pattern modes.
[0:17:50.453020940] [3094]  WARN RPI raspberrypi.cpp:1263 Mismatch between Unicam and CamHelper for embedded data usage!
[0:17:50.453696949] [3094] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:17:50.453901780] [3094]  INFO RPI raspberrypi.cpp:1386 Registered camera /base/soc/i2c0mux/[email protected]/[email protected] to Unicam device /dev/media2 and ISP device /dev/media0
[0:17:50.454572660] [3093]  INFO Camera camera.cpp:1029 configuring streams: (0) 2328x1748-YUV420
[0:17:50.454929488] [3094]  INFO RPI raspberrypi.cpp:764 Sensor: /base/soc/i2c0mux/[email protected]/[email protected] - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA


And the system hangs here

@surak
The correct usage is libcamera-jpeg -n -t 0 --camera 0 -o test.jpg
I don’t know if this error has anything to do with it.

Turns out the -t 0 means infinity and it will stay there forever. -t 1 works.

@surak

Sorry , my fault.
i forget you use -n.This will mean that you don’t use preview,lead to misunderstanding
by the way, -t follow are ms.