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

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
lkraav
Posts: 13
Joined: 21. Feb 2008, 09:35
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Win7 RC (X86, X64), Gentoo Linux

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

Post 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 8680 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 8687 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 8669 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?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

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

Post 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.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
lkraav
Posts: 13
Joined: 21. Feb 2008, 09:35
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Win7 RC (X86, X64), Gentoo Linux

Re: High CPU load using audio - all Windows guests

Post 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.
lkraav
Posts: 13
Joined: 21. Feb 2008, 09:35
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Win7 RC (X86, X64), Gentoo Linux

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

Post by lkraav »

after a few weeks of usage, vmware fusion has proven to have significantly better performance in this regard.
lkraav
Posts: 13
Joined: 21. Feb 2008, 09:35
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Win7 RC (X86, X64), Gentoo Linux

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

Post by lkraav »

say what now? that question doesn't make any sense.
Post Reply