Skip to content

fix: avoid crash on mute with vlc pipewire audio output - #328

Merged
vzhd1701 merged 1 commit into
vzhd1701:masterfrom
slurpeestraw:fix/pipewire-aout-crash
Oct 12, 2026
Merged

vzhd1701 merged 1 commit into
vzhd1701:masterfrom
slurpeestraw:fix/pipewire-aout-crash

Conversation

@slurpeestraw

Copy link
Copy Markdown
Contributor

On Fedora (and anywhere else vlc-plugin-pipewire is installed), VLC processes can die with SIGSEGV when a video is muted or its volume is changed. Every player is muted as soon as it is created (PlayerBase.init_player), so this can hit on startup.

Cause

The crash is in the PipeWire audio output plugin:

#0 MuteSet ()                  libaout_pipewire_plugin.so
#1 aout_OutputUnlock ()        libvlccore.so.9
#2 aout_MuteSet ()             libvlccore.so.9
#3 libvlc_audio_set_mute ()    libvlc.so.5

The plugin's Open() allocates its private struct with malloc and never sets sys->stream. Only Start() (on the first audio frame) and Stop() write it. MuteSet() and VolumeSet() check if (sys->stream != NULL) and dereference it. So a mute or volume change before the first audio plays follows whatever the allocator left there.

Waiting for "playing" before muting doesn't help. The output starts on the decoder thread, after that event, and a video without audio never starts it at all.

Seen with vlc-3.0.23-1.fc43, vlc-plugin-pipewire-3-6.fc43, pipewire-1.4.11.

Fix

On Linux, ask VLC for --aout=pulse,any. On PipeWire desktops pulse is served by pipewire-pulse; on systems without a pulse server, ,any falls back to whatever VLC would have picked. It goes before the options typed by hand in settings, so a user's own --aout still wins. The AppImage's existing --aout=pulse is unchanged.

Reproduction

from gridplayer.vlc_player.libvlc import vlc

mp = vlc.Instance(["--quiet", "--no-video"]).media_player_new()
mp.audio_set_mute(True)

On Fedora 43 this segfaults on every run (5/5). With --aout=pulse,any it exits cleanly (5/5), and the PipeWire plugin is never loaded.

Testing

  • New tests/test_vlc_audio_output.py: pulse is asked for on Linux, a hand-typed --aout still wins, and other platforms are left alone.
  • pytest on Python 3.14: everything passes except 5 tests that also fail on master in my environment (text eliding in the overlay tests, and test_ytdl_js_runtimes picking up a container's /run/host). Not run on 3.10 locally.
  • ruff check, ruff format --check, rumdl check and pre-commit pass.

@vzhd1701
vzhd1701 merged commit b371603 into vzhd1701:master Oct 12, 2026
@vzhd1701

Copy link
Copy Markdown
Owner

Thank you very much!

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.

2 participants