[libcamera-devel] using libcamerasrc gst element

Nicolas Dufresne nicolas at ndufresne.ca
Wed Sep 8 20:08:00 CEST 2021


Le jeudi 02 septembre 2021 à 10:56 +0200, Martin Kepplinger a écrit :
> hi all,
> 
> I'm starting to use libcamera with the hi846 camera on imx8mq. (The
> following all works on my laptop btw, where there's only 1 camera.)
> 
> I test using the "libaperture" gstreamer app with the libcamera gst src
> element (https://gitlab.gnome.org/jwestman/libaperture/-/issues/14 ).
> But it doesn't work on imx8mq where I have 2 cameras (and 1 is working
> with libcamera currently, but that shouldn't matter I think).

Hi Martin,

libcamerasrc is not compatible with GstBaseCameraSrc (see base class
documentation for more details). In fact, libcamera is a subperset of a
CameraBin camera. I think it would be nice to consider implement a wrapper that
would allow using libcamerasrc inside camerabin, exposing 3 streams (or perhaps
2 + 1 emulated stream if that isn't possible , aka two profiles).

regards,
Nicolas

> 
> Here's the end of the logs. earlier logs seem to be the same as the
> successful case with qcam, see below.
> 
> 
> [1:57:12.541751844] [3187] DEBUG Camera camera_manager.cpp:150 Found
> registered pipeline handler 'PipelineHandlerUVC'
> [1:57:12.541817127] [3187] DEBUG Camera camera_manager.cpp:150 Found
> registered pipeline handler 'PipelineHandlerVimc'
> [1:57:12.542646484] [3180] DEBUG Camera camera.cpp:878 streams
> configuration: (0) 1632x1224-SGBRG16
> [1:57:12.543146546] [3187] DEBUG V4L2 v4l2_videodevice.cpp:1423
> /dev/video0[32:cap]: Releasing buffers
> [1:57:12.543212069] [3187] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[32:cap]: 0 buffers requested.
> 
> 
> here's what qcam produces (I hack the bayer format into qcam, just to
> get *any* image) when it streams an image successfully:
> 
> [2:03:11.800512537] [3279] DEBUG Camera camera_manager.cpp:150 Found
> registered pipeline handler 'PipelineHandlerUVC'
> [2:03:11.800640463] [3279] DEBUG Camera camera_manager.cpp:150 Found
> registered pipeline handler 'PipelineHandlerVimc'
> [2:03:12.096795636] [3278] DEBUG Camera camera.cpp:878 streams
> configuration: (0) 1632x1224-SGBRG16
> [2:03:12.097182533] [3278]  INFO Camera camera.cpp:937 configuring
> streams: (0) 1632x1224-SGBRG16
> [2:03:12.098115095] [3279] DEBUG SimplePipeline simple.cpp:616 Link
> 'hi846 2-0020':0 -> 'imx8mq-mipi-csi2 30a70000.csi':0 configured with
> format 1632x1224-SGBRG10_1X10
> [2:03:12.098211580] [3279] DEBUG SimplePipeline simple.cpp:616 Link
> 'imx8mq-mipi-csi2 30a70000.csi':1 -> 'csi':0 configured with format
> 1632x1224-SGBRG10_1X10
> [2:03:12.098271222] [3279] DEBUG SimplePipeline simple.cpp:616 Link
> 'csi':1 -> 'csi capture':0 configured with format 1632x1224-
> SGBRG10_1X10
> [2:03:12.109817780] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[13:cap]: 3 buffers requested.
> [2:03:12.110857147] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[13:cap]: 0 buffers requested.
> [2:03:12.111889913] [3278] DEBUG Request request.cpp:94 Created request
> - cookie: 0
> [2:03:12.112285091] [3278] DEBUG Request request.cpp:94 Created request
> - cookie: 0
> [2:03:12.112355054] [3278] DEBUG Request request.cpp:94 Created request
> - cookie: 0
> [2:03:12.112446618] [3278] DEBUG Camera camera.cpp:1076 Starting
> capture
> [2:03:12.113403541] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[13:cap]: 3 buffers requested.
> [2:03:12.113544068] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1408
> /dev/video0[13:cap]: Prepared to import 3 buffers
> [2:03:12.114991693] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 0
> [2:03:12.115248384] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:12.216242157] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:12.241727581] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 0
> [2:03:12.242277446] [3279] DEBUG Request request.cpp:291
> Request(0:C:0/1:0)
> [2:03:12.273703617] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:12.274077313] [3279] DEBUG Request request.cpp:291
> Request(1:C:0/1:0)
> [2:03:12.305667411] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:12.306071109] [3279] DEBUG Request request.cpp:291
> Request(2:C:0/1:0)
> [2:03:14.767398987] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:14.832931768] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:14.833328626] [3279] DEBUG Request request.cpp:291
> Request(3:C:0/1:0)
> [2:03:15.924518404] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:16.017336210] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:16.017692026] [3279] DEBUG Request request.cpp:291
> Request(4:C:0/1:0)
> [2:03:17.082198366] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:17.169375079] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:17.169925423] [3279] DEBUG Request request.cpp:291
> Request(5:C:0/1:0)
> [2:03:18.347292029] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:18.417134683] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:18.417491339] [3279] DEBUG Request request.cpp:291
> Request(6:C:0/1:0)
> [2:03:19.521012270] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:19.600675925] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:19.601063663] [3279] DEBUG Request request.cpp:291
> Request(7:C:0/1:0)
> [2:03:20.695349219] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:20.784672468] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:20.785027684] [3279] DEBUG Request request.cpp:291
> Request(8:C:0/1:0)
> [2:03:21.865663946] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:21.936577049] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:21.936818980] [3279] DEBUG Request request.cpp:291
> Request(9:C:0/1:0)
> [2:03:23.018004987] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:23.088777084] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:23.089130980] [3279] DEBUG Request request.cpp:291
> Request(10:C:0/1:0)
> [2:03:24.189934507] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:24.272595657] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 1
> [2:03:24.272837828] [3279] DEBUG Request request.cpp:291
> Request(11:C:0/1:0)
> [2:03:25.342153862] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 2
> [2:03:25.424582681] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1575
> /dev/video0[13:cap]: Dequeuing buffer 2
> [2:03:25.424942217] [3279] DEBUG Request request.cpp:291
> Request(12:C:0/1:0)
> [2:03:26.513174580] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1507
> /dev/video0[13:cap]: Queueing buffer 1
> [2:03:26.513554997] [3278] DEBUG Camera camera.cpp:1118 Stopping
> capture
> [2:03:26.545617796] [3279] DEBUG Request request.cpp:291
> Request(13:X:0/1:0)
> [2:03:26.545826366] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1423
> /dev/video0[13:cap]: Releasing buffers
> [2:03:26.545994853] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[13:cap]: 0 buffers requested.
> [2:03:26.554559398] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1423
> /dev/video0[13:cap]: Releasing buffers
> [2:03:26.554816569] [3279] DEBUG V4L2 v4l2_videodevice.cpp:1160
> /dev/video0[13:cap]: 0 buffers requested.
> 
> 
> what does libcamerasrc do wrong? Why isn't it configuring the stream?
> What config options do I have for the gstreamer element to play with?
> 
> thanks,
> 
>                                   martin
> 




More information about the libcamera-devel mailing list