Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#47756 - spice-gtk3 clients on host do not play audio from guest

Attached to Project: Arch Linux
Opened by Patrick (killswitch) - Thursday, 14 January 2016, 22:26 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 16 January 2016, 16:17 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
spicy from spice-gtk3 0.30-1 package (along with virt-viewer and virt-manager clients) does not play any audio received from guest.

The same exact guest (Arch) plays audio with no problem on non-Arch hosts (Debian, Fedora) with spice. The environment var is set to QEMU_AUDIO_DRV=spice (cat /proc/xxx/environ) and already tried to enable all audio settings in /etc/libvirt/qemu.conf. The Arch host plays audio fine from other programs whether ALSA or Pulse.

The host is Arch on grsec kernel with libvirt, virt-manager, qemu/kvm installed.

I installed pulseaudio[-alsa] on host after noticing that spice-gtk3 on arch is built with "--with-audio=pulse", but there is still no audio. Tried to install about 20 extra gstreamer packages, still nothing.

Nothing in logs.

Steps to reproduce:

Setup Arch Host with or without Pulseaudio and try to play sounds from an Arch guest in a libvirt/virt-manager VM when connecting with any client (spicy, virt-viewer, etc.).

This task depends upon

Closed by  Doug Newgard (Scimmia)
Saturday, 16 January 2016, 16:17 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Firejail issue, which is unsupported
Comment by Patrick (killswitch) - Thursday, 14 January 2016, 23:31 GMT
I've ran further tests and I did manage to get audio through spice on the Arch host; this issue is convoluted.

I discovered that one or more applications is somehow corrupting the pulseaudio daemon. Audacious (was using to test sounds) running under a Firejail profile affects the running pulseaudio daemon in some negative way (but not when not under Firejail), whether it started pulseaudio itself or not. Then for some reason spicy/virt-viewer refuse to connect to pulse afterward. Spicy/virt-viewer is extra sensitive to the state of pulse compared to the other apps. The only other indication that there is weirdness comes from pavucontrol.

I could get audio again by killing all apps including the VM, running
pulseaudio --kill (two or three times)
pulseaudio --start (two or three times)

and restarting the VM alone.

I would say this is probably not a bug per se in spice-gtk3 package after all even though it's especially sensitive.

(I spent 3 days fighting with this, just happened to finally get some audio after writing bug ticket)

HOWEVER I will say it would be great if spice-gtk3 could be compiled to support ALSA without pulseaudio (why "--with-audio=pulse"?).
Comment by Patrick (killswitch) - Saturday, 16 January 2016, 00:18 GMT
The major difference between Arch and the other hosts seems to be that pulseaudio now runs as a systemd user daemon (this was news to me), i.e.:
systemctl --user restart pulseaudio.service
(so my commands above were probably not good)

I think probably none of the applications (Firejail and spice-gtk3/spicy/virt-viewer) are well tested with this setup. In particular the Arch pulseaudio.service starts pulse with --daemonize=no, while in those other distros it's non-systemd and using --daemonize=yes. With systemd, somehow Firejail'd Audacious manages to break Arch's systemd pulse daemon, which in turn prevents spice-gtk3 clients from working (but not necessarily all other apps, for whatever reason).

I've wasted enough time on pulseaudio. Would prefer to have spice-gtk3 without "--with-audio=pulse". Would "--with-audio=auto" be possible? Or does it break something?
Comment by Doug Newgard (Scimmia) - Saturday, 16 January 2016, 01:19 GMT
Sounds more like a firejail issue.

AFAIK, the audio backend has to be set at build time. The maintainer has chosen to use pulse. There are other tickets about this if you'd like to search more.
Comment by Patrick (killswitch) - Saturday, 16 January 2016, 16:06 GMT
Yes you're right, Firejail has a pulseaudio bug as I found out last night (because it wasn't only Audacious profile; others trigger it): https://github.com/netblue30/firejail/issues/69
The workaround for that is: echo "enable-shm = no" >> ~/.config/pulse/client.conf"

I'm afraid my limited arch bug tracker search abilities can't find tickets about that --with-audio flag (edit: well there's this one: https://bugs.archlinux.org/task/45852 but that's no good)

The specific setup of this system was going for minimalism, so it could do without pulse. I see other distros compiling without the flag, which according to spice-gtk3 .configure the default is --with-audio=auto (https://anonscm.debian.org/git/collab-maint/spice-gtk.git/tree/debian/rules).
Comment by Patrick (killswitch) - Saturday, 16 January 2016, 16:14 GMT
[xxxx spice-gtk-0.30]$ .configure --help
[...]
--with-audio=[gstreamer/pulse/auto/no]
Select audio backend [default=auto]
Comment by Doug Newgard (Scimmia) - Saturday, 16 January 2016, 16:17 GMT
It defaults to auto, but auto just chooses which one to use at build time. Auto then defaults to pulse.

Loading...