Closed leigh-johnson closed 1 year ago
I'm pushing this into v0.6.2 - I need to figure out a better way to scan for the default value here.
I'm still seeing the default IMX219 camera, even when only my USB brio is plugged in:
So, I'm seeing two separate issues here:
"Raspberry Pi imx219"
label is being applied to a device with name /base/scb/pcie@7d500000/pci@0,0/usb@0,0-1.3:1.0-046d:085e
Our hotplug check should also update the label field: https://github.com/bitsy-ai/printnanny-rs/blob/cc8e3e5df8f88bf2718ab8488898682853248dff/settings/src/cam.rs#L474
Jan 27 18:56:17 printnanny gstd[2868]: [0:31:56.092870617] [2904] INFO Camera camera.cpp:1026 configuring streams: (0) 640x480-YUYV
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.790196042 2868 0x7f9804fc60 WARN default gstlibcamera-utils.cpp:441:gst_libcamera_clamp_and_set_frameduration: FrameDurationLimits not found in camera controls.
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.791020449 2868 0x55a44c0400 WARN v4l2 gstv4l2object.c:4571:gst_v4l2_object_probe_caps:<v4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.791554893 2868 0x7f9804fc60 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<capsfilter0:sink> caps video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, colorimetry=(string)2:4:5:1, framerate=(fraction)16/1 not accepted
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.792154264 2868 0x7f9804fc60 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<capsfilter0:sink> caps video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, colorimetry=(string)2:4:5:1, framerate=(fraction)16/1 not accepted
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.803963986 2868 0x7f98065e40 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<h264_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.808415579 2868 0x55a44c0760 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<rtp_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.812435375 2868 0x7f98065d20 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<tflite_inference_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.821498838 2868 0x55a44c0400 WARN v4l2 gstv4l2object.c:4571:gst_v4l2_object_probe_caps:<v4l2h264enc1:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
Jan 27 18:56:17 printnanny gstd[2868]: 0:00:23.828863338 2868 0x7f9804f520 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<bounding_boxes_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.334454208 2868 0x7f98072d20 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<df_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.590538374 2868 0x7f9826eb60 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<hls_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.837833189 2868 0x55a44c0400 WARN v4l2 gstv4l2object.c:4571:gst_v4l2_object_probe_caps:<v4l2jpegenc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.839342411 2868 0x7f9826f000 FIXME default gstutils.c:4025:gst_pad_create_stream_id_internal:<snapshot_src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Jan 27 18:56:18 printnanny gstd[2868]: [0:31:57.219657801] [2903] INFO V4L2 v4l2_videodevice.cpp:1820 /dev/video0[35:cap]: Zero sequence expected for first frame (got 2)
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.916403263 2868 0x7f9804fc60 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<capsfilter0:sink> caps video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, colorimetry=(string)2:4:5:1, framerate=(fraction)16/1 not accepted
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.916586856 2868 0x7f9804fc60 WARN libcamerasrc gstlibcamerasrc.cpp:312:processRequest:<libcamerasrc0> error: Internal data stream error.
Jan 27 18:56:18 printnanny gstd[2868]: 0:00:24.916637022 2868 0x7f9804fc60 WARN libcamerasrc gstlibcamerasrc.cpp:312:processRequest:<libcamerasrc0> error: streaming stopped, reason not-negotiated (-4)
Jan 27 18:56:19 printnanny gstd[2868]: 0:00:24.938952485 2868 0x7f9804f520 WARN basetransform gstbasetransform.c:1371:gst_base_transform_setcaps:<tensordecoder0> transform could not transform other/tensors, format=(string)static, num_tensors=(int)4, framerate=(fraction)0/1, dimensions=(string)"4:40:1:1\,40:1:1:1\,40:1:1:1\,1:1:1:1", types=(string)"float32\,float32\,float32\,float32" in anything we support
The caps available on my Logitech Brio are:
rintnanny:~$ gst-device-monitor-1.0
Probing devices...
[0:33:37.548981871] [2985] INFO Camera camera_manager.cpp:299 libcamera v0.0.3+dirty (2023-01-26T07:24:56+00:00)
Device found:
name : /base/scb/pcie@7d500000/pci@0,0/usb@0,0-1.3:1.0-046d:085e
class : Source/Video
caps : image/jpeg, width=160, height=120
image/jpeg, width=176, height=144
image/jpeg, width=320, height=180
image/jpeg, width=320, height=240
image/jpeg, width=352, height=288
image/jpeg, width=424, height=240
image/jpeg, width=480, height=270
image/jpeg, width=640, height=360
image/jpeg, width=640, height=480
image/jpeg, width=800, height=448
image/jpeg, width=848, height=480
image/jpeg, width=800, height=600
image/jpeg, width=960, height=540
image/jpeg, width=1024, height=576
image/jpeg, width=1280, height=720
image/jpeg, width=1600, height=896
image/jpeg, width=1920, height=1080
video/x-raw, format=YUY2, width=160, height=120
video/x-raw, format=YUY2, width=176, height=144
video/x-raw, format=YUY2, width=320, height=180
video/x-raw, format=YUY2, width=320, height=240
video/x-raw, format=YUY2, width=352, height=288
video/x-raw, format=YUY2, width=424, height=240
video/x-raw, format=YUY2, width=340, height=340
video/x-raw, format=YUY2, width=480, height=270
video/x-raw, format=YUY2, width=440, height=440
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=448
video/x-raw, format=YUY2, width=848, height=480
video/x-raw, format=YUY2, width=800, height=600
video/x-raw, format=YUY2, width=960, height=540
video/x-raw, format=YUY2, width=1024, height=576
video/x-raw, format=YUY2, width=1280, height=720
video/x-raw, format=YUY2, width=1600, height=896
video/x-raw, format=YUY2, width=1920, height=1080
gst-launch-1.0 libcamerasrc camera-name="/base/scb/pcie\@7d500000/pci\@0\,0/usb\@0\,0-1.3:1.0-046d:085e" ! ...
I'm pulling https://github.com/bitsy-ai/meta-bitsy/pull/393 into v0.6.1 - this just increases the verbosity of Gstreamer caps negotiation and src/sink pad probing, so I'll be able to see more info in a crash report.
I have more cameras I can test with as well. That camera is a Logitech c290. I have a Logitech c920 I could test, and I also have a SJCAM that has a webcam mode that works with at least Win11 with no additional drivers
I have more cameras I can test with as well. That camera is a Logitech c290. I have a Logitech c920 I could test, and I also have a SJCAM that has a webcam mode that works with at least Win11 with no additional drivers
That'd be great! I increased logging verbosity, so all you have to do is submit a crash report if your c920 or SJCAM aren't working on v0.6.2.
Compatibility comes down to Gstreamer element capability negotiation ("caps negotiation"), rather than drivers. Here's an example of a failure I'm seeing on my Brio at the moment:
Jan 28 17:52:08 printnanny gstd[384]: 0:00:38.427564514 384 0x7f8824c400 WARN GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2jpegenc0:sink> caps: video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)16/1, format=(string)YUY2, colorimetry=(string)bt709 were not compatible with: video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)16/1, format=(string)YUY2, colorimetry=(string)bt709, interlace-mode=(string)progressive
Jan 28 17:52:08 printnanny gstd[384]: 0:00:38.427706940 384 0x7f8824c400 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<v4l2jpegenc0:sink> caps video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)16/1, format=(string)YUY2, colorimetry=(string)bt709 not accepted
:eyes: Looking into why the upstream buffer isn't getting interlace-mode=(string)progressive
applied now
@derekslenk When you get a chance, can you run the following command on a Raspberry Pi with your USB camera connected? Please paste the output back here.
$ gst-device-monitor-1.0 Source/Video
This will output the capabilities of your camera (resolution, pixel format, colorimetry, etc). Thank you!
:+1: Verified this is fixed in the v0.6.2 nightly
Describe the bug
When only a USB camera is connected, the IMX219 camera sensor (CSI ribbon cable) still appears in the drop-down menu of PrintNanny's camera settings menu.
When only a USB camera is present, the USB camera should be the default.
Issue.txt