Mopidy + PulseAudio + ncmpcpp

Oof. This was a real trick and a little bit of guess work, but I finally got the visualization in ncmpcpp to work with mopidy and pulseaudio. First, I found the ArchLinux ncmpcpp config walkthrough. That seemed really straight foward… but it didn’t work for me. After some dicking around, I figured it’s probably because I use mopidy instead of straight mpd. Okay… so I found this post. That seemed like it almost worked, but just failed in a slightly different way (mostly the ‘second command’ just didn’t work). Finally, I found this post on existence trainer and ncmpcpp would act like it was playing and the visualization worked, but I couldn’t hear anything. Shit. So close. Well let’s see. It’s gotta be in this line under :

output = tee name=t t. ! queue ! autoaudiosink t. ! queue ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mpd.fifo

Everything looks good except this autoaudiosink business. What is that? I don’t really know, but let’s just try something.

output = tee name=t t. ! queue ! pulsesink t. ! queue ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mpd.fifo

Hm. No connection. Well hang on just a sec! I had to add the line ‘output = pulsesink server=127.0.0.1’ a while back, let’s see what that does.

output = tee name=t t. ! queue ! pulsesink server=127.0.0.1 t. ! queue ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mpd.fifo

Restart mopidy with ‘sudo systemctl restart mopidy’ and I’ll be damned. It all works. Okay. Now I can get back to my life. Phew.