godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.63k stars 21.1k forks source link

"ERROR: Cannot set format, error: 16." on Linux after merge of Camera implementation (#53666), when webcam is busy #97454

Closed akien-mga closed 4 weeks ago

akien-mga commented 1 month ago

Tested versions

System information

Godot v4.4.dev (2834dd6a2) - Fedora Linux 40 (KDE Plasma) on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 threads)

Issue description

The following is printed to the terminal output when opening any project on Linux:

ERROR: Cannot set format, error: 16.

Steps to reproduce

Minimal reproduction project (MRP)

Any project.

akien-mga commented 1 month ago

CC @pkowal1982

akien-mga commented 1 month ago

So I must have been testing this while in a meeting yesterday with my webcam enabled. If my webcam is off I don't reproduce the issue.

I adjusted the steps to reproduce. We may consider that this isn't a bug, but the error message should likely be improved to make it clear that the webcam is busy, instead of a cryptic "cannot set format" error.

Additionally, I wonder whether it's correct that we attempt to initialize a camera feed on start even when there's no usage of any camera API in the project. This seems like a potential significant privacy issue here, which my freak out some users, even if we're just checking whether we can use the camera.

pkowal1982 commented 1 month ago

@akien-mga Thanks for giving it another try. I can reproduce this behavior on Ubuntu, it will be easier to analyze now.

pkowal1982 commented 4 weeks ago

Fixing the error I've noticed that CameraFeed::get_format() is not exposed in the APIs. If it was not intentional probably there should be another small PR for this.