Network playback problems after waking from suspend

Asked by Erik on 2020-01-18

I'm running Ubuntu 18.04 LTS on my laptop (Thinkpad X1 Carbon gen3), and Raspbian Buster on a raspi 3 B+ with a Hifiberry DAC+ Pro HAT. Both are up to date with updates.

pulseaudio-modules-zeroconf is installed on both systems

On my Ubuntu system, I've enabled "Make discoverable Pulseaudio network sound devices available locally" in paprefs

On the raspi, I've set Pulseaudio to run system-wide and added the following in /etc/pulse/

load-module module-native-protocol-tcp auth-ip-acl=;
load-module module-zeroconf-publish

Everything works OK until my laptop wakes from suspend, after which the problems start:

When playing a Youtube video (in Firefox and Chrome), the video starts with picture and sound, but the picture freezes after 2-3 seconds ashowing the loading animation, and audio continues but starts to stutter.

When trying to play music through the Spotify web client, playback starts and stops after 10-15 seconds.

Playback from local sources (VLC playing a local video file) is also stuttering.

I have tried the following, but nothing helps:

    - restart browser
    - restart pulseaudio (pulseaudio --kill, pulseaudio --start) - this just ends up creating more sinks that are visible when I click on the speaker icon in my notification bar
    - log in/out of current KDE session
    - restart pulseaudio service on raspberry
    - restart raspberry

The only thing that I can do to fix sound problems is to restart the laptop.

pulseaudio --cleanup-shm on the laptop sometimes helps with the problem, sometimes it does not.

Does anybody have any idea why this is happening, or can suggest other places to ask for help? I've tried searching for similar cases, but haven't had any luck.


Question information

English Edit question
Ubuntu pulseaudio Edit question
No assignee Edit question
Last query:
Last reply:
Bernard Stafford (bernard010) said : #1
Do you have the recommended minimum system requirements ? Ubuntu 18.04 LTS
Ubuntu Desktop Edition: size is 1.9GB download.
     2 GHz dual core processor
    4 GiB RAM (system memory)
    25 GB of hard-drive space
    VGA capable of 1024x768 screen resolution
    Either a CD/DVD drive or a USB port for the installer media
What size is your Linux Swap? [for hibernation]

Bernard Stafford (bernard010) said : #2

Do you have PM-UTILS or SYSTEMD program file? You can use a partition or a file for Hibernation (suspend to disk) Example: 4GB RAM W/Hibernation 6GB SWAP.

Erik (kirenida) said : #3

I'm running an Intel i7-5600U CPU with 8 GB of RAM, 512GB SSD, my screen resolution is 2560x1440. I don't have a CD/DVD drive, but I have two USB ports, and at least one of them is 3.0.
I think my computer can run Ubuntu 18.04 without any problems :)

cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2

Bernard Stafford (bernard010) said : #4

an explanation as to why this is happening. The audio is a stream that is sent to the audio device, it is a one way communication; Awaiting no further response from the device, once the target is located and the stream is under way. As such, it is not easy to detect when the stream is broken, unlike any two way data flow, when it would be obvious that there is no longer any communication; thus after the stream is interrupted, by a suspend, the flow is halted and it looses its target. However it does not realize that this has happened due to the target location process happening only when the stream is being started; when the memory pointer is initialized.

The work around is most likely researching and re-initializing these memory locations.

Pulse Audio, it would seem, uses multiple buffers depending on the hardware, the hardware is of course the eventual target of the stream. Any one of these buffers, if they lose the pointer to the memory location, will stop playback.
This is what I found. Perhaps this might offer an explanation. Above was the only relevant thing at the link. On this link # 9 is Troubleshooting for Pulse Audio.
If this does not answer or correct the problem. Click need more information- sets question as Open again.

Can you help with this problem?

Provide an answer of your own, or ask Erik for more information if necessary.

To post a message you must log in.