Page 1 of 1

High CPU load using audio - Windows 7 RC Guest (x86 & x64)

Posted: 10. May 2009, 11:32
by lkraav
Hi all

Host is MacBook Pro 2.4GHz, 4GB RAM, OSX 10.5.4. Guests get 768 MB RAM. When Guest is idle, CPU usage on host is stable ~10%, which is very nice.
But using the virtual sound card significantly affects host CPU load.

32-bit Win 7 uses the driver found with Windows Update.
64-bit Win 7 uses the latest March 2009 Realtek x64 AC97 driver (6303_Vista_Win7_PG537.zip).

This is what I've found on both 64-bit and 32-bit Win 7 RC:

1. When playing audio on Guest, CPU usage on Host rises significantly. 32-bit Win 7 driver runs Host CPU at around 75%, 64-bit Realtek driver runs Host CPU even worse, at around 85-90%.

Note that Process Explorer running minimized in the system tray shows that CPU usage on Guest is pretty much idle, as it should be. Screenshots are taken of 32-bit Windows 7 machine.
Music is playing in Windows Media Player = High CPU usage on Host
Music is playing in Windows Media Player = High CPU usage on Host
Picture 3.jpg (108.1 KiB) Viewed 8695 times
2. When audio is stopped, but media player stays running, CPU cycles are still being eaten although a bit less - around ~60% now. Guest is idle. I guess virtualization engine still needs to work hard when the sound card handle is open in Windows? Maybe a place for optimization?
Music is stopped in Windows Media Player = High CPU usage remains!
Music is stopped in Windows Media Player = High CPU usage remains!
Picture 4.jpg (107.17 KiB) Viewed 8702 times
3. Closing media player immediately releases CPU on Host.
Windows Media Player is closed = CPU usage immediately drops to normal
Windows Media Player is closed = CPU usage immediately drops to normal
Picture 5.jpg (83.07 KiB) Viewed 8684 times
This might not even be a problem, because I don't know - maybe sound card really is that CPU expensive to virtualize and there is no cure. I am really hoping this can be improved though, it would be really nice to run Windows sound apps in a quiet laptop! Any thoughts?

Re: High CPU load using audio - Windows 7 RC Guest (x86 & x64)

Posted: 10. May 2009, 16:58
by TerryE
This sort of issue can be cause if the guest OS starts using the realtime clock or fine timeslice. Both of these are really unneeded in a VM since its really the host OS and its drivers that really handle the realtime issues. Having the guest OS do this just causes the VM to thrash the VMM process and this results in the sort of load that you see.

Re: High CPU load using audio - all Windows guests

Posted: 10. May 2009, 19:26
by lkraav
so how can this be neutralized? custom made special VM drivers for the AC97?

edit: tested this on Win XP SP2 - same effect - for both SB16 and ICH97.

edit2: tested on Gentoo 2.6.24 - playing a MP3 podcast with VLC results in ~30% total cpu usage on host, wow! anything in particular that could be concluded from this?

edit3: downloaded vmware fusion and parallels, going to test these out as well.

edit4: vmware fusion 2.0.4, xp sp2 fresh install - 30% total cpu usage on host playing audio with windows media player. sound card emulated there is creative audiopci 1371. so looks like this is a solvable problem one way or the other.

Re: High CPU load using audio - Windows 7 RC Guest (x86 & x64)

Posted: 24. May 2009, 12:21
by lkraav
after a few weeks of usage, vmware fusion has proven to have significantly better performance in this regard.

Re: High CPU load using audio - Windows 7 RC Guest (x86 & x64)

Posted: 29. May 2009, 12:15
by lkraav
say what now? that question doesn't make any sense.