Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1692047 - alsa audio initialization fails causing QEMU to fail to startup
Summary: alsa audio initialization fails causing QEMU to fail to startup
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
 
Reported: 2019-03-23 17:57 UTC by Richard W.M. Jones
Modified: 2020-11-24 18:54 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 18:54:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2019-03-23 17:57:17 UTC
Description of problem:

$ echo '{ "execute": "qmp_capabilities" }' '{ "execute": "query-qmp-schema" }' '{ "execute": "quit" }' |
  qemu-system-x86_64 -display none -machine "accel=kvm:tcg" -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 90, "minor": 1, "major": 3}, "package": "qemu-4.0.0-0.2.rc0.fc31"}, "capabilities": ["oob"]}}
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default
sdl: SDL_OpenAudio failed
sdl: Reason: ALSA: Couldn't open audio device: No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default
sdl: SDL_OpenAudio failed
sdl: Reason: ALSA: Couldn't open audio device: No such file or directory
audio: Failed to create voice `pcspk'
qemu-system-x86_64: Initialization of device isa-pcspk failed: Initializing audio voice failed

and then qemu exits with code 1.

There are several problems here:

(1) All the ALSA error messages and exiting with non-zero code.
Seems like audio is screwed up somehow.

(2) More importantly the normal output from the QMP command
(ie. the "return" statements) is missing.

Version-Release number of selected component (if applicable):

qemu-4.0.0-0.2.rc0.fc31.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See above.

Comment 1 Richard W.M. Jones 2019-03-23 17:59:52 UTC
I see that libvirt sets an environment variable (QEMU_AUDIO_DRV=none) which
indeed suppresses these errors.  Is that the current advice when running qemu
to query QMP?

Comment 2 Richard W.M. Jones 2019-03-23 18:12:00 UTC
I think this is a bug in qemu, but I have suggested a workaround for libguestfs:
https://www.redhat.com/archives/libguestfs/2019-March/msg00128.html

Comment 3 Daniel Berrangé 2019-03-25 10:04:00 UTC
Historically QEMU upstream defaulted to

    --audio-drv-list=oss

This is awful so Fedora has for a long time built QEMU with

    --audio-drv-list=pa,sdl,alsa,oss

Upstream recently tried to change its default to

    --audio-drv-list=pa,alsa,sdl,oss

but it turns out this was bad because both the alsa and sdl audio drivers in QEMU have completely broken probing logic. This causes them to claim they can support audio even when no audio hardware exists on the host. This results in problems like the huge pile of errors shown above which often casues QEMU to fail to start:

  https://bugs.launchpad.net/qemu/+bug/1816052

Thus upstream finally decided on

    --audio-drv-list=pa,oss

None of this explains why you would see a regression in libguestfs though as Fedora has been enabling the broken audio drivers for ages.

I wonder if we should drop  sdl & alsa from Fedora builds though. PulseAudio is good enough for desktop virt under the normal user session. For server virt running as root, spice audio tunnelling is better bet.

There could some people relying on alsa or sdl, but it is problematic as shown above.

Comment 4 Gerd Hoffmann 2019-03-25 14:33:27 UTC
> I wonder if we should drop  sdl & alsa from Fedora builds though. PulseAudio
> is good enough for desktop virt under the normal user session. For server
> virt running as root, spice audio tunnelling is better bet.

> There could some people relying on alsa or sdl, but it is problematic as
> shown above.

All four audio drivers (pa, alsa, sdl, oss) are built as module on modular builds,
so there also is the option to move sdl + alsa to sub-rpms (and not install them
by default) instead of disabling them completely.

Comment 5 Cole Robinson 2019-03-28 22:26:02 UTC
(In reply to Gerd Hoffmann from comment #4)
> 
> All four audio drivers (pa, alsa, sdl, oss) are built as module on modular
> builds,
> so there also is the option to move sdl + alsa to sub-rpms (and not install
> them
> by default) instead of disabling them completely.

fedora qemu packaging has that, qemu-audio-X. qemu-system-X-core doesn't require them, but qemu-system-X does, for back compat.

But like dan says it's not clear what's causing this to pop up now

Comment 6 Ben Cotton 2019-08-13 16:51:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 7 Ben Cotton 2019-08-13 19:29:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 8 Ben Cotton 2020-11-03 15:12:09 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2020-11-24 18:54:25 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.