Skip to content

Commit

Permalink
fix: Use ALSA on systems without a PulseAudio daemon (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
szorfein authored Oct 19, 2024
1 parent 20c1fe0 commit 70603de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,18 @@ function configure_storage() {
}

function configure_display() {
# Determine which audio driver use between Pulseaudio or ALSA
local AUDIO_DRIVER="pa"
if ! command -v pacmd >/dev/null 2>&1 ; then
AUDIO_DRIVER="alsa"
fi

# Setup the appropriate audio device based on the display output
# https://www.kraxel.org/blog/2020/01/qemu-sound-audiodev/
case ${display} in
cocoa) AUDIO_DEV="coreaudio,id=audio0";;
none|spice|spice-app) AUDIO_DEV="spice,id=audio0";;
*) AUDIO_DEV="pa,id=audio0";;
*) AUDIO_DEV="${AUDIO_DRIVER},id=audio0";;
esac

# Determine a sane resolution for Linux guests.
Expand Down

0 comments on commit 70603de

Please sign in to comment.