VMware Communities
ritterwolf
Enthusiast
Enthusiast

VMWare PulseAudio HOWTO

Disclaimer: I accept no resposnsibility for any horrible things that happen to you, your computer, and those around you as a result of you following this HOWTO. It may cause you, or those around you, to get fired, kill your dog, insult your mother or make your computer explode and various other things that you might have thought impossible. You follow these instruction at your own risk.

I did this with Workstation 6.5 RC1 build 110068 on Ubuntu 8.04 64-bit.

With that out of the way, the instructions

1. shut down all your virtual machines

2. remove OSS emulation from ALSA, by adding the following lines to the bottom of /etc/modprobe.d/blacklist-oss

blacklist snd_pcm_oss

blacklist snd_mixer_oss

blacklist snd_seq_oss

3. unload those modules

$ sudo modprobe -r snd_pcm_oss

$ sudo modprobe -r snd_mixer_oss

$ sudo modprobe -r snd_seq_oss

4. we move the real vmware-vmx executable aside, and create a wrapper script

$ cd /usr/lib/vmware/bin

$ sudo mv vmware-vmx vmware-vmx.real

$ sudo touch vmware-vmx

edit this new vmware-vmx file in your favorite text editor, remembering to start is as root, eg 'sudo vim vmware-vmx'

        • start: vmware-vmx ----

#!/bin/bash

padsp $0.real "$@"

        • end: vmware-vmx ----

5. Now to set the required permissions on the wrapper script.

$ sudo chmod ax,us vmware-vmx

6. Now to set the permissions on the library used to send OSS calls to PulseAudio.

$ sudo chmod u+s /usr/lib/libpulsedsp.so

That's it!

I tested this by playing music out of rhythmbox, and logging into a Windows XP guest. When I heard that dreaded login sound, I knew it was all working.

If you get stuttering sound, do the following:

$ sudo adduser $USER pulse-access

$ sudo adduser $USER pulse-rt

and add the following lines to $HOME/.pulse/daemon.conf

-


start: daemon.conf

high-priority = yes

nice-level = -11

realtime-scheduling = yes

realtime-priority = 5

default-fragments = 8

default-fragment-size-msec = 5

resample-method = speex-float-3

-


end: daemon.conf

restart the daemon, and stuttering should be better. Try tuning the values in daemon.conf if there is still stuttering.

0 Kudos
26 Replies
raywood
Enthusiast
Enthusiast

I can't say. But I've been installing a VirtualBox VM in the meantime. I need the audio to work reliably.

0 Kudos
Mulchman
Contributor
Contributor

The latest VMware Workstation 7 supports ALSA. I've been using it for a few hours (on a 64 bit Fedora 11 installation) and it's been tremendous finally having sound, albeit not the best quality and kind of choppy/scratchy sometimes, coming from my Windows XP virtual machine.

0 Kudos
ksc
VMware Employee
VMware Employee

The latest VMware Workstation 7 supports ALSA. I've been using it for a few hours (on a 64 bit Fedora 11 installation) and it's been tremendous finally having sound, albeit not the best quality and kind of choppy/scratchy sometimes, coming from my Windows XP virtual machine.

The choppy/scratchy is actually a Linux scheduler regression somewhere around 2.6.29 - the scheduler is so proactive about moving threads to a single core to power down other cores that it ends up creating large latency problems on that one core. I shouldn't single out Linux either - Windows 7 has the same behavior, though it's less pronounced.

We're actively looking into workarounds. A CPU-intensive guest workload tends to avoid the regression.

0 Kudos
keithdart
Contributor
Contributor

Isn't that also tuneable with kernel config options? There is the selection "server" vs. "low-latency desktop".

I have not experience this choppiness, except for the startup sound when the disk is also in heavy use.

0 Kudos
bobdevis
Contributor
Contributor

I can confirm that the Pulseaudio problem went away with Workstation7.

The "ALSA default sound card" option hooks onto Pulseaudio perfectly.

If you have choppy sound in a Windows guest do not forget to turn off sound hardware acceleration inside the guest.

XP Guest > Control Panel > Sound and Audio Device Properties > Volume > Speaker Settings > Advanced > Performance

Set the Hardware Accel and the Sample Rate to the lowest settings and reboot the guest.

0 Kudos
ritterwolf
Enthusiast
Enthusiast

I haven't had the need to tune anything for Workstation 7. Sound is choppy to start, but it stabilises very quickly. I think its an artifact of the host, rather than the guest, because RhythymBox does the same thing sometimes.

0 Kudos
vincew
Contributor
Contributor

Curious if you have a fresh install of 9.10? I upgraded from 9.04 and sound in my XP Guest is still choppy long after startup. I've tried the other hints in this thread but with no luck. Any suggestions welcome..

0 Kudos