The basics

After building speakers, my first mechanism for playing music was to stream music directly from my phone to a Chromecast unit, which I hooked up to my DSP (Digital Signal Processor) via an analogue jack.   This works somewhat well, but it requires me to store all my music on my phone, and the signal is "over processed" in the sense that the Chromecast unit converts the digital signal to analogue, the DSP then converts the analogue signal to a digital signal, which it then splits to various analogue signals for the eight different speaker channels.  Other problems are that the music is being streamed over your local network so it is susceptible to lags and any troubles your local network might have. 

I wanted to both store the music at the stereo, and to take out that extraneous analogue to digital conversion.  

One common solution is a headless Linux box.  This is a small Linux box that typically has no monitor.  Often they are quite minimalist.  The Raspberry Pi is a popular option.  I went with a slightly more elaborate Shuttle XS35.  This is the kind of computer you see in grocery check-out kiosks.  It has a big heat sink and is well ventilated, so it doesn't need a fan.  I've got a solid-state drive in it (they typically do not come with hard drives, but they have slots for them) so the unit has no moving parts at all.  So it makes no audible noise.   It has a graphics adaptor, wifi, usb 3.0 ports.  Everything I needed.   My DSP is the miniDSP 4x10 which takes a USB input via the USBStreamer.  

Typically what people do is set up the Music Player Daemon (MPD) on their headless Linux box.  You can "drive" your music player via a cellphone application.  I have MPDroid on my Android phone.  On writing this article I tried to look up MPDroid only to discover Google removed it from their Google Play service.  There are plenty of other MPD controllers on Google Play, though, for example, MPD Remote

This forum will mostly be about setting up the Linux box.  There are many possible ways of configuring a headless linux box to use MPD.  Perhaps the three most typical are:

These are the drivers or sound servers the operating system uses to interface with the sound card, or in my case, USB Audio device. 

Jack is designed for situations where one wants low-latency, and an ability to quickly switch between multiple interfaces.  Typically this is something like a recording studio situation.  Pulseaudio is the kind of thing a modern operating system wants: a convenient highly thread-safe interface that can take many audio outputs, mix them and present a unified front both to the end-user and to the applications running on the operating system. 

ALSA is different.  At its heart it is designed to be a low-level and highly configurable driver for audio cards.  It stems from Linux users being frustrated with waiting years for soundcard developers to create drivers.  So they created a uniform one-driver-fits-all solution.   The great thing about ALSA is that whatever sound device you have, you can find a way for ALSA to use it, and use it properly.  You can readily ensure that your sound is minimally processed.  ALSA has what is called the ability to deliver "bit perfect audio" meaning you can send exactly the signal you want to your digital signal processor, processing the signal.  Pulseaudio, on the other hand, offers no such guarantees. 

So I decided to use ALSA.  The downside to this, is ALSA is famously poorly documented.  And (as far as I know) nobody had used the miniDSP through ALSA before.  Well, likely people have done it, but my Google-fu indicates they did not documented their accomplishments on the internet.  

So to control my music, the flow diagram goes like this:

MPDroid on my cell phone ---Home Network---> mpd on the headless linux box sitting on the stereo, using ALSA ---usb connection--> USBStreamer --optical toslink connection--> miniDSP --RCA cables--> speakers. 

I'll create separate threads on setting up mpd and ALSA and the various complications that ensue.