no sound: pulseaudio connection refused

Bug #575919 reported by Peter Bienstman
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Expired
Low
Unassigned

Bug Description

Binary package hint: qemu-kvm

I can't get audio inside my virtual machines

>kvm beanie_2.img -soundhw es1370

gives the errors:

pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin"
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'

Revision history for this message
Mathias Gug (mathiaz) wrote :

Could you outline the version of the system and packages used on the host?

Changed in qemu-kvm (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

It's a default 10.4 install.

Changed in qemu-kvm (Ubuntu):
status: Incomplete → New
Revision history for this message
Jake Cobb (error404) wrote :

I have this same problem:

$ dpkg -s pulseaudio qemu-kvm | grep -E '^(\s*$|Package|Version)'
Package: pulseaudio
Version: 1:0.9.19-0ubuntu4

Package: qemu-kvm
Version: 0.12.3+noroms-0ubuntu9

I get the errors shown in the original report and also some additional 'Internal Error' ones intermittently. It's not specific to es1370, I get the same thing for other -soundhw options. Here's a snippet of the messages:

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'
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.dac1'
waitpid(): No child processes
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Internal error
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.dac1'
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Connection refused
waitpid(): No child processes
pulseaudio: pa_simple_new for playback failed
pulseaudio: Reason: Internal error
audio: Failed to create voice `es1370.dac2'
waitpid(): No child processes
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Internal error
pulseaudio: pa_simple_new for capture failed
pulseaudio: Reason: Connection refused
audio: Failed to create voice `es1370.adc'

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi Jake,

can you tell us the exact command line you were running? I have a basically
stock 10.04 laptop, and the following:

    kvm -drive file=lucid.img,if=virtio,index=0,boot=on -m 1G -smp 2 -net nic,model=virtio -net user -soundhw es1370

runs just fine for me. Are you able to run, say, rhythmbox? Is there
a pulseaudio process running in your name? (See 'ps -ef | grep pulseaudio')

Changed in qemu-kvm (Ubuntu):
status: New → Incomplete
Revision history for this message
Jake Cobb (error404) wrote :

Serge,

Sorry, I should have provided more info. I'm running the Kubuntu variant and did a distribution upgrade from Karmic to Lucid, after which this problem started occurring.

Turns out I was sloppy in my checks, the pulseaudio package was not installed. I was thrown off by the fact /etc/init.d/pulseaudio existed and forgot to check package status.

Sound works if I do one of two things:

1) Install pulseaudio
2) Override the driver, e.g. with: $ export QEMU_AUDIO_DRV=oss

I'm not sure if pulseaudio was lost during the distribution upgrade or if it's not normally installed for Kubuntu and the default driver for kvm changed to it.

All other programs were working fine without it, both KDE (e.g. Amarok) and non-KDE (e.g. Flash plugin in Firefox). It seems like Amarok is using phonon, I'm not sure about other programs.

Probably irrelevant now, but I was using:

kvm -hda /home/jake/vm_disks/windowsxp.img -m 1024 -vga std -no-frame -usb -usbdevice -localtime

For testing, I was appending various -soundhw options, but used just es1370 for this report.

Revision history for this message
Sam Azer (samazer) wrote :

FYI I also did an online upgrade from karmic to lucid but everything works perfectly except KVM. Pulseaudio works fine from KDE apps like amarok as well as Adobe Flash under Firefox and Chrome. I remember I lost cups-pdf during the upgrade but everything sound-related upgraded perfectly. The only thing that absolutely refuses to work is QEMU under KVM. I start it from virt-manager so the command line is auto-generated. When I rdesktop into a Windows VM I get perfect sound through rdesktop / pulseaudio. The same VM, when accessed by opening the VNC screen through virt-manager, doesn't seem to connect with PulseAudio. I tried all the available settings for QEMU_AUDIO_DRV. I've tried lots of things (including manually starting VM's with padsp) but I just can't get it to work. Any tips, links to recent FAQ pages that I might have missed; any help at all would be much appreciated. Thanks, --Sam.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for qemu-kvm (Ubuntu) because there has been no activity for 60 days.]

Changed in qemu-kvm (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

I believe this expiration is in error, as the posters did provide feedback...

Changed in qemu-kvm (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Jake's problem was that pulseaudio was not installed. That could be a bug in the
installer, but I would actually guess it is just expected with KDE - do they still use
arts?

Sam's is not a bug, but a shortcoming in vnc. FreeNX and, as he points out, rdesktop,
do support remote audio. None of the open vnc clients I know of do. So that's a
missing feature.

Peter, yours based on the errors in the description looks like the same as Jake's.
If you are still having problems, then please mark this 'new' again and describe
your environment. Are you also on Kubuntu?

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Sam Azer (samazer) wrote :

Hi Serge,

To be more precise:

* rdesktop from the current workstation to a Windows VM on the current workstation connects correctly (rdesktop connects correctly) to PulseAudio on the current workstation. This allows the rdesktop user to hear the sound being produced by the Windows VM through PulseAudio via rdesktop. From this we know that PulseAudio on the current workstation is working correctly and that the sound system in the VM is producing sound.

The problem is this:

* KVM/QEMU contain a virtual sound card. This virtual hardware is supposed to be able to receive the sound from the VM and send it to the PulseAudio system. I have tried very hard to get that hardware to actually connect to PulseAudio via some combination of command line options - without success.

The virtual sound card is in KVM/QEMU, there is some documentation on the many command line parameters that control it, there are many options intended to make it possible to use the feature on workstations with different sound system setups, the VM OS recognizes the different virtual devices that can be emulated - in short: everything looks good but doesn't work with PulseAudio.

I was playing with this quite some time ago and my memory is fuzzy on details but I recall that the VM was able to connect directly to a sound system (ie: locking the hardware so that no other software can connect.) The problem was getting it to connect to PulseAudio so that, for example, I can hear the sound produced by the VM while listening to Amarok on the main workstation or while talking on my softphone.

My thanks as always for the excellent work you guys are doing!

All the best,
Take care,
Sam.

Revision history for this message
Sam Azer (samazer) wrote :

FYI I am now running kubuntu 10.10. Just tried a Windows XP VM with KVM set to emulate an intel integrated audio card. There is still no sound from the VM to PulseAudio. Rdesktop to the VM loads the RDP driver correctly in Windows and the sound comes through. Please let me know if there's a workaround? Thanks, Take care, --Sam.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 575919] Re: no sound: pulseaudio connection refused

Quoting Sam Azer (<email address hidden>):
> The virtual sound card is in KVM/QEMU, there is some documentation on
> the many command line parameters that control it, there are many options
> intended to make it possible to use the feature on workstations with
> different sound system setups, the VM OS recognizes the different
> virtual devices that can be emulated - in short: everything looks good
> but doesn't work with PulseAudio.

Hi Sam,

Right now I'm running:

kvm -soundhw ac97 -hda win.img -m 1G -smp 2

and playing music from www.di.fm on the vm, listening on the host. The
gnome-volume-control 'Applications' panel shows qemu as a connected
application.

The guest is a freshly installed windows 2003 r2 enterprise sp2, which I
installed using the command:

kvm -soundhw ac97 -hda win.img -m 1G -smp 2 -cdrom en_win_srv_2003_r2_enterprise_with_sp2_cd1_x13-05460.iso -boot d

Does doing those exact steps (substituting your iso of course) also fail
for you?

Revision history for this message
Sam Azer (samazer) wrote :

THANK YOU!!

First let me say that the command line options that you listed above work perfectly. That's already a big step forward.

As you can see from the initial set of error messages provided by Peter Bienstman, the original problem was a "connection refused" message.

I don't remember what versions of libvirt/pulse & ubuntu I was running back then but today the messages are very different. I'm still getting connection refused messages - but now I'm getting additional messages that show the problem to be related to Libvirt's use of user libvirt-qemu and the associated permissions for various folders.

There may be other issues that are preventing other users from getting this to work. In my case I would say that this is now a libvirt setup/config bug - not a kvm bug. I'll keep tinkering a bit longer.

Thanks again!

Revision history for this message
Sam Azer (samazer) wrote :

Hi Serge,

I'm not the right person for this job. It may be there's something wrong with the way kvm asks for pulse resources. There might also be a resource conflict between the virtual network devices and the virtual sound device. I've put a few hours into it but I'm not knowledgeable enough to determine where the problem lies (kvm or libvirt) for my case.

If I understand the original bug report, though, the problem has been fixed - KVM no longer has any problem connecting to pulse when called as a normal user - at least not for me.

Thanks again,
Take care,
Sam.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for qemu-kvm (Ubuntu) because there has been no activity for 60 days.]

Changed in qemu-kvm (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.