pipewire/spa/plugins
Barnabás Pőcze c3fec9769c spa: libcamera: manager: fix id allocation
There is an issue in the id allocation mechanism which can result
in the different devices having the same id. Specifically, consider
the scenario where there are only two cameras, which have just been
added. In this case `impl::devices` looks like this:

   (0, camA) | (1, camB) | (?, nullptr) | ...

Now assume that `camA` is removed, after which the array appears
as follows:

  (1, camB) | (1, nullptr) | (?, nullptr) | ...

Then assume that a new camera appears. When `get_free_id()` runs,
when `i == 1`, it will observe that `devices[i].camera == nullptr`,
so it selects `1` as the id. Leading to the following:

  (1, camB) | (1, camC) | (?, nullptr) | ...

This is of course incorrect. The set of ids must be unique. When
wireplumber is faced with this situation it destroys the device
object for `camB` when `camC` is emitted.

Fix this by simply not moving elements in the `devices` array,
leaving everything where it is. In which case the array looks
like this:

  (nullptr) | (camB) | (nullptr) | ... // after `camA` removal
  (camC) | (camB) | (nullptr) | ... // after `camC` appearance

Note that `device::id` is removed, and the id is now derived from
the position in `impl::devices`.

(cherry picked from commit 2c2808fab1)
2025-09-26 09:58:10 +02:00
..
aec spa: aec: webrtc: Expose echo canceller mobile_mode 2025-07-09 13:29:23 -04:00
alsa alsa: report extra latency for FireWire drivers 2025-09-10 10:28:42 +02:00
audioconvert audioconvert: add log topic for resampler 2025-09-10 10:28:57 +02:00
audiomixer audiomixer: set change mask correctly 2025-09-10 10:20:34 +02:00
audiotestsrc spa: audiotestsrc: Validate loop and system before using them 2024-10-23 08:25:30 -04:00
avb json: add helper function to parse channel positions 2024-09-18 09:54:34 +02:00
bluez5 bluez5: aac: fix for A2DP v1.4 using rfa bits for more channels 2025-07-10 17:17:22 +03:00
control control: fix event compare function 2025-09-17 10:29:15 +02:00
ffmpeg spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
filter-graph filter-graph: fix index off by one in dsp_delay_c 2025-07-22 15:54:48 +02:00
jack spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
libcamera spa: libcamera: manager: fix id allocation 2025-09-26 09:58:10 +02:00
support Revert "loop: don't call the hooks around blocking wait" 2025-06-26 12:45:29 +02:00
test spa: make the wave, pattern and ditherType Int 2025-06-13 11:53:42 +02:00
v4l2 treewide: map SPA_PROP_exposure to V4L2_CID_EXPOSURE_ABSOLUTE 2025-09-10 10:28:08 +02:00
videoconvert adapter: use the right default when filtering default 2025-06-03 10:54:07 +02:00
videotestsrc Port videotestsrc to LoopUtils 2024-07-01 15:28:14 +00:00
volume spa: fix volume plugin compilation 2024-06-18 15:44:26 +02:00
vulkan spa: vulkan: simplify memcpy() call 2024-12-14 23:28:43 +01:00
meson.build filter-chain: move the filter-graph to plugins 2024-11-13 11:12:06 +01:00