Skip to content

fix: survive the removal of the default PulseAudio device - #584

Merged
devopvoid merged 2 commits into
mainfrom
fix/pulseaudio-default-device-null-info
Nov 10, 2026
Merged

devopvoid merged 2 commits into
mainfrom
fix/pulseaudio-default-device-null-info

Conversation

@devopvoid

@devopvoid devopvoid commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner
  • A query for a default device that was removed meanwhile ends with no info, which the info callbacks dereferenced. It is deterministic when a DeviceChangeListener asks for the defaults: on PulseAudio's thread the query uses the name of the device just removed.
  • A server without sources or sinks names no default, which crashed building a string from NULL.
  • With no default device, getDefaultAudioCaptureDevice()/getDefaultAudioRenderDevice() now return null, as on macOS.
  • Device change listeners are now called on a daemon thread of their own (WebRTC-DeviceChanges) instead of the system's thread, one change at a time and in order. Device queries from a listener then wait for PulseAudio and see the new defaults, and the PulseAudio thread no longer stays attached and keeps the JVM from ending. Changes still queued for a removed listener are dropped.
  • DeviceBackendTests covers it against a private PulseAudio server with virtual devices, which the Linux CI lanes now install (without autospawn).

Fixes #580

A query for a default device removed meanwhile fails with no info, and a
server without devices names no default. Both crashed the JVM; the default
is now null instead.

Fixes #580
On the system's thread, a listener's device queries could not wait for
PulseAudio and answered with the defaults from before the change, and the
attached thread kept the JVM from ending. Changes are now queued for a
daemon thread; removed listeners drop the ones still queued.
@devopvoid
devopvoid merged commit 795bd30 into main Nov 10, 2026
41 of 42 checks passed
@devopvoid
devopvoid deleted the fix/pulseaudio-default-device-null-info branch November 10, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux: SIGSEGV in PulseAudioDeviceManager::getSourceInfoCallback / getSinkInfoCallback when the default device disappears (info == NULL, last < 0)

1 participant