Dear Volumionauts,
Some of you have been here long enough to remember GitHub issue #1668 - “First couple of seconds of each track is always cut off with some DACs.” Filed in December 2018 for Volumio 2 and still not resolved. Open ever since. Old enough to have started primary school, learned to read, written a letter asking when it will be fixed, and received no reply.
The problem is simple. When Volumio stops playback, MPD closes the ALSA device. Your receiver loses the audio stream. When you press Play again, the receiver has to renegotiate format - channels, sample rate, bit depth - before it will output anything. That negotiation window eats the first 1-2 seconds of your track. With CEC involved, it gets worse. Much worse.
This affects HDMI AVRs, HDMI soundbars, SPDIF DACs, and certain USB DACs. It is protocol-level, not device-specific. If your equipment performs format negotiation on signal acquisition, you have this problem whether you have noticed it or not.
Kodi solved this years ago. Their “Keep audio device alive” setting sends inaudible noise to prevent the receiver from dropping the connection. MPD has supported the same mechanism natively via always_on for just as long. Volumio simply never exposed it.
Now it is exposed.
Audio Keepalive is available in the plugin store as beta.
It provides four settings, all disabled by default:
Keep audio device active - the core feature. Injects always_on “yes” and close_on_pause “no” into the MPD ALSA output block. MPD keeps the device open at all times, sending silence frames when idle. Your receiver stays locked. No more missing beginnings. No more negotiation delays.
Output buffer time - configurable ALSA buffer (default / 500 ms / 1s / 2s / 4s). Increasing this absorbs sample rate transitions and can eliminate pops and clicks on format changes. Leave on default unless you experience artifacts on rate switches.
Output period time - configurable ALSA period (default / 125 ms / 250 ms / 500 ms). Smaller values reduce latency, larger values improve stability during transitions. Leave on default unless needed.
Silence before DSD stop - injects stop_dsd_silence “yes” to play brief silence before stopping DSD playback. Prevents the burst of noise some DACs emit when a DSD stream ends abruptly.
The plugin patches /etc/mpd.conf at runtime using sentinel comments, monitors Volumio’s ALSA configuration callbacks, and automatically re-applies its patch when you change Playback Options in Volumio’s settings. On disable or uninstall, the patch is cleanly removed and MPD restarts with original behaviour. It survives reboots and re-applies after configuration changes.
Things to be aware of:
-
With keepalive enabled, MPD holds the ALSA device open permanently. This may conflict with Spotify Connect, Bluetooth audio, or Snapcast since they need their own device access. If you use these, you may need to toggle keepalive when switching.
-
Some receivers may not enter standby if they detect a continuous audio stream. That is the feature working as intended, but be aware if your receiver normally auto-powers-off.
-
The keepalive is unnecessary for 3.5 mm headphone output, most I2S DAC HATs, or analog output. No format negotiation, no problem. The buffer, period, and DSD silence settings may still be useful on these outputs.
Compatibility: Volumio 4.x (Bookworm), any ALSA output (HDMI, SPDIF, USB, I2S), Raspberry Pi 4B, Pi 5, x86. Compatible with the MPD HTTP & Icecast Output plugin. Languages: English, German, French, Spanish, Dutch, Polish.
Testing is open. This is beta. I need reports from people with HDMI AVRs, SPDIF DACs, and USB DACs that exhibit the negotiation delay. Install the plugin, enable “Keep audio device active”, reboot, and tell me:
- Does the initial play delay disappear?
- Does stop-wait-play still have the delay?
- Does skip (Next/Previous) behave correctly?
- Does changing Playback Options in Volumio settings preserve the patch?
- Does disabling the plugin cleanly restore original behaviour?
Report your receiver/DAC model, output type, and results in this thread.
Credit where it is due: @PluggedIn identified the problem clearly, provided the Kodi reference, and has volunteered as primary test pilot with an Onkyo TX-RZ50 on HDMI. The rest of you are welcome to join.
Seven years. One toggle. Sometimes the fix really is that simple.
Kind Regards,
