[Pkg-libvirt-maintainers] Bug#649442: libvirt-bin: please document how to have sound with/without VNC

Luca Capello luca at pca.it
Sun Nov 20 23:01:36 UTC 2011

Package: libvirt-bin
Version: 0.9.7-2
Severity: normal
Tags: patch
Usertags: pca-virtualization

Hi there!

I have an up-to-date sid guest and I wanted to add sound to use the
Empathy IM there [1][2] via `ssh -X` and I thought this would have been
rather simple, which is actually not ;-)

[1] I do not want to install 130 MB of new packages on my host to simply
    use an IM client.
[2] unfortunately there are other non-libvirt problems, see #619636, but
    this is another story.

First of all, I am aware that libvirt does not fully support sounds
through VNC [3][4], so I disabled the VNC output commenting out the
graphics XML tag and adding the sound XML tag.  Below the results.

[3] <https://bugzilla.redhat.com/show_bug.cgi?id=508317>
[4] <https://bugzilla.redhat.com/show_bug.cgi?id=595880>

1) default configuration
   => no sound, but with ac97 the domain is not started while with
      es1370 it does
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4184:(_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:4184:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
[similar output repeated]

2) /etc/libvirt/qemu.conf:user = "libvirt-qemu"
   => same as point 1 above

3) /etc/libvirt/qemu.conf:user = "luca"
   => sound with both ac97 and es1370

This means that I guess a user with login capabilities (is this the user
who accesses the VM?) must own the QEmu process to have sound.  If this
is the case, can it be documented in the README.Debian?

If I re-enable the VNC output, the only way to get sound (even through
SSH), is setting 'vnc_allow_host_audio = 1' in /etc/libvirt/qemu.conf,
together with 'user = "luca"' in the same file, otherwise you get the
same error as point 1 above.  It seems that 'export QEMU_AUDIO_DRV=alsa'
in /etc/default/libvirt-bin has no effect, is this the correct behavior?
I have found #533585, but I am not sure it is still relevant.

[5] <http://bugs.debian.org/533585>

Considering the two results above, here a simple patch:

--8<---------------cut here---------------start------------->8---
--- /usr/share/doc/libvirt-bin/README.Debian	2011-11-02 12:45:25.000000000 +0100
+++ /home/luca/README.Debian	2011-11-20 23:57:19.551619850 +0100
@@ -76,4 +76,21 @@
- -- Guido Günther <agx at sigxcpu.org>  Mon, 06 Feb 2011 17:28:35 +0200
+Sound support
+The easiest way to have sound in the guest OS is to restrict the QEmu
+processes run by the system instance to a single user, which must have
+login capabilities.  The variable to be changed is called "user" in
+Moreover, until both upstream libvirt and gtk-vnc will support sound
+through VNC, if you want sound with the VNC output you also have to
+set "vnc_allow_host_audio = 1" in the same /etc/libvirt/qemu.conf
+file.  Please see the following bug reports:
+  <http://bugs.debian.org/TO-BE-FILLED>
+  <https://bugzilla.redhat.com/show_bug.cgi?id=508317>
+  <https://bugzilla.redhat.com/show_bug.cgi?id=595880>
+ -- Luca Capello <luca at pca.it>, Sun, 20 Nov 2011 23:57:19 +0100
--8<---------------cut here---------------end--------------->8---

Thx, bye,
Gismo / Luca

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-rc7-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libvirt-bin depends on:
ii  adduser             3.113         
ii  gettext-base    
ii  libavahi-client3    0.6.30-5      
ii  libavahi-common3    0.6.30-5      
ii  libblkid1           2.19.1-5      
ii  libc6               2.13-21       
ii  libcap-ng0          0.6.6-1       
ii  libdevmapper1.02.1  2:1.02.67-1   
ii  libgcrypt11         1.5.0-3       
ii  libgnutls26         2.12.14-3     
ii  libnl1              1.1-7         
ii  libnuma1            2.0.5-1       
ii  libparted0debian1   2.3-8         
ii  libpcap0.8          1.1.1-10      
ii  libpciaccess0       0.12.1-2      
ii  libreadline6        6.2-7         
ii  libsasl2-2          2.1.25.dfsg1-2
ii  libudev0            175-2         
ii  libvirt0            0.9.7-2       
ii  libxenstore3.0      4.1.1-3       
ii  libxml2             2.7.8.dfsg-5  
ii  libyajl1            1.0.12-2      
ii  logrotate           3.7.8-6       

Versions of packages libvirt-bin recommends:
ii  bridge-utils    1.5-2        
ii  dmidecode       2.11-4       
ii  dnsmasq-base    2.59-2       
ii  ebtables    
ii  gawk            <none>       
ii  iproute         20110629-1   
ii  iptables        1.4.12-1     
ii  libxml2-utils   <none>       
ii  netcat-openbsd  1.89-4       
ii  parted          <none>       
ii  qemu            0.15.1+dfsg-1
ii  qemu-kvm        0.15.1+dfsg-1

Versions of packages libvirt-bin suggests:
pn  policykit-1  0.102-1
pn  radvd        <none> 

-- Configuration Files:
/etc/libvirt/qemu.conf changed:
user = "luca"
vnc_allow_host_audio = 1

/etc/libvirt/qemu/networks/default.xml changed:
  <bridge name="virbr0" />
  <ip address="" netmask="">
      <range start="" end="" />
      <host mac='52:54:00:85:fa:a0' name='gismo-sid.pca.it' ip='' />

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20111121/25465b9c/attachment.pgp>

More information about the Pkg-libvirt-maintainers mailing list