Sound Problem With VirtualBox -5.2.x branch

Discussions related to using VirtualBox on Windows hosts.
Raster
Posts: 5
Joined: 14. Mar 2014, 16:35

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Raster »

I just wanted to chime in. I just tested with VirtualBox 5.2.12 and I'm still having this issue.

Host: Windows 8
Guest: Mint 18.2 (w/ Guest Additions applied)

As noted above, the crackling is cyclic and the debug wav files are clear.
JN
Posts: 6
Joined: 2. Mar 2014, 04:21

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JN »

Ditto.
Host: Windows 10 Home
Guests: Windows 7 Pro
VB Version 5.2.2 r119230

It doesn't sound like there is much point in updating to the latest VB.
Tacoma
Posts: 4
Joined: 22. Sep 2015, 23:25

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Tacoma »

Raster wrote:I just wanted to chime in. I just tested with VirtualBox 5.2.12 and I'm still having this issue.
Ditto, same problem here ...
Win 10 and Win 7 host.
Ubuntu Mate guests.
Fab Ich
Posts: 1
Joined: 14. Jun 2018, 22:59

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Fab Ich »

I'd like to report the same problem

host is Windows10
guest is Ubuntu 18.04
VB version 5.2.12

The sound loop between normal and crackles

I've (randomly) found a way to instantly reset it to normal by opening the sound settings (which now are in my favourite) but the craclking still come back 1-2 minutes after that.
jalexm
Posts: 8
Joined: 22. Mar 2018, 00:36

Re: Sound Problem With VirtualBox -5.2.x branch

Post by jalexm »

Hello,
I have audio problems here. Everything was OK, but after Windows10 last update, audio became totally distorted.
I love VirtualBox and use it to play some video courses, but now it's impossible to do it.
Hope you could fix audio problems soon and improve audio features, since this is a weakness of VirtualBox.
Thanks.

Host: Windows10
Guest: Windows 10
VirtualBox: 5.2.12 r122591
Ipacman
Posts: 2
Joined: 7. Nov 2009, 21:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Ipacman »

This is a long thread and I've just recently experienced the problem when running Linux on Windows 10 Host with v5.2.12 r122591
Its running the guest additions that came with the release.

So rather than echo the symptoms which have been stated quite clearly, I believe the sound is caused by asynchronous buffers between the VM and the host.

The crackle sound that comes and goes must be the Windows/Host side reading from the same point in the buffer where the Linux/guest side is just writing. Normally, there would be a little separation there. Its as though the host cant tell that the buffer is overflowing or underflowing and it encounters the writer, who is writing at a little delay from the correct place the reader should be reading from. After a while, the writing "passes by" the reader and the sound is good again for a while.

This is probably a timing problem. The writer has a "soundcard" that is trying running at a simulated 44.1 or 48 kHz and the reader/host has a real soundcard that is running at its sample rate. The reader/host is inflexible. But the writer has to adjust before the buffer overflows or underflows.

The writer is unaware of the reader problem. In fact if you write out the debug .wav file, it will be clean.

Just a theory, but thats what it sounds like to me.
Buzz Head
Posts: 1
Joined: 21. Jun 2018, 22:39

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Buzz Head »

I have had this problem over several upgrades on the Windows 10 VM and Virtual Box builds on my Windows 10 Host. I even did a clean install of the OS on the VM and running local still distorts the audio. I have worked around this by using Headless Start, Remote Display, and a Remote Desktop Client. The RDC protocol is not affected by this problem. Both options would still be dependent on the Windows Audio Service which intern depends on the same drivers, so this must be performance problem with the GUIs deliverance of the audio.

I should also point out this is not evident on a Windows 7 VM or the Windows XP Mode that was running on that VM. Local GUI audio works fine through both layers.

Hopes this helps development.
JanDE
Posts: 5
Joined: 24. Jun 2018, 09:15

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JanDE »

I have the same problem. After a long period I have updated from 4.3.20 to the newest VirtualBox 5.2.12. I use WindowsXP client, host is Windows 8.1.

With this new version I have audio crackling. Not permanent, but regulary. Before I did not have such issues with exactly the same VM.

Any suggestios for a solution/workaround? Or is downgrading the only solution?
Ipacman
Posts: 2
Joined: 7. Nov 2009, 21:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP

Re: Sound Problem With VirtualBox -5.2.x branch

Post by Ipacman »

Using SPDIF optical output and SPDIF optical capture, then sending a couple of predictable pattern/Tone files using aplay within Virtualbox client, I found:

1 -- Surprisingly, Windows 10 always does/did a sample rate conversion to 44.1 kHz (e.g. if your input is not 44.1 kHz). Basically the capture device just saves samples so when I played back the captured file at 48 kHz which matched my source file, the pitch was wrong. Setting the playback back of the capture file to 44.1 khz was correct.
2 -- after adjusting the tone file to 44100 Hz and its tone to 4410 Hz (1/10th sample rate for stationary sinewave pattern), I got periodic audio blips on the record side (and, of course during live playout). Zooming in with waveform editor I see a clear discontinuity at the audio blips. Every sample on either side of the blip matched the file but suspect we lost some bit of data.
3 -- When performing the same test from Windows 10 (no VIrtualbox), I get no blips. Interestingly, Windows 10 does ramp up the volume from silence. After that, it appeared to pass the samples pretty much unchanged.

For reference, the capture device was Edirol/Roland UA-1EX attached to a laptop running Windows7 that was set up previously with the Edirol driver. I've used this capture setup with some success previously. The transmitting side is built in to the Gigabyte motherboard that was running Win10 with Virtualbox. I use this optical output all of the time for normal Windows audio to digital speakers. The VirtualBox was running on a fairly fast processor (i7-2600K) under no load during the testing. Virtualbox was allocated 4 processors and 2GB of memory running xubuntu18.04 stock installation.

Vbox config was set to Intel HD Audio and ubuntu client using pulseaudio). Every control set to 100% volume in an attempt to unity transfer the data to the capture.

Conclusion is that somewhere in the Virtualbox to Windows interface a buffer is running empty or a circular buffer is wrapping. What we are seeing after the blip is valid samples, just a discontinuity. The code is a bit complex for me to wrap my head around. Does Virtualbox "send" the samples to Windows or are they "pulled" from Windows? I believe that the player program (in this case, aplay) needs to have its samples "pulled" from it with callbacks/interrupts generated when a buffer empties so that the player program can refill the buffer before the entire buffer empties. If instead these events are timed (sent to windows), then it will be very tricky to make this work right.
JanDE
Posts: 5
Joined: 24. Jun 2018, 09:15

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JanDE »

Same problem with windows 7. I didn't have that issue with Version 4 of VirtualBox. With this sound issue VB is unusable, sorry...

Host: Windows 8.1 64 Bit, Realtek High Definition Audio
Guest: Winsows 7 SP1 64 Bit
VB: 5.2.12
BillGermany
Posts: 1
Joined: 4. Jul 2018, 02:01

Re: Sound Problem With VirtualBox -5.2.x branch

Post by BillGermany »

I have a fix that works for my configuration! :-)

My configuration: Windows 7 / 64-bit host, Ubuntu 16.04 client (and other clients)

I read somewhere on StackOverflow about a fix that did not work, where it said that Linux's probing of the timing of the sound chip was failing, and that one should simply set it to 48kHz with a line in a configuration file. Then I read here, that Windows always converts to 44.1kHz. I tried changing that, and voilà!

In the Linux client, add the following to /etc/modprobe.d/alsa-base.conf:
options snd-intel8x0 ac97_clock=44100
You'll need to restart your sound system (or reboot) before it takes effect.
JanDE
Posts: 5
Joined: 24. Jun 2018, 09:15

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JanDE »

It was not easy to find out the problem, but now I am sure the audio problem still exists in ALL versions after 5.0.40. VirtualBox 5.0.40 is not affected by this audio problem. To make it more clear, I can confirm that there are many audio problems after 5.0.40.

In detail:
1. Audio is not in sync. The more audio you play, all the more the delay grows up.
2. Audio output skips or has short clicking noises, after a while.
3. Audio output is distorted. After a while audio is crackling for some minutes. Often it repairs itself, but after the next while this phenomenon occurs again.

For 2. and 3. it is not easy to say which version is affected, but the versions are after 5.0.40. The syncing problem affects ALL versions after 5.0.40. I checked it with many VB-versions and some windows clients.
You can check the "out of sync problem" easily with this youtube video:
https://www.youtube.com/watch?v=TjAa0wOe5k4
In versions after 5.0.40 you see that after a few seconds the bleep marker goes to +300ms then to +500ms and after that it is so much more that the beep comes in the minus-section. In version 5.0.40 the beep-sound comes at 0, somtimes between 0 and +100ms, but it regenerates instead of growing up.

My working configuration:
Host:
Windows 8.1 64 Bit
VirtualBox 5.0.40
ExtensionPack 5.0.40
Guest:
Windows 7 64 Bit (but Windows XP 32Bit has the same problem)
DirectSound Audio with Intel HD Audio

All versions after 5.0.40 have the audio sync problem. So I reverted to 5.0.40, that's the workaround for everyone with this audio problem.
JanDE
Posts: 5
Joined: 24. Jun 2018, 09:15

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JanDE »

What information do you need to solve this issue in the next version? I think a log won't show you an audio delay or crackling? Can you help me, that I can help you? :)
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Sound Problem With VirtualBox -5.2.x branch

Post by ChipMcK »

Did you try 'circumvention' by
BillGermany wrote:In the Linux client, add the following to /etc/modprobe.d/alsa-base.conf:
options snd-intel8x0 ac97_clock=44100
You'll need to restart your sound system (or reboot) before it takes effect.
listed earlier?
JanDE
Posts: 5
Joined: 24. Jun 2018, 09:15

Re: Sound Problem With VirtualBox -5.2.x branch

Post by JanDE »

I refer to my last investigation:
JanDE wrote: 1. Audio is not in sync. The more audio you play, all the more the delay grows up.
2. Audio output skips or has short clicking noises, after a while.
3. Audio output is distorted. After a while audio is crackling for some minutes. Often it repairs itself, but after the next while this phenomenon occurs again.
The issues 2. and 3. are apparently gone if you downgrade to VB 5.1.30. But the issue 1. (audio out of sync) persists in VB 5.1.30. I checked it with a fully fresh installation of windows 10 64 Bit Host and a fresh Windows 7 64 Bit guest. If I downgrade the host VirtualBox to 5.0.40 the sync problems disappears on this new machine (like on my first configuration). The guest is still the same.

So my conclusion: A fully functional system with audio support requires VirtualBox 5.0.40.

If you need more tests or information, please advise me what to do. Me and many others will be happy, if this issue is fixed in one of the next versions.
Post Reply