MPD buffering between tracks/song start dropouts?

Need help with MPD?
Post Reply
Posts: 4
Joined: November 13th, 2016, 9:50 pm

MPD buffering between tracks/song start dropouts?

Post by matt_garman » January 3rd, 2017, 11:35 pm

How does MPD buffering work between tracks?

I have 0.19.14 running on a Raspberry Pi. The RPi is directly connected to a DAC via I2S. The music collection comes from an NFS mount; it is entirely 44/16 FLAC files from CD rips.

Everything generally works great, except sometimes the DAC loses I2S sync shortly after a track starts. So the new track starts, plays for maybe a second or two, then the DAC loses sync, which means no sound for about a second. It then starts playing in one channel with the other silent; then the first channel goes silent and the other starts playing; then both channels play and everything is fine until the end of the song.

This was happening rarely enough that I was prepared to live with it.

However, I was listening to one CD rip yesterday where it happened consistently on all tracks. This leaves me to believe there may be something peculiar about the files themselves?

Likewise, I see there are MPD buffering options. I have audio_buffer_size originally at the default (2048), and tried upping it to 8192. I have left buffer_before_play at 20%. Note I'm not manually changing tracks, just letting MPD naturally go from one track to the next.

At this point I'm really just looking for ideas as to what I might further investigate and tunings that might be worth playing with.


Forum team
Posts: 953
Joined: January 15th, 2013, 3:43 pm

Re: MPD buffering between tracks/song start dropouts?

Post by max » January 4th, 2017, 7:02 am

matt_garman wrote:How does MPD buffering work between tracks?
If you really want to know: MPD starts decoding the following song as soon as there is enough space in the buffer, a long time before the current song ends. When the new song really begins, MPD's buffer is full already.

(This is a simplification, and buffering is a pretty complex topic.)
I have 0.19.14 running
Before we discuss anything else, upgrade to the latest (0.19.21 currently). Many MPD releases have optimizations, and if you're using an old release, you're not using the latest optimizations. MPD 0.20 (git master) has even more optimizations, and 0.20 final will be released very soon.
Likewise, I see there are MPD buffering options.
No, no, no. Do not mess with those. They don't help with your problem. You can only make things worse by changing these settings.

Post Reply