Page 1 of 1

Audio latency & various issues with a Windows 7 guest

Posted: 1. May 2019, 18:51
by r0
Hello everyone.

I am on a 2018 MacBook Pro using macOS Mojave 10.14.4 ( 64-bit ).
I am running VirtualBox 6.0.6 r130049, which seems to be the latest release at the time.
My VM is running like this :
  • OS : Windows 7 ( 64-bit )
  • Guest Additions : installed ( 6.0.6 r130049 )
  • Number of cores : 4 ( out of 8 )
  • RAM : 8192mb ( out of 16384mb )
  • Video RAM : 256mb ( maximum )
  • Hardware acceleration : both 2D & 3D toggled
  • Host audio driver : CoreAudio
  • Audio controller : Intel Audio HDA
  • Audio I/O : input is disabled
I am running into severe audio issues when using my VM. Precisely :
  • I have what seems to be a second of latency between the start of the sound in the VM and the actual playing on the Mac
  • Audio is randomly corrupted (parts of playback is distorted/silent) and is often cut-off before the playback stops. When this happens, I usually hear the cut-off part at the beginning of the next playback.
  • Right channel is randomly working when testing both channels (I actually heard the bell only once on the right channel)
My main issue is the latency, as this makes my VM unusable for my main tasks.

As asked, I have attached the VM log from when I last ran it, minutes ago.

Thanks a lot for the help. This is a fantastic piece of software and this is my only real issue with it so far.

Re: Audio latency & various issues with a Windows 7 guest

Posted: 1. May 2019, 19:24
by mpack
00:00:01.574591 NumCPUs <integer> = 0x0000000000000004 (4)
00:00:01.465100 Host RAM: 16384MB (16.0GB) total, 8365MB (8.1GB) available
...
00:00:01.820164 CPUM: Physical host cores: 4
00:00:01.574593 RamSize <integer> = 0x0000000200000000 (8 589 934 592, 8 192 MB, 8.0 GB)
00:00:01.574810 VRamSize <integer> = 0x0000000010000000 (268 435 456, 256 MB)
I think latency is a given when you starve the host of RAM and CPU.

Re: Audio latency & various issues with a Windows 7 guest

Posted: 1. May 2019, 19:55
by r0
I used to run this VM with 4gb of RAM, but I increased it to 8 to try and fix the latency issues. It's now back to 4.

But you might be right about the cores : I have 4 physical cores. Guess VirtualBox is considering threads as cores... Downgraded to two.

The issues are still present with less resources.

Re: Audio latency & various issues with a Windows 7 guest

Posted: 1. May 2019, 21:35
by socratis
Just to clear any misconceptions, and set the record straight:
[color=#105289]r0[/color] wrote:Guess VirtualBox is considering threads as cores.
Absolutely not. VirtualBox considers cores as cores, and threads as threads:
[color=#BF6000]VBox.log[/color] wrote:
00:00:01.820160 CPUM: Logical host processors: 8 present, 8 max, 8 online, online mask: 00000000000000ff
00:00:01.820164 CPUM: Physical host cores: 4
00:00:01.820384 Full Name: "Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz"
and from the horse's mouth, you can see that your Intel i7-8559U CPU has 4 cores / 8 threads.
00:00:01.508364 File system of '/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' (DVD) is apfs
Just for reference, always eject your Guest Additions (GAs) ISO after you're done installing the GAs.
00:00:01.489599 Guest OS type: 'Windows7_64'
00:00:01.574795 [/Devices/usb-xhci/0/LUN#1/] (level 4)
You do know that Win7 doesn't support USB3 and that special attention is needed, like the installation of specific Intel drivers, right? See USB basics and troubleshooting » #6: Guest support for the details.
00:00:01.794147 NAT: Set redirect TCP 127.0.0.1:5030 -> 10.0.2.15:3389
Why do I get the feeling that you're using RDP with this VM...?
00:00:01.817673 Audio: Found 4 devices for driver 'CoreAudio'
00:00:01.817710 Audio: Device 'JBL T450BT':
00:00:01.817716 Audio: 	Usage           = Input
00:00:01.817720 Audio: 	Flags           = DEFAULT
00:00:01.817724 Audio: 	Input channels  = 1
00:00:01.817728 Audio: 	Output channels = 0
... (built-in input)
00:00:01.817751 Audio: Device 'JBL T450BT':
00:00:01.817754 Audio: 	Usage           = Output
00:00:01.817758 Audio: 	Flags           = DEFAULT
00:00:01.817762 Audio: 	Input channels  = 0
00:00:01.817765 Audio: 	Output channels = 2
... (built-in ouput)
What's that? It seems like your Bluetooth wireless headphones. With a microphone? What if you remove it from the equation?

00:00:01.574660 [/Devices/ahci/0/LUN#0/Config/] (level 5)
00:00:01.574661   BlockCache <integer> = 0x0000000000000001 (1)
00:00:01.574661   Format     <string>  = "VDI" (cb=4)
00:00:01.574662   Mountable  <integer> = 0x0000000000000000 (0)
00:00:01.574662   Path       <string>  = "/Users/r0/VMs/Win7/Snapshots/{c7802988-428d-4fac-aaf2-59878635d5c7}.vdi" (cb=72)
00:00:01.574663   Type       <string>  = "HardDisk" (cb=9)
00:00:01.574663   UseNewIo   <integer> = 0x0000000000000001 (1)
00:00:17.041713 AIOMgr: Host limits number of active IO requests to 16. Expect a performance impact.
Go to the VM Settings » Storage » select the SATA Controller » Use Host I/O Cache: check that.
r0 wrote:as this makes my VM unusable for my main tasks
What are your main tasks? I have the feeling from your description that you're not talking about a YouTube or a local video having such issues, I think you might be talking about another level of tasks...

Re: Audio latency & various issues with a Windows 7 guest

Posted: 2. May 2019, 00:10
by r0
Thanks for the answer. Answering point per point, if that's okay.
socratis wrote:Absolutely not. VirtualBox considers cores as cores, and threads as threads [...] and from the horse's mouth, you can see that your Intel i7-8559U CPU has 4 cores / 8 threads.
Thanks for the precision. I knew what the i7 provides, but VirtualBox offers me up to 8 CPUs in the GUI.
socratis wrote:Just for reference, always eject your Guest Additions (GAs) ISO after you're done installing the GAs.
Will do. Thanks for that.
socratis wrote:You do know that Win7 doesn't support USB3 and that special attention is needed, like the installation of specific Intel drivers, right?
Is xHCI not the default value? Sorry for that. I might have set this up instinctly, without actually requiring it. Reverting back to EHCI.
socratis wrote:Why do I get the feeling that you're using RDP with this VM...?
You're not wrong, haha. I tried setting up RDP in order to connect to the VM and have no sound latency. (this is extremely ugly, I know. but hey, I have no audio latency with that!) Sadly, what I'm trying to run breaks through RDP. Need to disable this.
socratis wrote:What's that? It seems like your Bluetooth wireless headphones. With a microphone? What if you remove it from the equation?
This is indeed wireless headphones (with a useless microphone). Nothing happens when removed from the equation : latency is still present.
socratis wrote:Go to the VM Settings » Storage » select the SATA Controller » Use Host I/O Cache: check that.
Done.
socratis wrote:What are your main tasks? I have the feeling from your description that you're not talking about a YouTube or a local video having such issues, I think you might be talking about another level of tasks...
I am running a 10 year-old game. Runs perfectly fine, besides the audio issues (that are still there when nothing runs on the guest OS).
I know that this isn't the usual goal of VMs, but the game has a small resource footprint (for 2019) and a broken Mac port.

Re: Audio latency & various issues with a Windows 7 guest

Posted: 2. May 2019, 00:53
by socratis
r0 wrote:but VirtualBox offers me up to 8 CPUs in the GUI.
Only half of them are green. Now you know why... ;)
r0 wrote:Is xHCI not the default value? Sorry for that. I might have set this up instinctly, without actually requiring it. Reverting back to EHCI.
No, it's not the default, but it doesn't matter, you can make it work. In fact, it's suggested if you can do it, just because the USB3 stack is a much better written one than the USB1/2 one.
r0 wrote:I tried setting up RDP in order to connect to the VM and have no sound latency ... Sadly, what I'm trying to run breaks through RDP. Need to disable this.
So, you have no sound latency with RDP in your generic apps? But it doesn't work with the game? Do I get it right?
r0 wrote:I am running a 10 year-old game.
Ha! I knew it! :)
What's the game in question? Keep in mind that programs like these tend to push the physical hardware to their limit hence the strict requirements. Virtual machines will never be as powerful as the host. They use after all virtual components, not your host's real hardware. Applications that have high requirements are expected to not work as good as on the real hardware, if they work at all.

Re: Audio latency & various issues with a Windows 7 guest

Posted: 2. May 2019, 02:44
by r0
socratis wrote:Only half of them are green. Now you know why... ;)
The more you know!
socratis wrote:No, it's not the default, but it doesn't matter, you can make it work. In fact, it's suggested if you can do it, just because the USB3 stack is a much better written one than the USB1/2 one.
Time to install some drivers then!
socratis wrote:So, you have no sound latency with RDP in your generic apps? But it doesn't work with the game? Do I get it right?
Yep. The game detects the various graphical changes RDP makes, and won't startup. And, no, running the game before connecting through RDP doesn't work, sadly. At this point I'll just boot up the game + something like VLC to stream the sound to the host...
socratis wrote:Ha! I knew it! :)
What's the game in question? Keep in mind that programs like these tend to push the physical hardware to their limit hence the strict requirements. Virtual machines will never be as powerful as the host. They use after all virtual components, not your host's real hardware. Applications that have high requirements are expected to not work as good as on the real hardware, if they work at all.
It's SPORE!
The game runs pretty well inside the VM (except maybe a few graphical glitches, nothing too big though). Sadly, it uses a lot of sound effects and it just gets crazy playing this with one second of audio latency. Not even talking about the cutscenes...

I'm not expecting a bug-free gameplay, just something strong enough to be playable. And the only issue is the audio latency...

Re: Audio latency & various issues with a Windows 7 guest

Posted: 2. May 2019, 04:27
by socratis
If you want my 2¢, try a dual boot, with an external HD, that's what I did at the end. Got myself a 500 GB USB3 HD, installed Win10 and I can play all of my games there, the ones not ported on OSX. No more compatibility issues. If I want to take a break, I'm literally taking a break... ;)

Re: Audio latency & various issues with a Windows 7 guest

Posted: 2. May 2019, 23:05
by r0
I considered this.
First of all, this is kind of hard to "afford" on newer Macs: there isn't much disk space, no SD ports, and no good GPU.

Second, I do not want to do it. I'm definitely not dual-booting just for one game when a VM does just fine, besides one issue...

Sure, I could play more games and use other software through a dual-boot, but I don't have the need to. I do pretty well on macOS. And if I ever want to run Windows, I'd probably do it on another machine...

Having tried dual-booting with an external hard drive years ago, I have bad memories of it. It's a good idea to have in mind though, if my needs ever evolve (they will do, for sure).

Right now everything is fine.... besides audio! :'(

Re: Audio latency & various issues with a Windows 7 guest

Posted: 3. May 2019, 09:08
by socratis
r0 wrote:Having tried dual-booting with an external hard drive years ago, I have bad memories of it.
Give it a shot again... USB3+SSD drive will be a much better experience compared to USB2+HD from a few years back.

But at the end, it's your call... ;)