This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 508317

Summary: RFE: Allow sounds devices to be used with svirt - tunnel sound over VNC
Product: [Fedora] Fedora Reporter: Alexey Torkhov <atorkhov>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 14CC: acathrow, amcnabb, amlau, ayers, belegdol, berrange, bfay, bill-bugzilla.redhat.com, bloch, brads, chemobejk, clalance, crobinso, eblake, fedora, gawain.lynch, gczarcinski, gilboad, grant_williamson, hafflys, itamar, jemcevoy, jlcarroll, jon.fairbairn, m.gruys, michael.hagmann, mishu, mrlhwliberty, pal666, panormitis, paul, redhat, robatino, sanabria.d, sjensen, somlo, vedran, veillard, virt-maint, walicki
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-24 16:49:24 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 477955, 595880    
Bug Blocks: 514891    

Description Alexey Torkhov 2009-06-26 10:42:29 EDT
Description of problem:
Guest has sound device added to it with virt-manager.

It appears in config file:

host# virsh dumpxml Rawhide | grep sound
    <sound model='es1370'/>


But qemu command doesn't have -soundhw param:

host# ps -ef |grep qemu
root     24066     1 15 18:31 ?        00:00:14 /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name Rawhide -uuid b058d6bb-7a00-39c5-dc26-6fd321bc494f -monitor pty -pidfile /var/run/libvirt/qemu//Rawhide.pid -boot c -drive file=/home/alex/qemu/boot.iso,if=ide,media=cdrom,index=2 -drive file=/home/alex/qemu/rawhide.img,if=virtio,index=0,boot=on -net nic,macaddr=54:52:00:41:60:d0,vlan=0,model=virtio -net tap,fd=18,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:1


Neither sound device appear in guest:

guest# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB Controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Qumranet, Inc. Virtio network device
00:04.0 Mass storage controller: Qumranet, Inc. Virtio block device
00:05.0 RAM memory: Qumranet, Inc. Virtio memory balloon


Version-Release number of selected component (if applicable):
qemu-0.10.5-3.fc11.x86_64
libvirt-0.6.2-12.fc11.x86_64
virt-manager-0.7.0-5.fc11.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Create VM with sound device in it.
2. Start.

Actual results:
No sound device in guest.

Expected results:
Sound device in guest appears.

Additional info:
Guest is Fedora Rawhide.
Comment 1 Michael Gruys 2009-07-02 05:14:00 EDT
Confirmed here too.
Also the case in other guests like Ubuntu, Windows.
I tried to understand the python script which generate the command line for qemu-kvm, but I never saw code which produce the -soundhw switch... strange.
Comment 2 Daniel Berrange 2009-07-02 05:36:03 EDT
If you have SELinux enabled, then it is expected that there is no sound device. We have disabled sound because it caused security problems, and in any case did you correctly integrate with VNC. ie sound would play on the machine running QEMU, not the machine running the VNC client. We are aiming to fix this properly in F12

http://fedoraproject.org/wiki/Features/VirtVNCResourceTunnel

If you really do need sound working, then edit /etc/libvirt/qemu.conf and set security_driver="none" and restart libvirtd. This turns off the per-VM isolation.
Comment 3 Michael Gruys 2009-07-02 05:47:29 EDT
was indeed the case.
--thx f. sharing
Comment 4 Mark McLoughlin 2009-07-03 11:00:10 EDT
Making this depend on the qemu side
Comment 5 Mark McLoughlin 2009-07-31 05:38:35 EDT
The VirtVNCResourceTunnel feature has been punted to Fedora 13. Moving to F13VirtTarget
Comment 6 Mark McLoughlin 2009-08-07 08:40:48 EDT
*** Bug 507226 has been marked as a duplicate of this bug. ***
Comment 7 Mark McLoughlin 2009-08-11 12:50:02 EDT
*** Bug 513771 has been marked as a duplicate of this bug. ***
Comment 8 Mark McLoughlin 2009-09-04 09:09:07 EDT
*** Bug 520613 has been marked as a duplicate of this bug. ***
Comment 9 Mark McLoughlin 2009-09-21 09:38:42 EDT
*** Bug 524103 has been marked as a duplicate of this bug. ***
Comment 10 Mark McLoughlin 2009-10-09 06:55:57 EDT
*** Bug 527639 has been marked as a duplicate of this bug. ***
Comment 11 Serge Pavlovsky 2009-10-09 11:28:16 EDT
(In reply to comment #2)
> If you really do need sound working, then edit /etc/libvirt/qemu.conf and set
> security_driver="none" and restart libvirtd. This turns off the per-VM
> isolation.  

unfortunately, its not enough
now i get in log:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name f12alpha -uuid d6e88f00-ee73-fe6c-77d4-16ab4133cf81 -monitor pty -pidfile /var/run/libvirt/qemu//f12alpha.pid -boot c -drive file=,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/f12alpha.img,if=virtio,index=0,boot=on -net nic,macaddr=54:52:00:53:ca:3d,vlan=0,model=virtio -net tap,fd=19,vlan=0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:1 -soundhw es1370 
char device redirected to /dev/pts/6
char device redirected to /dev/pts/7
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.dac2'
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Connection refused
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.adc'
...

is there any workaround for this ?
Comment 12 Russell Harrison 2009-10-16 13:00:59 EDT
(In reply to comment #11)
> pulseaudio: pa_simple_new for capture failed
> pulseaudio: Reason: Connection refused
> audio: Failed to create voice `es1370.adc'
> ...
> 
> is there any workaround for this ?  

Serge,
I modified my PulseAudio Preferences to "Enabled network access to local sound devices" without authentication as is described in this workaround for MPD.

http://mpd.wikia.com/wiki/PulseAudio#An_alternate_solution_for_fixing_access_rights

I don't know if this is a good idea from a security / stability standpoint but it did work for me.  I'll need to differ to others on the advisability of using this work around.
Comment 13 Bug Zapper 2009-11-16 05:29:30 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 14 Cole Robinson 2009-11-16 13:56:46 EST
*** Bug 534062 has been marked as a duplicate of this bug. ***
Comment 15 Cole Robinson 2009-11-16 13:57:42 EST
*** Bug 536692 has been marked as a duplicate of this bug. ***
Comment 16 Andrew McNabb 2009-11-19 13:54:21 EST
My bug has been marked as a duplicate of this bug, but I'm not using SELinux.  Additionally, I'm using SDL instead of VNC.  I really don't think that all of these problems should be lumped into one report, but if that's what you want, that's what I'll do.

I'm getting the same error message as comment #11:

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin XAUTHORITY=/aml/home/amcnabb/.Xautho
rity DISPLAY=:0.0 /usr/bin/qemu-kvm -S -M pc-0.11 -m 768 -smp 1 -name testvm -uu
id 356ef111-d264-ba73-be0c-bdbb1616577d -monitor unix:/var/lib/libvirt/qemu/test
vm.monitor,server,nowait -boot c -drive file=/var/lib/libvirt/images/testvm.img,
if=virtio,index=0,boot=on,format=raw -net nic,macaddr=22:22:22:22:22:22,vlan=0,n
ame=nic.0 -net tap,fd=18,vlan=0,name=tap.0 -serial pty -parallel none -usb -vga 
cirrus -soundhw es1370 
char device redirected to /dev/pts/1
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.dac2'
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Connection refused
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.adc'
Comment 17 James 2009-11-20 18:16:33 EST
sound seemed to work if I ran qemu-kvm from the command line, but didn't work if I ran it using the virtual machine manager, if that information helps.
Comment 18 Cole Robinson 2010-01-06 10:07:50 EST
*** Bug 544936 has been marked as a duplicate of this bug. ***
Comment 19 Arthur Pemberton 2010-05-18 11:59:52 EDT
*** Bug 592671 has been marked as a duplicate of this bug. ***
Comment 20 Cole Robinson 2010-05-27 17:58:50 EDT
*** Bug 569579 has been marked as a duplicate of this bug. ***
Comment 21 Cole Robinson 2010-07-12 13:12:55 EDT
I've posted workaround steps to get audio working on the fedora wiki, as well as info on how we will eventually solve this out of the box:

https://fedoraproject.org/wiki/How_to_debug_Virtualization_problems#Audio_output
Comment 22 Jón Fairbairn 2010-07-12 13:39:03 EDT
I've used nc to get round this problem without switching off selinux.
There's a description of how at 

http://www.chaos.org.uk/~jf/Virtual-machine-notes/Paranoid-web-browsing.xhtml#NoSound

(a page mainly intended to remind myself how to do it)
Comment 23 Gilboa Davara 2010-08-17 09:54:58 EDT
I wonder if this shouldn't be filed against qemu/vnc instead of libvirt...
Comment 24 Andre Robatino 2010-09-29 08:44:48 EDT
Can this bug have its Version updated to 14 (assuming it's still broken there), and the Blocks: changed to F14VirtTarget?
Comment 25 Bug Zapper 2010-11-04 06:56:48 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 WONTFIX if it remains open with a Fedora 
'version' of '12'.

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 prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 26 Gilboa Davara 2010-11-04 07:19:00 EDT
Still open in F13.
Comment 27 Julian Sikorski 2010-11-04 19:09:11 EDT
There is no sound in F-14 either.
Comment 28 Stefan Becker 2010-11-04 23:54:48 EDT
Exactly, it is still not fixed for F14.. Only after the upgrade I learned that the new SPICE feature is not available for libvirt/virt-manager use cases, because those haven't been updated to add SPICE support to the libvirt XML format or the UI :-(
Comment 29 Fedora Admin XMLRPC Client 2011-09-22 13:58:45 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 30 Fedora Admin XMLRPC Client 2011-09-22 14:02:31 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 31 Fedora Admin XMLRPC Client 2011-11-30 14:58:36 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 32 Fedora Admin XMLRPC Client 2011-11-30 14:59:36 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 33 Fedora Admin XMLRPC Client 2011-11-30 15:04:47 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 34 Fedora Admin XMLRPC Client 2011-11-30 15:05:08 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 35 Eric Blake 2011-12-07 10:43:22 EST
Sound should now be supported through SPICE in F16.  Since F14 is near end-of-life, I'm wondering if we should just close this, and recommend upgrading and switching to SPICE.
Comment 36 Grant Williamson 2011-12-07 10:48:32 EST
I would agree to that.
Comment 37 David Ayers 2011-12-07 11:15:35 EST
I'm not sure... doesn't SPICE require user tools in the guest OS?

If OTOH SPICE can be used with an arbitrary OS and pickup sound from it's sound card emulation, then I'd agree.  Otherwise I think there is still a use case for forwarding sound from some sound card emulation that's transparent for the guest.
Comment 38 Daniel Berrange 2011-12-07 11:42:17 EST
SPICE does not require any agent support for audio.

In addition there are recent patches for GTK-VNC that finally do the audio work, so we'll likely get this supported in F17 for VNC.
Comment 39 Andrew McNabb 2011-12-07 12:23:43 EST
I'm fine with using SPICE. Oddly, it doesn't seem to be the default, even in Fedora 16.
Comment 40 Cole Robinson 2012-01-24 16:49:24 EST
As mentioned f14 is EOL, and sound works out of the box with virt-manager in F16, so closing this CURRENTRELEASE.