Decoder is to slow

I use the RPI 3b+ with hifiberry dac+ pro

Sometimes the playback becomes stuttering and the mpd.log shows the Decoder is to slow message.
It happens mostly with tidal master albums/titles.
I tried some cpu governors: also performance, conservative and, on demand showed no difference.
This state is very stable: pause and play changes nothing.
To stop this issue skip to the next or previous title or skipping within the title (forward / back).

I did some monitoring on this issue with tailing volumio.log and mpd.log. I also monitored the cpu with top:
mpd uses 1.5% (tidal), 2.0% (webradio) the stuttering playback only starts on the beginning of a !new! title. The cpu is 97%idle. So the decoder to slow issue comes from the prefetching of the next title. It is independent on cpu time for mpd or volumio (both around 1.5% peak) and it stops when I skip the title (fwd, rev, next, prev).

I get it to but on long mp3 files/pod radio. Could it be network related? I Stream over wifi with pi 3b+.

Aug 25 13:59 : player: played “https://sverigesradio.se/topsy/ljudfil/podrss/7044133.mp3
Aug 25 14:24 : player: Decoder is too slow; playing silence to avoid xrun
Aug 25 14:24 : player: Decoder is too slow; playing silence to avoid xrun
Aug 25 14:24 : player: Decoder is too slow; playing silence to avoid xrun
Aug 25 14:24 : player: Decoder is too slow; playing silence to avoid xrun

A Google search indicates that this is a generic mpd problem and nothing to do specifically with Volumio.

It’s extremely annoying, though and it’s been going on for years. I’m not prone to conspiracy theories, but it almost feels like Sonos is paying someone on the mpd project to make sure that it doesn’t go away!

Simply we don’t use an up to date MPD version, we’re trying to update it in the new buster releases.

Hopefully that fixes it. This makes Volumio nearly unusable for some of us.

Just made a quick research: this seems to be still an open issue for MPD:

Yeah, I’m not convinced that this is the entire problem anyway. If this were really just a pure software issue with mpd that affected everyone, no one would be using mpd (and by extension Volumio) anymore. I wonder if I just got a bad HifiBerry DAC? I’ll try using the built-in Raspberry Pi one and see if it goes away.

Actually just switched to the Raspberry Pi’s built-in port and it seems to have exactly the same problem. Get the same thing with both my Pi3 and Pi4 (fresh install on the later). Does everyone who uses Volumio experience this? It’s incredibly annoying, because it’s not just a glitch that makes a hiccup and then goes away… you actually have to stop and restart the stream to make it work again. It seems to happen with all of the web radio streams that I listen to (Radio X, KEXP, the jazz station in San Diego, all of the BBC channels), so I don’t think it’s just an issue with a particular stream. I have wired 1000Mbs ethernet connected directly to the Pi, so I don’t think it’s a networking issue (and even if it is, mpd should recover from short network drops by itself).

I just built a second Pi 3B+ with IQAudiO Pi-DAC+ today and was getting stuttering at some points with Qobuz hi-res streams. It’s not the wi-fi bandwidth at fault. v2.777.

I never get this with my primary source Asus Tinker Board S running 2.777.

I’m having this issue with a Pi 3B+. I installed on a i5-2400, the same issue!

I’ve tried all possible combinations of buffer size and buffer before play without any luck. I switched from the external USB DAC I’m using to internal audio port, same thing.

I tried to update MPD. Not possible.

I’m trying to compile MPD but there are some dependencies I’ve been unable to fix. May be if I spend more time on this I’ll be able to compile it, but I won’t be sure if this new version will work with volumio or if the issue is actually fixed.

I think Volumio people should consider this bug as top priority. At the beginning I thought it was an issue with my hardware, but all my tests showed otherwise. And sadly, I’m not alone.

The funny part is that I bought 1 year of premium subscription and the android app​:angry::angry::angry: Why should I have to spend time fixing a software that I paid a subscription for?

1 Like

This is honestly the biggest reason that I haven’t signed up for anything premium yet.

The Volumio UI is beautiful, but if it isn’t stable underneath, then it doesn’t really work well enough for me to consider paying for it.

I confirm this is a top priority for us. We did not find a solution yet, as it presents only with some streams and under specific circumstances.

To help us with any pointers please send a log just when it happens and paste the log link in this thread so we can collect as many clues as we can

1 Like

Thanks. The only thing I really see in the logs when it happens is “player: Decoder is too slow; playing silence to avoid xrun” in mpd.log. Are there other logs I should be watching (I’m pretty sure I also checked dmesg for kernel errors), or should I be increasing debug level to get more info?

I always see the “playing silence to avoid xrun” message when the stream goes silent, but I also see it in other instances (when starting a stream, for example), where it seems to have no ill effect.

I also have this issue and as a workaround waiting for a fix I am using a simple script to watch the mpd log and restart it again. I then installed cron and run this script on reboot. Here is the script:

#!/bin/bash

while :
do
  OUT=$(tail -n 1 /var/log/mpd.log)

if [[ $OUT == *"Decoder is too slow"* ]]; then

  /usr/bin/mpc stop
fi

  sleep 1
done
1 Like

Made a quick account to anyone that finds this thread!

The solution by Johan is a great workaround for the issue, thought I’d write this up for any beginners to follow:

  1. Copy the script Johan has posted:
#!/bin/bash

while :
do
  OUT=$(tail -n 1 /var/log/mpd.log)

if [[ $OUT == *"Decoder is too slow"* ]]; then

  /usr/bin/mpc stop
fi

  sleep 1
done
  1. Login to your Volumio server via ssh (I’m assuming you still have the standard volumio user)
  2. Type and enter into console: nano ~/mpd_radio_fix.sh
  3. Paste the script into this file then save it
  4. Type and enter into console: sudo chmod u+x ~/mpd_radio_fix.sh
  5. Type and enter into console: sudo nano /etc/systemd/system/mpd_radio_fix.service
  6. Paste the below:
Description=Fix For MPD Radio Play With Volumio

[Service]
ExecStart=/home/volumio/mpd_radio_fix.sh

[Install]
WantedBy=multi-user.target
  1. Save the file and run: sudo systemctl start mpd_radio_fix
  2. It should be working! To enable it to start automatically on boot enter: sudo systemctl enable mpd_radio_fix

The cron method would also work but I find this a bit cleaner personally.

Thanks again to Johan!

1 Like

Thanks for this mini how to

Just trying it :slight_smile:

What are the new “buster releases”, could you expand on it a bit?

I get the same by simply playing flac files from USB.

it is very hard to fix as explained it occurs only in some non defined case. Unfortunately, you are in this case. I’m running several (up to 7) various volumio devices (rpi2,3,4, Asus thinkerboard, Sparky, c4, vim3l) and never met it.
Now, can you try :


or

according to to your HW

To others having this issue, are you connected via WIFI or Wired?

Thanks