libcamera Crash with IPU3 when trying to camera it in google meet
Hans de Goede
hdegoede at redhat.com
Tue Oct 22 10:03:28 CEST 2024
Hi,
On 7-Oct-24 7:08 PM, 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/ ?
Thank you for pointing that out and sorry for being slow to respond,
I ported this to the current code (same solution as Jacopo posted)
but unfortunately this does not seem to help.
I'll dive deeper into this when I can make some time.
Regards,
Hans
> 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 ? :-)
>
> 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.
>
More information about the libcamera-devel
mailing list