fix(quickemu): detect audio backends via sockets, not pidof#1839
Merged
flexiondotorg merged 1 commit intomasterfrom Jan 25, 2026
Merged
fix(quickemu): detect audio backends via sockets, not pidof#1839flexiondotorg merged 1 commit intomasterfrom
flexiondotorg merged 1 commit intomasterfrom
Conversation
- Replace process checks (pidof pipewire / pidof pulseaudio) with socket existence checks to determine functional audio services. - PipeWire detection checks $PIPEWIRE_REMOTE or $XDG_RUNTIME_DIR/pipewire-0. - PulseAudio detection checks $PULSE_SERVER or $XDG_RUNTIME_DIR/pulse/native. - Change default audio driver from pa to alsa as a safer fallback on headless hosts. - Set detection priority: PipeWire (if QEMU >= 8.1) → PulseAudio → ALSA. - Reason: a listening socket indicates a working service; pidof can be misleading on headless servers and caused QEMU "Failed to initialize PW context" errors. Fixes #1838 Signed-off-by: Martin Wimpress <martin@wimpress.org>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 4/5
- This PR looks safe to merge overall; the main concern is a single medium‑severity check around PulseAudio configuration handling.
- In
quickemu, the-Scheck can reject validPULSE_SERVERvalues (e.g.,unix:/pathortcp:host:port), which may cause an unnecessary ALSA fallback for users relying on custom PulseAudio servers. - Pay close attention to
quickemu- ensurePULSE_SERVERstring values are honored even when they are not filesystem sockets.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="quickemu">
<violation number="1" location="quickemu:1278">
P2: `PULSE_SERVER` can be a server string (e.g., `unix:/path` or `tcp:host:port`), so the `-S` check will fail for valid PulseAudio configurations and force an ALSA fallback. Consider honoring `PULSE_SERVER` when set and only socket-checking the `unix:` variant.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| elif ! pidof pulseaudio >/dev/null 2>&1; then | ||
| AUDIO_DRIVER="alsa" | ||
| AUDIO_DRIVER="pipewire" | ||
| elif [ -S "${pa_socket}" ]; then |
Contributor
There was a problem hiding this comment.
P2: PULSE_SERVER can be a server string (e.g., unix:/path or tcp:host:port), so the -S check will fail for valid PulseAudio configurations and force an ALSA fallback. Consider honoring PULSE_SERVER when set and only socket-checking the unix: variant.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At quickemu, line 1278:
<comment>`PULSE_SERVER` can be a server string (e.g., `unix:/path` or `tcp:host:port`), so the `-S` check will fail for valid PulseAudio configurations and force an ALSA fallback. Consider honoring `PULSE_SERVER` when set and only socket-checking the `unix:` variant.</comment>
<file context>
@@ -1266,15 +1266,17 @@ function check_cocoa_gl_es_support() {
- elif ! pidof pulseaudio >/dev/null 2>&1; then
- AUDIO_DRIVER="alsa"
+ AUDIO_DRIVER="pipewire"
+ elif [ -S "${pa_socket}" ]; then
+ AUDIO_DRIVER="pa"
fi
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1838
Type of change
Checklist: