Bug 848927 - RFE: support VNC audio
RFE: support VNC audio
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Cole Robinson
Depends On:
  Show dependency treegraph
Reported: 2012-08-16 16:33 EDT by Joseph Scalia
Modified: 2016-09-20 00:43 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joseph Scalia 2012-08-16 16:33:01 EDT
Description of problem:

Creating a virtual domain with virsh or virt-manager will bring up a Windows 7 VM with the appropriate sound driver, but it will not play through the host speaker or configured output.
ex: #sudo virsh create /etc/libvirt/qemu/Windows_7.xml

Creating a Windows 7 VM with qemu-kvm as a non-root user allow sound to work.  It appears to me there is a permissions issue between qemu user and pulse/alsa.
ex: #/usr/libexec/qemu-kvm /var/lib/libvirt/images/Windows_7.img -device AC97,id=sound0,bus=pci.0,addr=0x4 

Version-Release number of selected component (if applicable):
RHEL 6.3 x86_64 and Windows 7 32-bit.  Using Intel AC'97 Audio Driver.

How reproducible:
 #sudo virsh create /etc/libvirt/qemu/Windows_7.xml or virt-manager
Sound never works.

#/usr/libexec/qemu-kvm /var/lib/libvirt/images/Windows_7.img -device AC97,id=sound0,bus=pci.0,addr=0x4 
Always works.

Steps to Reproduce:
1. Create Windows 7 32-bit VM on RHEL 6.3
2. Try creating domain with virsh or virt-manager (sound will not work)
3. Try starting with qemu-kvm as a non-root user and device defined (sound will work)
Actual results:
Driver loads on Windows.  Volume can be seen on Windows.  Nothing comes through host audio.

Expected results:
Sound will work when domain is created from libvirt.
Comment 2 Jiri Denemark 2012-08-17 07:23:04 EDT
Could you attach Windows_7.xml file? Sound should just work if the domain is properly configured to use spice (of course, it only works iff spice client is connected to the domain). If it uses VNC, it should also work if the VNC client supports audio over VNC extension. If it doesn't, the only way is to set vnc_allow_host_audio = 1 in /etc/libvirt/qemu.conf. I would recomend using spice.
Comment 3 Joseph Scalia 2012-08-17 09:38:34 EDT
Requested xml is below.  I have verified sound also works in spice.  This bug was clearly mistitled by me.  It's not that sound doesn't work, it's that sound doesn't work with the default virt-manager vnc (which is also the default viewer).  

If that is acceptable behavior, perhaps there should be a UI warning on the audio device when trying to configure without spice channels and with a vnc_allow_host_audio = 0 value. Or perhaps spice should just be the default viewer.

***I should also note, I noticed behavior that is contrary to what is being said about vnc.  When I execute the following:

1. I set vnc_allow_host_audio = 1 in /etc/libvirt/qemu.conf
2. Restart libvirtd
3. Start up a Win 7 VM through libvirt with vnc as the viewer
4. Use Tigervnc, which I know to support audio

Audio still does not get passed to host.***

<domain type='kvm'>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <boot dev='hd'/>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/Windows_7.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/jscalia/Share/ISO/en_windows_7_ultimate_x86_dvd_x15-65921.iso'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    <interface type='network'>
      <mac address='52:54:00:1c:f8:74'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      <model type='vga' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
Comment 4 Peter Krempa 2012-08-27 09:36:15 EDT
Enabling vnc_allow_host_audio requires prerequisites on the host to actually work (qemu using the correct group, pulseaudio not running ...) so this approach is not really usable.

I'm moving this bug on virt-manager to see if it's feasible to add a warning about audio not working with the default VNC video console as Joseph suggested. I recommend using spice video, where audio works out-of-the-box.
Comment 5 Cole Robinson 2013-06-12 21:30:29 EDT
Actually nowadays gtk-vnc actually supports audio streaming, so changing this to track that as an RFE

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