VirtualBox

Ticket #18594 (reopened defect)

Opened 19 months ago

Last modified 2 weeks ago

Ubuntu 18.04 (guest) audio stops working (stuck) after Windows 10 (host) sleeps

Reported by: James Fade Owned by:
Component: audio Version: VirtualBox 6.0.6
Keywords: Cc:
Guest type: Linux Host type: Windows

Description

Host: Windows 10 Pro, 1809, 17763.437

Guest: Ubuntu 18.04

VirtualBox: 6.0.6

Sound card: either Intel HD or AC97.

All updates are installed. Guest additions are installed.

Problem: Ubuntu 18.04 (guest) sound works until Windows 10 (host) goes to sleep. For example, you're listening to YouTube music but after suspension the video and sound stucks forever.

Quick dirty workaround: Shutdown virtual machine, then launch again. Hot reboot doesn't work!

Resetting of pulseaudio and alsa inside the guest doesn't work!

sudo killall pulseaudio; sudo alsa force-reload;

Unloading ALSA sound driver modules: snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer (failed: modules still loaded: snd-hda-codec-idt snd-hda-codec-generic snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer).
Loading ALSA sound driver modules: snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer.

Any action inside the guest doesn't work. Only kill the guest and start again (not hot reboot!).

If audio has been playing during the getting sleep, then after system wakes up the 1 second of sound will be repeated infinitely from the guest (like a "cla-cla-cla-cla-cla-cla....").

Attachments

VBox.log Download (141.7 KB) - added by James Fade 19 months ago.
VBoxHardening.2.log Download (394.1 KB) - added by James Fade 19 months ago.
VBoxHardening.log Download (394.1 KB) - added by James Fade 19 months ago.
VBoxHardening.3.log Download (394.1 KB) - added by James Fade 19 months ago.
volume_control.png Download (61.6 KB) - added by yefkov 12 months ago.

Change History

comment:1 follow-up: ↓ 14 Changed 19 months ago by pentagonik

Can you please supply all the debug files as described here? Thanks!

Changed 19 months ago by James Fade

Changed 19 months ago by James Fade

Changed 19 months ago by James Fade

Changed 19 months ago by James Fade

comment:2 Changed 19 months ago by James Fade

New logs are attached with enabled debug audio.

Audio result (%TMP%/DebugAudioOut-0.wav): host's audio file is recorded until sleep, and file ends up on the moment of system suspension (sleep). After sleeping time there is a distorted sound from the guest (repeated part of song) and there is no sound in the file.

comment:3 Changed 19 months ago by James Fade

(VBox.log and VBoxHardening.log are replaced with new ones).

(VBoxHardening.log is the only one, there are 2 copies of the same log which I cannot delete from attachments)

Last edited 19 months ago by James Fade (previous) (diff)

comment:4 Changed 19 months ago by James Fade

Reproduced starting from Virtual Box 6.0.0.

comment:5 Changed 19 months ago by James Fade

What do you think, guys?

comment:6 Changed 19 months ago by jswami123

Anyone got the genuine answer?

comment:7 Changed 14 months ago by ewwhite

Can confirm this is still a problem. Just installed Debian 10.1.0 in a VM, setup minimally, installed chrome and found that videos would not play and audio would not work after Windows 10 resumed from sleep when VM was still open. The video not playing issues seems directly related to sound not working.

Using VirtualBox 6.0.12

comment:8 Changed 12 months ago by sr105

Additional confirmation:

  • Version 6.0.14 r133895 (Qt5.6.2)
  • Host: Windows 10 Pro v1809 Build 17763.864
  • Guest: LinuxMint 19.2 Cinnamon (Based on Ubuntu 18.04)

Workaround:

  • Shutdown VirtualBox and restart it. Shutting down the guest is not enough.

Extra information:

  • Sometimes, it seems that switching audio outputs on the Windows host is all it takes to trigger this problem. But I've just tried to reproduce that, and now I can't.
  • I'm using the default Audio settings of DirectSound and AC97.

comment:9 Changed 12 months ago by yefkov

I'm facing with the same issue.

  • Version: 6.0.14 r133895 (Qt5.6.2)
  • Host: Windows 10 Home 1909 build 18363.476
  • Guest: Windows 7 Pro SP1

Power and sleep settings in Windows 10 (host):

  • Screen: 1 minute
  • Sleep: Never

According to the settings the host system turns monitor off after 1 minute idle. The guest sound stops working after host turns on monitor again. Furthermore the video in guest system becomes slow motion. As mentioned by James Fade the last portion of sound gets looped infinitely.

Update:
It seems to me that the issue happens if Windows 10 (host) changes the active audio output device. I have a notebook with speakers, a monitor with speakers (audio over HDMI) and bluetooth headphones. If I change the output device using volume control icon in the taskbar (see image)
https://www.virtualbox.org/raw-attachment/ticket/18594/volume_control.png
the guest system audio gets redirected as expected. After few switching I can hear a light distortion of the guest system sound but, in general, it works fine. But if the active audio device is switched in another way the issue occurs reproducible. I hear either a last sound portion repeatedly or no sound at all. Under "another way" I mean e.g.:

  • the host system turns off monitor (HDMI link gets down as well as HDMI audio) and the next available audio device becomes active.
  • connecting bluetooth headphones (the headphones become active audio device)
  • disconnecting blootooth headphones
Last edited 12 months ago by yefkov (previous) (diff)

Changed 12 months ago by yefkov

comment:10 Changed 12 months ago by mgrzegor

I have observed what I suspect is the same issue.

  • Versions: 5.2.34, 6.0.14
  • Host: Windows 10 Pro v1809 (bug also observed in v1709)
  • Host audio: Stereo speakers connected to built-in Realtek ALC887 controller via analog 3.5 mm jack (i.e. no HDMI stuff)
  • Guest: Ubuntu 16.04; bug also observed in a Windows XP SP3 guest

In my case, the trigger is not host sleep (that I never do due to a BIOS bug that causes memory corruption on wake-up), but one of:

  • monitor turning off;
  • switching the Windows host to another user.

In fact, I can easily reproduce it using external tool like  Don’t Sleep to turn monitor off manually:

  • In the guest, start speaker-test to put sound on alternate channels in a loop, e.g.
    speaker-test -c 2 -r 48000 -t pink -P 12 -l 0
  • In the host, right-click the Don’t Sleep systray icon, select Monitor → Monitor Off and wait.

After a couple of seconds the sound becomes stuck and speaker-test also stops alternating the channels and does not respond to Ctrl-C until it times out (after 30 s or so).

Workaround: For me, saving and restoring the virtual machine fixes the problem.

I am not quite sure when the problem started (because initially I did not realize what was happening, or what triggered it), but it certainly started before 5.2.34; I believe it might have started with either 5.2.22 or 5.2.24.

comment:11 Changed 10 months ago by Michal

i have same problem in virtualbox 6.1.2. windows 10 locks screen and guest has no more sound

comment:12 Changed 10 months ago by nocontact

I'm experiencing the same issue with Windows 10 1909 and Virtualbox Version 6.1.2 r135662

Last edited 10 months ago by nocontact (previous) (diff)

comment:13 Changed 9 months ago by jemag

I also have this same problem with win10 host and arch linux guest. It has been going on for a while now. Losing all sounds when I lock my computer and monitor goes to sleep. Could we have some feedback on this issue?

comment:14 in reply to: ↑ 1 Changed 7 months ago by Vbc

Version: 6.1.6
Host: Windows 10 Home
Guest: Ubuntu 16.04
Sound: Windows DirectSound + ICH AC97

Workaround:

  1. reboot guest system

or

  1. sleep and wake up guest system (faster than reboot)

comment:15 Changed 7 months ago by Duuuval757

I just want to confirm that I am also having this issue. Running Windows 10 host, Virtualbox 6.1.6 r137129. Also would like to note that I only have one audio input and output device enabled in windows, all others have been disabled. Thank You

Last edited 7 months ago by Duuuval757 (previous) (diff)

comment:16 Changed 7 months ago by JaysonC

I found out that if I Machine > Pause, the VM before Windows go to sleep and come back later.. and un-pause , the audio still works. Faster then a reboot.

comment:17 Changed 6 months ago by valley.antoine

Hello, any news about this issue ? Our team works in virtual machines and it make us lose a lot lot of time to switch between windows and the VM just to voice chat.

comment:18 Changed 5 months ago by eriks

I also have this issue.

I've disabled all of the screen savers and screen locking. I'm still not sure if this happenw when my Windows box goes to sleep, but what restores it is if (in the guest) I log out and back in. Then everything works fine.

Restarting Pulse Audio did not work.

comment:19 Changed 2 months ago by delskorch

Adding my report to the list. Virtualbox guest Linux sound stops after Win 10 host screen power-off.

VirtualBox 6.1.14 r140239 Windows 10 Pro 1909

comment:20 Changed 7 weeks ago by leathan

Same problem with Win 10 Pro host using Version 6.1.14 r140239 (Qt5.6.2)

comment:21 Changed 7 weeks ago by ddemoss

Having this problem as well. Version 6.1.6, also win10 host. Any help would be fantastic, thanks.

comment:22 follow-up: ↓ 26 Changed 7 weeks ago by aeichner

Hi,

just wanted to say that we are able to reproduce the issue and are investigating it. Seems to be indeed related to changing the default output device as mentioned already. Just suspending and resuming the host didn't show any issues.

comment:23 follow-up: ↓ 27 Changed 7 weeks ago by aeichner

The testbuilds page contains an updated Windows testbuild which should improve the situation. Instead of having to restart the VM, pausing and resuming the audio stream inside the guest should be enough (e.g. reload the youtube webpage). Feedback is appreciated!

comment:24 Changed 5 weeks ago by arudnev

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in 6.1.16

comment:25 Changed 5 weeks ago by arQon

Unfortunately not. Bug is still present as of 6.1.16r140961 on W10x64 hosts. (Ubuntu 18.04 guests at least: I didn't test other kernels/guests).

Is there perhaps some additional detail required, such as a specific setting for the VM?

Last edited 5 weeks ago by arQon (previous) (diff)

comment:26 in reply to: ↑ 22 Changed 5 weeks ago by arQon

Replying to aeichner:

Just suspending and resuming the host didn't show any issues.

I can reproduce this aspect with 100% reliability. Would you like logs for that case?

comment:27 in reply to: ↑ 23 ; follow-up: ↓ 32 Changed 5 weeks ago by yefkov

Replying to aeichner:

The testbuilds page contains an updated Windows testbuild which should improve the situation. Instead of having to restart the VM, pausing and resuming the audio stream inside the guest should be enough (e.g. reload the youtube webpage). Feedback is appreciated!

This is working as described in 6.1.16 r140961 after the monitor turns off and on again. (see my configuration at https://www.virtualbox.org/ticket/18594#comment:9)

Unfortunately the issue got worse with connecting/disconnecting of bluetooth headphones. The virtual machine freezes. Not the guest OS itself. If I close VM by clicking close button(x) on the toolbar the VM quietly crashes and goes from "running" to "aborted" state.

Last edited 5 weeks ago by yefkov (previous) (diff)

comment:28 follow-up: ↓ 31 Changed 5 weeks ago by yefkov

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:29 Changed 5 weeks ago by Banana James

Please see also here: https://www.virtualbox.org/ticket/19267 It seems to be related and in my case eventually also crashed the host with BSOD. Logs included.

Workaround for me was to enable audio input for guest (i had it disabled because no input devices are connected).

comment:30 Changed 5 weeks ago by arQon

note: https://www.virtualbox.org/ticket/19686 is a dup of the original bug report here, but this ticket has since been mostly hijacked into "audio sink bugs in general" (which may or may not share root cause).

Resolution of the actual ticket here would close 19686, but this now seems to be more about restarting transient sinks and switching sinks than the original report, especially in light of #comment:22, so the opposite is no longer true.

comment:31 in reply to: ↑ 28 Changed 4 weeks ago by boxer01

Replying to yefkov:

I’m replaying here, because this ticket was linked in the change log. I have different host / guest combination as a ticket starter: Windows 10 (2004 with October 2020 patches now) is main combination, one hosts is Windows 8 and guest is Windows 7. But because somebody here already reported about Windows / Windows combination, I would like to report here.

My issue is “Audio from guest is lost after the switch of the output device of host”. It was first reported in ticket #17225#comment:55. There are also some other ticket with same problem: #19158, #18404, #18695. So the version 6.1.16 is the first version since 5.2.22, which can handle the output device change by simple restarting the audio stream in the guest. But this version has two slight issues with audio:

  1. One still has to do the manual restart of the stream; the versions before 5.2.24 handled this automatically.
  2. If OS turns monitor off for energy saving reasons, this produces a small CPU usage spike. And the spike causes desynchronization of the Vbox transmission of the guest sound to the host, just like this was described in the original ticket #17225 at the very beginning. The desynchronization can’t repair itself, so one needs to stop and start the audio stream again manually.

But all the other big issues are solved in this version, so the sound works nearly perfect.

But here even better news! Today I tested the newly available version 6.1.17 build 141128, and here everything works automatically. So there is no need to manual intervention anymore, everything happens by itself. I thank you deeply for you effort. I’ll do a little more testing with this version to report any other issues, if they should appear.

The only little issue left: in case of audio with decent bit-rate (not the 128k YouTube videos) the desynchronization, which I described before, happens randomly something like once an hour. The manual audio stream restart also helps here. It would of course be nice to correct this one. But I think it would be hard to catch this bug, especially because it’s so random and the audio debug output would be huge. Are here any other possibilities to get enough debug information about this? Or should I swallow the bitter pill and start the hour-long debug recording session?

P.S.: Thanks once again to anyone who participated in this issue correction like aeichner. Do pentagonik still works on the audio parts of Vbox?

comment:32 in reply to: ↑ 27 Changed 2 weeks ago by William Ruppel

Replying to yefkov:

Replying to aeichner:

The testbuilds page contains an updated Windows testbuild which should improve the situation. Instead of having to restart the VM, pausing and resuming the audio stream inside the guest should be enough (e.g. reload the youtube webpage). Feedback is appreciated!

This is working as described in 6.1.16 r140961 after the monitor turns off and on again. (see my configuration at https://www.virtualbox.org/ticket/18594#comment:9)

Unfortunately the issue got worse with connecting/disconnecting of bluetooth headphones. The virtual machine freezes. Not the guest OS itself. If I close VM by clicking close button(x) on the toolbar the VM quietly crashes and goes from "running" to "aborted" state.

I too am having the VM "freeze". The guest O/S is still running, but I cannot interact with it via the UI. But in my case, the freeze only occurs "sometimes" when the screen comes back online after being suspended.

As seems so typical with VBox... fix one thing, regress another! Really frustrating.

I am going back to 6.1.14, which at least doesn't completely freeze the VM!

Last edited 2 weeks ago by William Ruppel (previous) (diff)
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use