Skip to content

Commit

Permalink
Wait for pulseaudio startup
Browse files Browse the repository at this point in the history
If PulseAudio starts slowly, QEMU may try to connect to it when it
doesn't accept incoming connections yet, and cause QEMU fail to start.
Wait for PA startup (when relevant), but only just before QEMU startup -
this allows parallel PA startup with other init tasks (network setup
etc).

Fixes QubesOS/qubes-issues#9540
  • Loading branch information
marmarek committed Nov 5, 2024
1 parent 0bbe9b8 commit 6347958
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rootfs/init
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ while read -r line; do
done < /proc/kmsg
) &

# wait for pulseaudio startup just before starting qemu
if [ -n "$audio_model" ]; then
while ! PULSE_SERVER=unix:/tmp/pa.sock pactl info >/dev/null; do
sleep 0.01
done
fi

# replace $STUBDOM_RESTORE_INCOMING_ARG with argument for incoming state - if
# applicable
dm_args=$(echo "$dm_args" | sed 's/\$STUBDOM_RESTORE_INCOMING_ARG/fd:3/')
Expand Down

0 comments on commit 6347958

Please sign in to comment.