libcamera Crash with IPU3 when trying to camera it in google meet

Jacopo Mondi jacopo.mondi at ideasonboard.com
Tue Oct 8 09:19:31 CEST 2024


Hi Hans, Laurent

On Mon, Oct 07, 2024 at 08:08:22PM GMT, Laurent Pinchart wrote:
> Hi Hans,
>
> On Sat, Oct 05, 2024 at 01:36:29PM +0200, Hans de Goede wrote:
> > Hi All,
> >
> > Now that I things have settled down round exposing IPU6 support in
> > Fedora 41 through libcamera -> pipewire -> firefox-pipewire-camera-support,
> > I thought I would see how things would go wrt IPU3 camera support.
> >
> > So I took out my Microsoft Surface Go (version 1, so no number) and
> > gave things a test.
> >
> > First thing I noticed was that "wpctl status" only shows the front
> > cam as vide source and not the back cam. This is a wireplumber issue
> > and I gave this pending fix a try:
> > https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/674
> > and I'm happy to report that fixes the back camera not being visible.
> >
> > With that fix both cameras work in the GUM test page in Firefox,
> > but trying to use the cameras in google-meet fails, with pipewire
> > crashing indicating a libcamera issue (with libcamera-0.3.2)
> >
> > Here are some logs from pipewire.service:
> >
> > Oct 05 12:51:40 fedora pipewire[3573]: [0:42:07.140833126] [3573]  INFO Camera camera.cpp:1197 configuring streams: (0) 640x480-NV12
> > Oct 05 12:51:41 fedora pipewire[3573]: /usr/include/c++/14/bits/stl_algo.h:3625: constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&) [with _Tp = float]: Assertion '!(__hi < __lo)' failed.
> > Oct 05 12:51:42 fedora systemd-coredump[4363]: Process 3573 (pipewire) of user 1000 dumped core.
> >
> > ...
> >
> >                                                #4  0x00007f815e6ddcb6 _ZN9libcamera12_GLOBAL__N_118calculateBDSHeightEPNS_10ImgUDevice4PipeERKNS_4SizeES6_jf (libcamera.so.0.3 + 0xbacb6)
> >                                                #5  0x00007f815e6ddf8a _ZN9libcamera12_GLOBAL__N_112calculateBDSEPNS_10ImgUDevice4PipeERKNS_4SizeES6_f (libcamera.so.0.3 + 0xbaf8a)
> >                                                #6  0x00007f815e6de537 _ZN9libcamera10ImgUDevice19calculatePipeConfigEPNS0_4PipeE (libcamera.so.0.3 + 0xbb537)
> >                                                #7  0x00007f815e6e2343 _ZN9libcamera23IPU3CameraConfiguration8validateEv (libcamera.so.0.3 + 0xbf343)
> >                                                #8  0x00007f815e7d51ad _ZL24impl_node_port_set_paramPv13spa_directionjjjPK7spa_pod (libspa-libcamera.so + 0x121ad)
> >                                                #9  0x00007f816e1849ba pw_impl_port_set_param (libpipewire-0.3.so.0 + 0x549ba)
> >
> > So it seems that an assert in calculateBDSHeightEPNS gets triggered.
> >
> > I hope someone has an idea what might be going on here and
> > I'm happy to try and reproduce with a build with some extra
> > debugging prints added to that function.
>
> Could you try this patch https://patchwork.libcamera.org/patch/11348/ ?
>
> Jacopo, you mentioned 3 years and a half ago that you'd like to collect
> that patch. Maybe it's time to get back to it ? :-)

Oh that's a long time ago! Kudos to your memory

Why we ended up not collecting it ?

The code has also been updated so now we have

	static constexpr unsigned int kIFMaxCropWidth = 40;
	static constexpr unsigned int kIFMaxCropHeight = 540;

It seems very unlikely that we didn't fix it while reworking the code.

Maybe Hans could try to

-	static constexpr unsigned int kIFMaxCropHeight = 540;
+	static constexpr unsigned int kIFMaxCropHeight = 40;

As the patch you pointed out does ? It's really been a long time since
I dealt with the ImgU configuration procedure to be able to tell if
this is the culprit or not :(

>
> We also need to properly handle sizes that are too small for the ImgU
> and make sure they won't lead to assertions.
>
> > I'm attaching the full log.
>
> --
> Regards,
>
> Laurent Pinchart


More information about the libcamera-devel mailing list