qemu system emulator fails to start if no sound card is present on host
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
A plain build from git master at 81dbcfa9e1d8bab
Trying to launch QEMU on a host with no audio card present:
# ls /dev/snd/
seq timer
It will fail to initialize alsa and abort startup:
# qemu-system-x86_64 -cdrom Fedora-
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib conf.c:
ALSA lib pcm.c:2565:
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib conf.c:
ALSA lib pcm.c:2565:
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
init fail
audio: Failed to create voice `pcspk'
qemu-system-x86_64: Initialization of device isa-pcspk failed: Initializing audio voice failed
git bisect blames this change:
commit 6a48541873f14b5
Author: Gerd Hoffmann <email address hidden>
Date: Thu Jan 24 12:20:55 2019 +0100
audio: probe audio drivers by default
Add the drivers listed in audio_possible_
using the try-* variants. That way the probable drivers are compiled by
default if possible.
Additioal tweaks:
linux: reorder to: pa alsa sdl oss.
*bsd: drop pa.
Signed-off-by: Gerd Hoffmann <email address hidden>
Message-id: <email address hidden>
This changed our probe order:
Linux)
- audio_drv_
+ audio_drv_
After some debugging I can see that 'audio_init' successfully initializes the alsa driver.
When the pcspk devices goes to AUD_open_out though, the alsa driver fails spewing the above text to stderr and thus causes QEMU to fail.
This looks very much like the ALSA driver in QEMU is broken - audio_init() should not have succeeded unless the ALSA driver knew it could later succesfully honour AUD_open_out.
Changed in qemu: | |
status: | Fix Committed → Fix Released |
Don't know if same but just noticed "no sound" unless I unplug and replug headphones. If I boot with no headphones plugged in I get no sound, but if I plug in headphones I get sound. Of course, then, if I unplug headphones I still get sound. Something about plugging/unplugging to the headphones jack wakes things up.
ThinkPad T530-2394-3J8, i5-3380M 2.9GHz, Dual boot (BIOS/MBR): Grub, Ubuntu 18.10 / Win7 Pro x64 . 8GB(15GB/s), Sammy 250GB SSD. Fast!
4.19.0-13 kern and previous. current: I take all updates.