MPD on Vero4k+

I am having a hard time porting the setup I was using on my RPi3+ to the Vero4k+. The setup was as follows:

  • MPD server running, outputting audio to an SPDIF output (addon soundcard)
  • OSMC KODI running, outputting audio to the HDMI output

This setup is great since I can switch my stereo to the MPD stream and listen to i.e. some web radio even if the TV is not switched on. Also I can listen to music while browsing on the KODI and switch to the HDMI audio input on the receiver when the playback starts.

When I try to port the setup to the Vero4k+, I run into multiple issues.
First, MPD does not work with the system out of the box since the audio drivers seem to cause issues with ALSA. Did some search, found this: Audio driver bug → with pulseaudio, MPD should work. So I installed pulseaudio and it does work, kind of.

But: I cannot assign KODI to only use the HDMI output and MPD to only use the SPDIF output (I wouldn’t mind if I could assign MPD to the analog and KODI to the HDMI&SPDIF either if this should be an hardware issue). And what makes this completely unusable: When MPD is working, KODI cannot output any sound anymore and vice-versa. The audio output seems to be blocking.

Now, an easy solution would of course be to have a Pi running just for the MPD stuff, but that would be kind of senseless since this way I would have two devices consuming power, one of which would idle without a reason.

Any suggestions on how I can solve this?

There are two different outputs (one is PCM; one is HDMI) in Kodi. Have you tried changing this?


It looks like this config may negate the need to use PulseAudio:

# Audio Output ################################################################

resampler {
                plugin "soxr"
                quality "high"
                threads "1"

audio_output {
                type            "alsa"
                name            "alsa"
                device          "hw:0,0"
                dop                     "no"
                buffer_time     "5000000"


Yeah, I have tried to switching output options in Kodi, but both settings (with alsa: AML-M8AUDIO,HDMI | (AML-M8AUDIO Analog),PCM) output to both hdmi and SPDIF, possibly I can disable analog output that way.

With pulseaudio, the options in Kodi change, I only have a nondescriptive pulse sink and a AML-M8AUDIO device - possibly this can be improved with adjusting pulseaudio setup to provide different sinks, but I am not very deep in the whole Pulseaudio thing.

Based on this, I would halfway suspect that the SPDIF output is just extracted directly from the HDMI lines.

When I try your suggestion for MPD config that should negate the need for PulseAudio, I cannot start MPD, but get the following error message:
config_file: unrecognized parameter in config file at line 229: resampler
-> MPD apparently does not know the resampler parameter set.
This is a bit confusing since the official MPD documentation also states that resampler should work. I also tried installing the libsoxr packages just in case, but that also did not help. Possibly this is related to the apt repository MPD version being at 0.19.21 and thus outdated?

Okay, came a bit further: With a freshly compiled MPD (v0.21.5), the settings posted above work and I did manage to get audio output without pulseaudio. So the 0.19.21 MPD version is in fact outdated and does not work with the specified parameters, a newer version does work.

However: I cannot get the audio to only be on analog out or SPDIF. I only have the choice of SPDIF+HDMI+Analog (hw:0,0) and SPDIF+HDMI (hw:0,1)

Besides not being able to split audio output from HDMI and [SPDIF|ANALOG] so I can have KODI on one output, MPD on another, I also have the problem that as soon as MPD starts up, it kills all sounds from KODI. So basically, as soon as MPD is up, KODI has no sound until MPD is killed and KODI is restarted. That of course defeats the whole purpose of having MPD running in the background.

So to put it short: The issue here seems that the Vero4k+ is not able to provide separate sinks for HDMI, SPDIF and ANALOG output and the driver implementation seems to not work with multiple applications trying to output sound at the same time.

The I2S is mixed in; but you have two dedicated outputs and they are non blocking.

There is a mute HDMI option if you’re getting audio through HDMI when you don’t want it to.

From what I read online, the issue with MPD not working without parameters only occurred in new versions of MPD. Some searches suggest a downgrade is the solution; but it sounds like this has now been fixed properly.