Using mopidy-mpd with audio_output

I’m on macOS and trying to get visualizations to work with ncmpcpp while using mopidy (specifically for mopidy-spotify).

Is there any way to get mopidy-MPD to accept an audio_output in its config like a normal mpd.config would?

audio_output {
      type                  "fifo"
      name                  "my_fifo"
      path                  "/tmp/mpd.fifo"
      format                "44100:16:2"
    }

I’d like ncmpcpp’s visuals to be able to see the MPD’s /tmp/mpd.fifo. Any help is much appreciated.

I do see this portion in the Mopidy docs for MPD protocol but I’m not familiar with the development to know how to implement it (or if it could connect to the mopidy.conf)

https://docs.mopidy.com/en/latest/modules/mpd/#module-mopidy.mpd.protocol.audio_output

mopidy.mpd.protocol.audio_output.outputs(context)

The only other way I can think of on macOS is to pipe the audio through pulseaudio. There is a brew, however it doesn’t seem to be able to run on Sierra, and there’s little information about setup on macOS for pulse from what I can find on the web. I’m not even certain it can run on a mac since Mac uses CoreAudio.

I can’t remember what the state of this is but in theory the answer is:

[audio]
output = audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mpd.fifo

Ah, I didn’t see the advanced audio documentation until your message.

Thank you very much, Kingosticks! I really appreciate your help.
On macOS I’ve also had to add a tee gstreamer element to get the default audio output (thanks to this post). For anyone else finding this, I used:

[audio]
output = tee name=t t. ! queue ! autoaudiosink t. ! queue ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! $

Both the ncmpcpp visualizer and this cli-visualizer now work with Mopidy-Spotify on macOS.

1 Like

@brettinternet Does this still works on High Sierra ? Added your config, no errors but ncmpcpp complains there’s no /tmp/mpd.fifo file