debcrafters-packages team mailing list archive
-
debcrafters-packages team
-
Mailing list archive
-
Message #07275
[Bug 2122049] Re: wireplumber starts before camera is user accessible
I think we definitely should, I've just not gotten around to actually
open one yet. There is also the question of which project is actually at
fault here. After a bit of digging I have not yet figured out where this
would best get fixed. We could file it against libcamera/pipewire I
guess.
As I mentioned in report itself I think the proper fix would be
monitoring the /dev nodes for ownership changes and updating
automatically. I think the problem with the current code structure is
that wireplumber loads the pipewire-libcamera plugin, which defers all
logic to libcamera. Neither pipewire nor wireplumber are actually aware
of the /dev node access since that happens transparently in the library,
meanwhile libcamera doesn't really seem to have a mechanism to monitor
changes because how would it as a library.
--
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to wireplumber in Ubuntu.
https://bugs.launchpad.net/bugs/2122049
Title:
wireplumber starts before camera is user accessible
Status in ubuntu-x13s-settings package in Ubuntu:
Fix Released
Status in ubuntu-x1e-settings package in Ubuntu:
Fix Released
Status in wireplumber package in Ubuntu:
Triaged
Status in ubuntu-x13s-settings source package in Questing:
Fix Released
Status in ubuntu-x1e-settings source package in Questing:
Fix Released
Bug description:
On Qualcomm Snapdragon laptops we are depending on libcamera for the
built-in webcam. This is supported in pipewire via
libspa-0.2-libcamera and works in theory.
On user login there is an ordering problem where wireplumber.service
starts before udev changes ownership of /dev/media* and /dev/udmabuf
to make them user accessible, causing the camera to not be detected:
Sep 02 15:54:46 t14s wireplumber[4218]: [0:00:18.540654888] [4314] ERROR MediaDevice media_device.cpp:483 /dev/media0[]: Failed to open media device at /dev/media0: Permission denied
Sep 02 15:54:46 t14s wireplumber[4218]: [0:00:18.540686086] [4314] INFO DeviceEnumerator device_enumerator.cpp:224 Unable to populate media device /dev/media0 (Permission denied), skipping
Sep 02 15:54:46 t14s wireplumber[4218]: [0:00:18.540693013] [4314] WARN DeviceEnumerator device_enumerator_udev.cpp:174 Failed to add device for '/sys/devices/platform/soc@0/acb6000.isp/media0', skipping
Sep 02 15:54:46 t14s wireplumber[4218]: [0:00:18.542468169] [4314] ERROR DmaBufAllocator dma_buf_allocator.cpp:119 Could not open any dma-buf provider
This can be fixed with a manual restart of the user service.
A temporary solution could be something similar to network-wait-
online.service that wireplumber depends on to make sure the devices
are available before it starts.
Ultimately it might make more sense for wireplumber/pipewire to
monitor /dev ownership changes and update if necessary.
From https://www.freedesktop.org/wiki/Software/systemd/multiseat/:
If you are writing user-level software interfacing directly with
kernel drivers (like PulseAudio), consider ignoring seat information
completely, and make available to the user all devices he/she can
access. A device that a user cannot access is a device that is not
assigned to any of the seats he is currently active on. In order to
track changes when sessions come and go (and are
activated/deactivated) consider watching the devices nodes with
inotify so that you are notified when the access mode changes. This
scheme works only if your software runs under the user ID of the user
himself!
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-x13s-settings/+bug/2122049/+subscriptions
References