VMware Communities
jamespharaoh
Contributor
Contributor

Make ALSA sound work in VMWare

It is easy to get vmware to use alsa in linux, but this is not supported:

\- Install the libaoss library (part of alsa-oss on my ubuntu distribution).

\- Ensure the /usr/lib/libaoss.so.0.0.0 library is setuid (chmod +s /usr/lib/libaoss.so.*)

\- Rename vmware-vmx to vmware-vmx-real

\- Replace vmware-vmx with the following script:

#!/bin/sh

PATH_TO_VMWARE_BIN=`dirname $0`

LD_PRELOAD=libaoss.so exec $PATH_TO_VMWARE_BIN/vmw

This shouldn't cause any problems if the libaoss library is not installed or not setuid, it will simply work through the old OSS library as normal.

This could probably be quite easily be integrated as a configuration option into a future version of your product.

It does actually provide useful functionality as the sound is mixed with other applications using dmix.

0 Kudos
31 Replies
Thomas_J
Contributor
Contributor

The compiler tells you what went wrong:

vmdsp_esd.c:18:17: error: esd.h: No such file or directory

The include file esd.h is missing. I am not sure about Fedora, but usually the package you have to have installed is called esound-devel. Check with your preferred rpm database like pbone.net to find the appropriate name.

0 Kudos
Thomas_J
Contributor
Contributor

In the meanwhile I added the 64-bit support again. Please feel free to try it.

0 Kudos
twc
Contributor
Contributor

I am running SUSE 10.2. I am desp to get this working...

getting the following error:

TWC:/home/tc/Desktop/vmwaredsp-1.4 # make install

make -C src install

make[1]: Entering directory `/home/tc/Desktop/vmwaredsp-1.4/src'

cc -c -g -W -Wall -O2 -fPIC -o vmdsp.o vmdsp.c

cc -shared -Wl,-version-script=vmdsp.map -o libvmdsp.so vmdsp.o -lpthread -ldl -lc

/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: libvmdsp.so: undefined versioned symbol name lseek64@GLIBC_2.2.5

/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: Bad value

collect2: ld returned 1 exit status

make[1]: *** \[libvmdsp.so] Error 1

rm vmdsp.o

make[1]: Leaving directory `/home/tc/Desktop/vmwaredsp-1.4/src'

make: *** \[install] Error 2

Any help appreciated.

Tc

0 Kudos
dreamcarrior
Contributor
Contributor

WinXP as guest OS. In Fedora 4, vmware 5.5.3 works great. In Fedora 6, vmware 6.0 works great but no sound. I tried the following

1. moving vmware-vmx to vmware-vmx.real and put LD_PRELOAD=libaoss.so.0.0.0 exec /usr/lib/vmware/bin/vmware-vmx.real "$@" to the original vmware-vmx

2. add export LD_PRELOAD=/usr/lib/libaoss.so.0.0.0:$LD_PRELOAD to wrapper-gtk24.sh right before the last line vm_run "$@"

3. in settings, I could either choose autodect sound or choose /dev/dsp, but neither works.

I don't know what else I should do to make the sound work, but the next thing will be compile the vmwaredsp. If anyone has any suggestion, please let me know. Thanks.

0 Kudos
Thomas_J
Contributor
Contributor

Sorry for the late response.

It is probably due to the fact that I broke 64 bit support in the first release. Please download and compile again.

Cheers.

0 Kudos
Whoopie
Contributor
Contributor

Hi Thomas_J,

I tested vmwaredsp-1.4 with latest vmware player (Ubuntu Gutsy). I have two problems here.

1. When another application on the host uses the sound card, I get the debug message: "ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave"

2. If vmware is the only application which wants to use the sound card, I see "ALSA lib pcm.c:7067:(snd_pcm_recover) underrun occured". The sound in the vmware guest is skewed and flannelly.

Do you have a guess why? Thanks for your help.

Best regards,

Whoopie

0 Kudos
Thomas_J
Contributor
Contributor

Hi Whoopie,

Hi Thomas_J,

I tested vmwaredsp-1.4 with latest vmware player (Ubuntu Gutsy). I have two problems here.

1. When another application on the host uses the sound card, I get the debug message: "ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave"

I am not sure. Could be that your device does not support automatic mixing, i.e. shared access to the hardware. You can check if you system supports it by trying yo play a sound file twice at the same time: aplay foo.wav&; aplay foo.wav&. If you can hear it twice everything is fine, well, I would probably have to look into it.

2. If vmware is the only application which wants to use the sound card, I see "ALSA lib pcm.c:7067:(snd_pcm_recover) underrun occured". The sound in the vmware guest is skewed and flannelly.

Yeah. I have seen this, too, but I haven't debugged it yet. If I find time on my next week off, I'll try to figure out what is wrong. Otherwise, if I do not find time, everybody is invited to have a look at the code. Thanks.

Cheers,

T.

0 Kudos
dhurst
Contributor
Contributor

twc,

I'm working in OpenSuSE 10.3 with vmware workstation v6.02. I've run into the same compile time problem your listing and wondered if you found a way to fix it. Here is what I get on a 64bit machine:

/home/dphurst/vmwaredsp-1.4 # make

make -C src default

make[1]: Entering directory `/home/dphurst/bin/vmwaredsp-1.4/src'

cc -c -g -W -Wall -O2 -fPIC -o vmdsp.o vmdsp.c

cc -shared -Wl,-version-script=vmdsp.map -o libvmdsp.so vmdsp.o -lpthread -ldl -lc

/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: libvmdsp.so: version node not found for symbol lseek64@GLIBC_2.2.5

/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: Bad value

collect2: ld returned 1 exit status

make[1]: *** http://libvmdsp.so Error 1

rm vmdsp.o

make[1]: Leaving directory `/home/dphurst/bin/vmwaredsp-1.4/src'

make: *** Error 2

Is there a trick to fix this? Obviously, I'm using the 64bit gcc to compile this.

Thanks,

Dow

0 Kudos
xbalanque
Contributor
Contributor

while the patched vmsdsp driver doesn't work on the 64bits version, i'm still trying to make the old aoss hack to make vmware player (not the workstation, i'm assuming they are similar) to work with sound. I'm on a Ubuntu 7.10 64bits.

Unfortunately it's failing -- without giving much reason why.

By doing an "lsof" on the /usr/lib/vmware/bin/vmplayer process, i noticed it did link libaoss.so.

I tried using libaoss with mpg123 (configured to use oss) and it works.

Just for safety i also closed anything that would have any of the sound devices opened: even the volume control on the panel. Running "lsof" told me that there was nothing opening anything like "/dev/snd*".

Any ideas on what could i be doing wrong ?

many thanks!

ps.: btw, i remember this issue since at least 2005, when i had vmware workstation 5 ... it's amazing that vmware hasn't updated its sound driver yet!

0 Kudos
xbalanque
Contributor
Contributor

(duplicate post removed)

0 Kudos
admin
Immortal
Immortal

VMware Workstation 7.0 and VMware Player 3.0 now supports ALSA on Linux hosts http://communities.vmware.com/community/beta/workstation

Better late than never...

--Bankim.

0 Kudos
larryleffa
Contributor
Contributor

Inspired by this thread I tried the following:

start-vmware:

#! /bin/bash

LD_PRELOAD=/usr/lib64/libaoss.so exec aoss /opt/vmware/workstation/bin/vmware "$@"

start-vmplayer:

#! /bin/bash

LD_PRELOAD=/usr/lib64/libaoss.so exec aoss /opt/vmware/workstation/bin/vmplayer "$@"

Works for me like a charm. Tried with VMware-Workstation v6.5.3.185404 on a Gentoo-Linux X86_64 with alsa-oss.

-

Larry

0 Kudos