Ticket #5184 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

PulseAudio fails, with ALSA crashes

Reported by: Chris56 Owned by:
Priority: critical Component: audio
Version: VirtualBox 3.0.8 Keywords:
Cc: Guest type: Windows
Host type: Linux


VBox 3.08 r53138 on
Host: Ubuntu 9.04, x86_64
Guest: Win Xp 32-bit
Kernel: 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
After a while with PulseAudio the log shows:

00:04:36.400 PIT: mode=2 count=0x2ead (11949) - 99.85 Hz (ch=0)
00:18:15.058 Pulse: Failed ctrl cmd=0 to stream: Connection terminated
00:18:15.059 Pulse: Audio input/output stopped!

When using ALSA instead the system crashes eventually.


pulse_fails.log Download (53.0 KB) - added by Chris56 5 years ago.
with pulse host audio driver
alsa_crash.log Download (37.5 KB) - added by Chris56 5 years ago.
with alsa host audio driver

Change History

comment:1 Changed 5 years ago by frank

Did you upgrade the pulseaudio daemon of Ubuntu to the last version?

Did I understand you correct that the host crashes when you use the ALSA backend or only the VMM? Please attach the complete VBox.log file.

Changed 5 years ago by Chris56

with pulse host audio driver

Changed 5 years ago by Chris56

with alsa host audio driver

comment:2 Changed 5 years ago by Chris56

1) pulseaudio (as everything else) is on the latest version, namely

ii  gstreamer0.10-pulseaudio        0.10.14-1ubuntu0.1              GStreamer plugin for PulseAudio
ii  libpulse-browse0                1:0.9.14-0ubuntu20.2            PulseAudio client libraries (zeroconf support)
ii  libpulse0                       1:0.9.14-0ubuntu20.2            PulseAudio client libraries
ii  libpulsecore9                   1:0.9.14-0ubuntu20.2            PulseAudio sound server core
ii  pulseaudio                      1:0.9.14-0ubuntu20.2            PulseAudio sound server
ii  pulseaudio-esound-compat        1:0.9.14-0ubuntu20.2            PulseAudio ESD compatibility layer
ii  pulseaudio-module-gconf         1:0.9.14-0ubuntu20.2            GConf module for PulseAudio sound server
ii  pulseaudio-module-hal           1:0.9.14-0ubuntu20.2            HAL device detection module for PulseAudio sound server
ii  pulseaudio-module-x11           1:0.9.14-0ubuntu20.2            X11 module for PulseAudio sound server
ii  pulseaudio-utils                1:0.9.14-0ubuntu20.2            Command line tools for the PulseAudio sound server

  1. With the pulse host audio driver chosen the VMM runs, but does not produce any sound.
  2. With the alsa host audio driver chosen the VMM crashes very often as soon after you log in into xp when the system triess to play the welcome sound.

However, the system might run with alsa chosen for a while. In that case the sound output is always of minor quality (sort of stumbling, crippled ...)

  1. There are no host kernel messages, neither with pulse nor with alsa.
  2. Attached you find two logs: one with pulse, shutdown possible, one with alsa, VMM crashed

comment:3 Changed 5 years ago by frank

Both the ALSA problem and the PulseAudio problem are probably related. As the PulseAudio connection starves after some time, the problem might be related to your hardware. Though the ALSA backend shouldn't crash. It would probably help us debugging the ALSA crash if you could provide a  core dump. Feel free to contact me via private E-mail at frank _dot_ mehnert _at_ sun _dot_ com. Your packages are indeed up-to-date.

comment:4 Changed 5 years ago by Chris56

I doubt, it'll be a hardware related problem, because I've seen it happen on other ubuntu machines with different sound hardware.
It may be a special problem of the way ubuntu has setup the sound system or it may simply be an AMD64 related problem.
So far I've only seen it happen on AMD64 systems.

I did a traceback. ALSA runs onto an ASSERT in
Unfortunately there does not seem to be a debugging symbol package. Very sad!
However, the assert shows, that pcm->stream is not set in pcm_pulse.c at line 361.
I personally think, it is not a wise idea by the alsa people to use assert in such a production library, rather than returning an error code.
It leads to a virtualbox crash, which is equivalent to pulling the plug on a real box!
To my opinion a real showstopper.
See the backtrace below.
Concerning the coredump: see your private mail.
One more piece of information that I noticed:
Once virtualbox has crashed, on a reboot of the host! system, the host will come up with the sound muted.

Backtrace of the VMM when hitting the SIGABRT signal (as a consequence of the assert statement):

#0  0x00007f5c5c6d5fb5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f5c5c6d7bc3 in *__GI_abort () at abort.c:88
#2  0x00007f5c5c6cef09 in *__GI___assert_fail (assertion=0x7f5c3d16a657 "pcm->stream", file=0x7f5c3d16a640 "pcm_pulse.c", line=361,
   function=0x7f5c3d16a8dc "pulse_write") at assert.c:78
#3  0x00007f5c3d169571 in ?? () from /usr/lib/alsa-lib/
#4  0x00007f5c547ce7e4 in ?? () from /usr/lib/
#5  0x00007f5c5478f922 in ?? () from /usr/lib/
#6  0x00007f5c547ceb4a in ?? () from /usr/lib/
#7  0x00007f5c3ea0db52 in ?? () from /usr/lib/virtualbox/
#8  0x00007f5c3ea078ed in ?? () from /usr/lib/virtualbox/
#9  0x00007f5c503f1ca6 in ?? () from /usr/lib/virtualbox/
#10 0x00007f5c503f1e7d in TMR3TimerQueuesDo () from /usr/lib/virtualbox/
#11 0x00007f5c5041c971 in ?? () from /usr/lib/virtualbox/
#12 0x00007f5c5044f5c2 in ?? () from /usr/lib/virtualbox/
#13 0x00007f5c5041dbe1 in EMR3ExecuteVM () from /usr/lib/virtualbox/
#14 0x00007f5c503e9149 in ?? () from /usr/lib/virtualbox/
#15 0x00007f5c5bf9610f in ?? () from /usr/lib/virtualbox/
#16 0x00007f5c5bfc3a60 in ?? () from /usr/lib/virtualbox/
#17 0x00007f5c5cf2d3ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#18 0x00007f5c5c788fcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#19 0x0000000000000000 in ?? () 

comment:5 Changed 5 years ago by frank

I've got the core dump and indeed an assertion in the libasound2-plugins pulse part is hit. Most probably the connection terminated unexpectedly but the question is why.

comment:6 Changed 4 years ago by Chris56

One can easily reproduce the crash of virtualbox on Ubuntu 9.04. Just do the following:
Choose ALSA as driver, start virtualbox, kill the pulsaudio daemon
(the ordinary user will be allowed to do it, since on Ubuntu the daemon process is owned by the user)
and produce some sound output on the guest afterwards. Virtualbox will immediately abort
(in a way as if someone pulled the plug had it been a real machine: no file system flushing etc.) Because of the non-proper error handling of ALSA (on a closed down pulseaudio daemon).
Using ALSA driver with ALSA in turn using pulse is a permanent hazard to virtualbox.

Same reason -of course- why the sound fails with the pulse driver. What the pulse code should do is, as soon as the connection has terminated, it should try to reconnect (not too frequent) and try to restablish a new connection.
This is a general problem being dependent on some other running process (which in this case is even under user control),
which might have been restarted for some reason.

The problem is that the death of the pulseaudio daemon is being triggered by starting virtualbox. The syslog will show:

Oct 28 09:45:57 dino pulseaudio[29767]: asyncq.c: q overrun, queuing locally
Oct 28 09:45:59 dino pulseaudio[29767]: asyncq.c: q overrun, queuing locally
Oct 28 09:46:00 dino pulseaudio[29767]: asyncq.c: q overrun, queuing locally
Oct 28 09:46:12 dino pulseaudio[29767]: cpulimit.c: Received request to terminate due to CPU overload.
Oct 28 09:46:12 dino pulseaudio[29767]: asyncq.c: q overrun, queuing locally
Oct 28 09:46:12 dino pulseaudio[29767]: memblock.c: Memory pool destroyed but not all memory blocks freed! 2091 remain.

and then pulse will terminate.

A way to circumvent the problem is: uninstall pulse and use ALSA driver: no problems.
9.10 is coming soon, I will check on the dying pulseaudio daemon as soon as it's out.

However, the 2 problems remain:
a) stupid ALSA code: first not reconnecting and next issuing an alert resulting in SIGABRT.
b) Virtualbox not reconnecting.
It should be possible to live with a restarted pulseaudio daemon.

comment:7 Changed 4 years ago by frank

Killing the pulseaudio daemon has the only effect that the sound output stops. Before I'm able to reproduce your crash I have to get the setup somehow working to use the pulseaudio server from the ALSA backend. I guess some special .asoundrc settings are required, otherwise ALSA would just go straight to the hardware.

comment:8 Changed 4 years ago by Chris56

Absolute standard Ubuntu 9.04 sound setup. No changes to the installed sound system whatsoever! No .asoundrc. virtualbox uses ALSA which in turn uses pulse (see the traceback above).

comment:9 Changed 4 years ago by frank

Still relevant with VBox 3.2.10?

comment:10 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use