PulseAudio crash after failed assertion: 'bq->n_blocks == 0' failed at ../pulseaudio/src/pulsecore/memblockq.c:1006, function pa_memblockq_silence()
Summary
After a recent update of my system I now encounter crashes of pulseaudio somewhat regularly. There does not seem to be a deterministic way to reproduce this, however the bug generally occurs within 10 minutes of some use-cases (see steps to reproduce). I've tracked the audio issues back to crash of pulseaudio that is reported and logged in syslog. I was not able to find any similar issues through search etc.. Let me know if I can provide any more information, I am happy to help. Thank you!
Environment
See attached file: pa-info.txt Version according to package manager is pulseaudio-16.0-1 (latest on archlinux).
Steps to reproduce
There does not seem to be a single action that leads to a bug but rather a situation in which the crash occurs very regularly, generally within 10 minutes or so. In it, I've got two running audio sources: vlc and vivaldi (chromium-based web browser). The video in vivaldi is running untouched while I'm scrubbing through the video in vlc. However, the crash does not necessarily occur directly after/during a scrub in vlc. In most cases rather during a play-phase.
What is the current bug behavior?
For both audio sources, the audio cuts out.
In vlc, the video keeps playing without audio and does not recover (even when skipping to the next video in the playlist). vlc log:
# during the video in which it cuts out (repeatedly)
[0000556df74b00c0] vlcpulse audio output error: cannot write: Connection terminated
# during the next video in the playlist (repeatedly)
[0000556df74b00c0] vlcpulse audio output error: stream connection failure: Bad state
[0000556df74b00c0] main audio output error: module not functional
[00007fc7ea9324a0] main decoder error: failed to create audio output
For the browser video, the audio cuts out, the video kinda loops a second for 5 seconds or so before resuming with audio.
Using journalctl, I was able to find the following information:
Jun 14 10:47:23 tdesktop pulseaudio[21208]: Assertion 'bq->n_blocks == 0' failed at ../pulseaudio/src/pulsecore/memblockq.c:1006, function pa_memblockq_silence(). Aborting.
Jun 14 10:47:23 tdesktop audit[21208]: ANOM_ABEND auid=1000 uid=1000 gid=985 ses=2 pid=21208 comm="alsa-sink-ALC12" exe="/usr/bin/pulseaudio" sig=6 res=1
Jun 14 10:47:23 tdesktop kernel: audit: type=1701 audit(1655196443.038:201): auid=1000 uid=1000 gid=985 ses=2 pid=21208 comm="alsa-sink-ALC12" exe="/usr/bin/pulseaudio" sig=6 res=1
Jun 14 10:47:36 tdesktop systemd-coredump[21576]: [LNK] Process 21208 (pulseaudio) of user 1000 dumped core.
Module linux-vdso.so.1 with build-id b8bf8e4ef649711724c90135b4aef42b8b3e3c0e
Module module-filter-apply.so with build-id fb5da663a2b557bbed8977258b51c9106403040a
Module module-filter-heuristics.so with build-id 17973e0b55095845c2277faaf43f1fcfe1cfa0c3
Module module-role-cork.so with build-id b32f5e8373346e583b3a95e9ff66a782ceba331f
Module module-position-event-sounds.so with build-id 0dbd696879923810f76631dce0488fd70faf79f7
Module module-systemd-login.so with build-id e27fecac609b58088307ecfeb775c4b4a5d84fde
Module module-console-kit.so with build-id 91a7e068eda133a99a5c257f0e78f43a05702450
Module module-suspend-on-idle.so with build-id f88c061eadffc9e79a69aea8e90650377d22e779
Module module-intended-roles.so with build-id 1f131e643ac64f651405fb3bd026b8096077569e
Module module-always-sink.so with build-id 3aebf2b39eb87c1e6b5d2e28cd6ce087ac6ebe2f
Module module-default-device-restore.so with build-id af491c29e75a841600cde7538d45bf7b2f974af2
Module module-combine-sink.so with build-id 4bd932f44776abcc7eeaaa6749703ed07e6e27eb
Module module-combine.so with build-id 2d60b0de747cc20b89993e1aaaffd3a53cb50819
Module module-gsettings.so with build-id 1583e80737ef333fb1e4a456570823ff505160ef
Module module-native-protocol-unix.so with build-id c4024132db83b0a5d920526e97a47746e7deaf64
Module module-dbus-protocol.so with build-id 30959a5ac65b4505f95ea583dbb877d932db2fab
Module libelf.so.1 with build-id c09e357a1a3b061bf219bcfb243ca31b175e77fa
Module libgstbase-1.0.so.0 with build-id 3dfd55ec850f50565c2f52fd4ff87a3bdc094063
Module libdw.so.1 with build-id 0b01e42545607f3bf9f564f38e24664b6ca8051b
Module libunwind.so.8 with build-id e7f3b22127b00d8b14b2560df707cbbeb0134861
Module libgstapp-1.0.so.0 with build-id c651c010d56cb665a31d84b3e0d2c7a07194586a
Module libgstreamer-1.0.so.0 with build-id c2c2f0b6a554bd75134237026419b52824563564
Module libsbc.so.1 with build-id 513ac40e7b57d1bcccf325d87c77f0d238ae52a3
Module libbluez5-util.so with build-id df2f90eb03a3a354a86c2b19e72cdbf9d533dabb
Module module-bluez5-discover.so with build-id c887dc3ce8948c761e420ebb7f111da2d19d15bc
Module module-bluetooth-discover.so with build-id 6263cdb4f7d43ef023e65c8c7ccbbcc1991d21e9
Module module-bluetooth-policy.so with build-id 87ac99247613038fc5d15b60bf1ef913c4714ab0
Module libbrotlicommon.so.1 with build-id acfd597a977c8087bb6184383daae2e828a9ce42
Module libdatrie.so.1 with build-id 6fe3b6ece2c8e7d11869fa051375128d8f808f58
Module libgraphite2.so.3 with build-id ce58945ebb55b86d3a4e717b6eae29efc4720d8e
Module libicudata.so.71 with build-id 4fef196388e678deb881978139e125e20ee2d94d
Module libbrotlidec.so.1 with build-id 66c54e9301f7e102ecc1d88547e5f0e8a056fe22
Module libbz2.so.1.0 with build-id 919597c477c9b2cb9cdbb7745ed6494ac0e6da60
Module libexpat.so.1 with build-id 113bb5a3e9ad856801bfcfc029102c9bdc13d67e
Module libthai.so.0 with build-id a7ac5010b4275c49308021200d23690533952702
Module libfribidi.so.0 with build-id fe9f35ac2a0074108c8306c517793f7279bd9b37
Module libharfbuzz.so.0 with build-id c58fe082cbde02fc176e3c3663a6d81386eb5027
Module libpangoft2-1.0.so.0 with build-id c2c09f789578900f61b7fca4a4311d8b94d9a750
Module libicuuc.so.71 with build-id 633fdc0c5385d916571f6140e7a978ad0630ef55
Module libtiff.so.5 with build-id 31895d2bd133f34f0cdc2d4ac855ed838ec927b6
Module libjpeg.so.8 with build-id 8e6d3f3e8f438912b561c43b6e7f66e6e5e097d0
Module libXfixes.so.3 with build-id 0a05c7e8714522bfbdd7c0027c3e2a94965664b0
Module libmvec.so.1 with build-id 2c6aec81c79e91d66940b68be0819fdf780a976c
Module libpixman-1.so.0 with build-id d2170a3ac106c2a68597bf7910ab04b1cdd69c14
Module libxcb-shm.so.0 with build-id 828fec4d856e2710e732ea8d92c3f250c807b1c2
Module libxcb-render.so.0 with build-id b1ca498d665807ab0ccdafbe8070853efd058173
Module libXrender.so.1 with build-id 42e386d2acf3cde61081959d9671ca74acfb3edc
Module libXext.so.6 with build-id 17beadf1cb40d41ab36629db3b4eed74110678a7
Module libfreetype.so.6 with build-id f89dd5502e75aca28fb5c3ccd0dbd26fe822bfef
Module libfontconfig.so.1 with build-id 36be6951b8c1e42a7dd05684a37400fc8ef9147c
Module libpng16.so.16 with build-id 2dc0bce07f199bf983c07a05fb95a6f4af83a9b3
Module libpango-1.0.so.0 with build-id 7e27c1e46a1d958f6b16e1ba199f8bdb3f100566
Module libpangocairo-1.0.so.0 with build-id b65f507d9e33adfbd19369acef5e5a0a2422c6d1
Module libxml2.so.2 with build-id 8cdf00fa954d9a27f2f184c4d354cb14677446ac
Module libgdk_pixbuf-2.0.so.0 with build-id 5b8422ab971b1a8a8e1c43b88738d4ee217f609e
Module libcairo-gobject.so.2 with build-id 9927090dddfb180365695a8f37d1cac89463f109
Module libdrm.so.2 with build-id 658072e933ab3de11aea1408bdf4e72dd6e80255
Module libvdpau.so.1 with build-id fccd021ff13c37ebf7144d184a3250624e086f52
Module libva-x11.so.2 with build-id 0c5ca7869e7110b0e92180d5e7ddb330d6f14341
Module libva-drm.so.2 with build-id 7a02a127b38763e2ec9a2503f0ae4c3d57c20327
Module libmfx.so.1 with build-id 8b00e0305bae71b573282bfcfd4f06e76b1f1e6b
Module libva.so.2 with build-id ae5f91d7b4849e6f918da2e24825f9492c526118
Module libxvidcore.so.4 with build-id 43bc390a7842a7ca3a0302e93442ea561d7f013a
Module libx265.so.199 with build-id 4fd2d7155725df753c6b32274c442349fc05e632
Module libx264.so.164 with build-id 1ebb8708f2101bd1c95b701142163133e8dac465
Module libtheoradec.so.1 with build-id 19d321fd5455c7b7611ca9602a804b496124e06f
Module libtheoraenc.so.1 with build-id cde750f0621140f313e4ef4e5f212e662f24a38b
Module libSvtAv1Enc.so.0 with build-id e9143f88be53d2aebfa4f9249295869f09e22be4
Module libspeex.so.1 with build-id 39721dbe21b62978562c2943279f6dffbffe8946
Module librav1e.so.0 with build-id 5f8fc2c271f0d96480ab1c71447e038a66aa1c57
Module libopenjp2.so.7 with build-id 5fa7037f0c932c285735dbcd42365abe6c3abb05
Module libopencore-amrnb.so.0 with build-id a3d78948c85fa235e66549119b2f130e69af7b70
Module libmp3lame.so.0 with build-id 48c901805551a3dd58d02502c4cd67f6aa848107
Module libgsm.so.1 with build-id 1cc6240f7eaedaaac302bc7c0f64ebbeae596f22
Module libaom.so.3 with build-id 3c057fe8c5fa7033366274352148acb4dbb42728
Module libcairo.so.2 with build-id a222d042e56108d2786ece7bf291b56ba2069591
Module librsvg-2.so.2 with build-id 8c033bf594f51f48c7b2ee078fa4586ddb70513a
Module libopencore-amrwb.so.0 with build-id 28da8ed3dfca59280e835c46bd40da295dae99e2
Module libdav1d.so.6 with build-id a93560a23a7f1def734a3cf54f09eadd7c3c46e9
Module libwebp.so.7 with build-id 0add7a572705244ed810b7e722cce7da0dcfb62c
Module libwebpmux.so.3 with build-id 4232d5263a45719ba12f58ed7d8cae3a0fc887de
Module libvpx.so.7 with build-id 347ca2580a23a6da7347be245c72585415bfa8e2
Module libswresample.so.4 with build-id afca7bcb3d53246c257a67b852fc922b240fe14a
Module libavutil.so.57 with build-id 02316d81b1e1685729cedd19caebefd52d8fb986
Module libavcodec.so.59 with build-id 9b7c8f13e401225a3e10e315841d360348415f55
Module libasound_module_pcm_a52.so with build-id 64d6ef90ae34b20b92a95d8c0266be6e817da3f8
Module libblkid.so.1 with build-id 140694a62d8d4d07c6c320a501f948dd1b389d73
Module libmount.so.1 with build-id 4436aeea0cd8c01b5a77969e0531184f8b3513ce
Module libgmodule-2.0.so.0 with build-id 3b42a54783f0665e688370b6c57238c05822c50e
Module libstdc++.so.6 with build-id b3eaebcb5369487562e52dd8d016c9cd77f80c54
Module libpcre.so.1 with build-id 845483dd0acba86de9f0313102bebbaf3ce52767
Module libffi.so.8 with build-id f0a9586cf0f42d2b9971bd1065ca3a6b19f4a2c2
Module libgio-2.0.so.0 with build-id bc795ed533f1b5c20cdc8600cf855216d692087f
Module libz.so.1 with build-id fefe3219a96d682ec98fcfb78866b8594298b5a2
Module libglib-2.0.so.0 with build-id f1d15261ce1317b9003a1f0957d5a528d063f630
Module libgobject-2.0.so.0 with build-id a7dfc5c24acdbd0bcc40e3a427f917f679eef0d1
Module libasound.so.2 with build-id b72397704b745cd4f52b1234d5344d6bb6929758
Module libalsa-util.so with build-id 834c74c0de8dfd2b3caa3afc41a1c1c5c5a5b894
Module module-alsa-card.so with build-id 8f0e6641db74892f6069040c117539e453c4b28c
Module libudev.so.1 with build-id 541e6841430a5ee36134325ec0ce669c2c0b9053
Module module-udev-detect.so with build-id 633d2740637635ca9b784d15bb8c0865d603ccc7
Module module-switch-on-port-available.so with build-id e4e74d20b54b3f4837bb71767eb6f4a3890ad329
Module module-augment-properties.so with build-id 7d11dae774bb5938c784c0ebbe8b1ee8c9cd61dc
Module module-card-restore.so with build-id c3008891570f3c24a2a22c42e0d91bc92c3cbb2b
Module module-stream-restore.so with build-id 1397f9b23c6f4e0839eab8b6dad98130accf0ae9
Module libprotocol-native.so with build-id 9bc9acf74f94fbc1b97307bcad648a5b0f87f6b3
Module module-device-restore.so with build-id 3f7f5447e49eca3d4305da26c6a3a4465fa19860
Module libgpg-error.so.0 with build-id 4738b8a9478177c202cccd64e0eb65d3dea2bfae
Module libXdmcp.so.6 with build-id d864159ab0008415667db8d5f251696d75c90df2
Module libXau.so.6 with build-id 60db1eac70f819bea9d4c366603c1583067510b4
Module libgomp.so.1 with build-id 5dad42990289bea94eac11b596b80f28415a8c22
Module libpthread.so.0 with build-id 95ae4f30a6f12ccbff645d30f8e1a3ee23ec7d36
Module libogg.so.0 with build-id ca0cae30a809f10db1f16e54a23b4e5ff7b2c54c
Module libvorbis.so.0 with build-id f4e086347f6c1a66eb73cfe13974a29bd39aabca
Module libopus.so.0 with build-id 35fafc4024675e9cfe57c7d50c3965eac6bac358
Module libFLAC.so.8 with build-id d3c01b1bab8e878ff3928ba64a5817506bad1aa6
Module libvorbisenc.so.2 with build-id 2b1ce7fcdcc925bc663ebe2c1c008c0dd96e5bd0
Module ld-linux-x86-64.so.2 with build-id 0effd0e43efa4468d3c31871c93af0b7f3005673
Module libgcc_s.so.1 with build-id 0e3de903950e35ae59a5de8c00b1817a4a71ca01
Module liblz4.so.1 with build-id e63600ab23b2f6997f42fac2fa56e1f02ce159a1
Module libzstd.so.1 with build-id bd9a65f663b7f48e1427c418714eb8d005c37f71
Module liblzma.so.5 with build-id 28b40c7af8098a66af6ee093b6986b91cad7694d
Module libgcrypt.so.20 with build-id 8bf3cb884124273640de797a3e77d86c98434ea4
Module libasyncns.so.0 with build-id 3ed7e52f247b08f1dff19aef6a253ee4c5c785c0
Module libxcb.so.1 with build-id 13d677412a71468381b11092915d231f664d18d3
Module libX11.so.6 with build-id 310f8f1b8d7457d326407e0eb794353c62769b73
Module libX11-xcb.so.1 with build-id f92352eae0a30aea89d11beb22367fa985288925
Module libspeexdsp.so.1 with build-id 49f5531ba5bb2fd7a061726c580c12c682c131d3
Module libsoxr.so.0 with build-id 9e49936ed807c1e52705b88d5d71706fe11d9ed1
Module liborc-0.4.so.0 with build-id a95fb07ab70adc17bb91684e07695723aac3a4b8
Module libtdb.so.1 with build-id f2bdb5ac97b6addf2026d93b08c8d15defcd9bb8
Module libsndfile.so.1 with build-id 407b2376cac1726631e3f7360a9337901be04ec0
Module libm.so.6 with build-id 1b7296ef9fd806e47060788389293c824b09ad72
Module libc.so.6 with build-id 60df1df31f02a7b23da83e8ef923359885b81492
Module libsystemd.so.0 with build-id a220b34e873e29bb116d88be0bf11fac7089ef4d
Module libdbus-1.so.3 with build-id 7f4b16b4b407cbae2d7118d6f99610e29a18a56a
Module libcap.so.2 with build-id 21b00ab76bb16fde56fd741f07233c78069f0579
Module libltdl.so.7 with build-id c4ee3f1ba09fe34163d71ff336756fbecb6f409f
Module libpulse.so.0 with build-id aa6764cfda324d767cc969984b59c19fd353c611
Module libpulsecommon-16.0.so with build-id dcc56d745aa03fd3aba286f70b983c587c290ee8
Module libpulsecore-16.0.so with build-id 192c6f925fe533f7e9a308e34898eed8b3016b07
Module pulseaudio with build-id 841c3a24ee5dc64c1be47d61472208224f47dfb2
Stack trace of thread 21212:
#0 0x00007f436f68e36c n/a (libc.so.6 + 0x8e36c)
#1 0x00007f436f63e838 raise (libc.so.6 + 0x3e838)
#2 0x00007f436f628535 abort (libc.so.6 + 0x28535)
#3 0x00007f436fba7a2f pa_memblockq_silence (libpulsecommon-16.0.so + 0x40a2f)
#4 0x00007f436fc41a8e pa_sink_input_process_underrun (libpulsecore-16.0.so + 0x52a8e)
#5 0x00007f436fc37bb9 pa_sink_process_input_underruns (libpulsecore-16.0.so + 0x48bb9)
#6 0x00007f436fc37aec pa_sink_process_input_underruns (libpulsecore-16.0.so + 0x48aec)
#7 0x00007f436ae2d36e n/a (libalsa-util.so + 0x3136e)
#8 0x00007f436fbc2c47 n/a (libpulsecommon-16.0.so + 0x5bc47)
#9 0x00007f436f68c54d n/a (libc.so.6 + 0x8c54d)
#10 0x00007f436f711874 __clone (libc.so.6 + 0x111874)
Stack trace of thread 21211:
#0 0x00007f436f705d3e ppoll (libc.so.6 + 0x105d3e)
#1 0x00007f436fc2e6aa pa_rtpoll_run (libpulsecore-16.0.so + 0x3f6aa)
#2 0x00007f436ae2d46f n/a (libalsa-util.so + 0x3146f)
#3 0x00007f436fbc2c47 n/a (libpulsecommon-16.0.so + 0x5bc47)
#4 0x00007f436f68c54d n/a (libc.so.6 + 0x8c54d)
#5 0x00007f436f711874 __clone (libc.so.6 + 0x111874)
Stack trace of thread 21218:
#0 0x00007f436f705d3e ppoll (libc.so.6 + 0x105d3e)
#1 0x00007f436fc2e6aa pa_rtpoll_run (libpulsecore-16.0.so + 0x3f6aa)
#2 0x00007f4362e3fb6d n/a (module-combine-sink.so + 0x3b6d)
#3 0x00007f436fbc2c47 n/a (libpulsecommon-16.0.so + 0x5bc47)
#4 0x00007f436f68c54d n/a (libc.so.6 + 0x8c54d)
#5 0x00007f436f711874 __clone (libc.so.6 + 0x111874)
Stack trace of thread 21208:
#0 0x00007f436f705d3e ppoll (libc.so.6 + 0x105d3e)
#1 0x00007f436faed4f3 pa_mainloop_poll (libpulse.so.0 + 0x1d4f3)
#2 0x00007f436faf742c pa_mainloop_iterate (libpulse.so.0 + 0x2742c)
#3 0x00007f436faf74e1 pa_mainloop_run (libpulse.so.0 + 0x274e1)
#4 0x000056251b75e21a main (pulseaudio + 0x821a)
#5 0x00007f436f629290 n/a (libc.so.6 + 0x29290)
#6 0x00007f436f62934a __libc_start_main (libc.so.6 + 0x2934a)
#7 0x000056251b75f955 n/a (pulseaudio + 0x9955)
ELF object binary architecture: AMD x86-64
-- Subject: Process 21208 (pulseaudio) dumped core
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: man:core(5)
--
-- Process 21208 (pulseaudio) crashed and dumped core.
--
-- This usually indicates a programming error in the crashing program and
-- should be reported to its vendor as a bug.
What is the expected correct behavior?
pulseaudio does not crash and does not lead to audio cutting out while watching videos.
Thanks in advance!