pipewire/spa/plugins/alsa
Mike Lothian 062f19b214 spa: alsa: acp-device: stop 100% CPU spin when a poll fd hangs up
handle_acp_poll() copies the poll revents into ACP and clears them, but
never actually looks at them. When one of the polled fds reports
POLLERR/POLLHUP - which happens when the ALSA card goes away, e.g. the
audio function of a USB dock being unplugged - the source is never
removed, and because that condition is level-triggered the loop just
keeps redispatching the handler.

The result is wireplumber pegged at 100% CPU, spinning on the card's
control fd:

    read(24, ..., 72) = -1 ENODEV (No such device)

with fd 24 pointing at a now-deleted /dev/snd/controlC<n>. It stays like
that until the card comes back or the service is restarted.

Accumulate the returned mask and, if anything reports SPA_IO_ERR or
SPA_IO_HUP, drop the poll sources so we stop hammering a dead descriptor.
The udev monitor still drives the real device removal and setup_sources()
re-arms the poll if the card reappears - the same teardown alsa-pcm.c
already does for its own control sources.

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
2026-07-07 14:33:06 +02:00
..
acp acp: avoid segfault when removing a card 2026-06-15 13:03:53 +02:00
mixer acp: partially revert f76327e076 2026-04-28 12:11:53 +02:00
90-pipewire-alsa.rules alsa-card-profiles: Add config for a couple of JBL gaming headsets 2026-01-22 15:35:05 +00:00
acp-tool.c spa: acp: make spa-acp-tool debug output easier to read 2025-03-09 16:15:56 +02:00
alsa-acp-device.c spa: alsa: acp-device: stop 100% CPU spin when a poll fd hangs up 2026-07-07 14:33:06 +02:00
alsa-compress-offload-device.c spa: alsa: avoid potential uninitialized variable use 2024-09-18 19:54:13 +00:00
alsa-compress-offload-sink.c alsa-compress-offload-sink: Improve write_queued_output_buffers comments 2025-07-18 10:53:59 +02:00
alsa-pcm-device.c spa: alsa: avoid potential uninitialized variable use 2024-09-18 19:54:13 +00:00
alsa-pcm-sink.c spa: acp: get and emit UCM information for SplitPCM devices 2024-12-21 16:03:19 +02:00
alsa-pcm-source.c spa: acp: get and emit UCM information for SplitPCM devices 2024-12-21 16:03:19 +02:00
alsa-pcm.c alsa: avoid rounding down period_size 2026-06-15 12:55:19 +02:00
alsa-pcm.h spa: alsa: actually set the channel map when use-chmap=true 2026-01-05 15:37:05 +00:00
alsa-seq-bridge.c alsa-seq: add : between client and port name 2026-04-16 10:19:05 +02:00
alsa-seq.c midi: don't convert Midi in nodes 2026-04-07 10:07:00 +02:00
alsa-seq.h midi: don't convert Midi in nodes 2026-04-07 10:07:00 +02:00
alsa-udev.c alsa-udev: support alsa.ignore-dB 2026-03-09 16:26:54 +01:00
alsa.c meson: fix build with missing libudev-devel 2024-02-06 11:49:40 +01:00
alsa.h spa: remove unnecessary indirection for some spa_log_topics 2023-10-06 13:08:24 +00:00
compress-offload-api-util.c alsa-compress-offload: Add device object and udev based autodetection 2023-09-02 08:28:22 +00:00
compress-offload-api-util.h alsa-compress-offload: Add device object and udev based autodetection 2023-09-02 08:28:22 +00:00
compress-offload-api.c security: add missing O_CLOEXEC/SOCK_CLOEXEC flags 2026-05-08 13:52:53 +02:00
compress-offload-api.h alsa-compress-offload: Add device object and udev based autodetection 2023-09-02 08:28:22 +00:00
meson.build meson: fix build with missing libudev-devel 2024-02-06 11:49:40 +01:00
test-hw-params.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
test-timer.c fix compilation some more 2024-06-18 15:41:12 +02:00