Welcome to Nemo, the networked music box. The project describes my efforts to create a homebrew UPnP renderer, with the following goals:
- Produce a simple device, to extend my already existing stack of Technics gear (no need yet for an AV Receiver)
- Give the Raspberry Pi I have lying around a home
- Brush up my electronics skills
UPnP stands for Universal Plug and Play and is the technology that underpins DLNA , which lets you stream media between devices connected in your home network, and that comes with virtually any audio or TV equipment you can buy nowadays.
UPnP has a notion of three logical components:
- a Media Server holding audio, video, photo's, etc.
- a Renderer, reproducing content from the Media Server
- a Control Point controlling the Renderer and the Media Server
The following diagram illustrates the UPnP context in which Nemo operates. A smartphone app (the Control Point) selects a song from the music library on the NAS (the Media Server) and instructs Nemo (the Renderer) to reproduce it.
Nemo is conceived to fulfill the following needs:
- Repurpose my Raspberry Pi model B
- Good enough audio quality, but at least better than what's built-in
- The ability to gracefully power off the device (orderly shutdown of the system software). Although the Pi draws relatively little power, it makes no sense to leave it on 24/7 when not in use.
- Feedback about operational state (booting, playing, powering off). A user should be able to see what's going on.
- RCA jack to connect it to standard stereo equipment.
- LAN connection to easily hook it up to the home network (no Wi-Fi configuration troubles)
The following schematic illustrates the high level hardware design.
The following components are used:
RPI - Raspberry Pi 1 Model B. The core of the system.
PWR - 5V power supply.
DISP - A 128x64 pixel OLED for displaying song and artist information
SNDC - An external USB sound card, for "good enough" quality audio
PWR_RES - The power and reset button.
LED_RGB - Status LED for system feedback, with support for red, yellow, green and purple colors. A single RGB LED neatly fulfills this function.
PMC - The Peripheral Management Circuitry, interfaces with the RPI and is responsible for handling the LEDs, power button and the OLED display.
For this project to succeed at all, the Raspberry Pi will have to have a basic setup that allows playing music through UPnP / DLNA. My acknowledgements go to Stephen C. Phillips, who provides a thorough explanation on his website on how to achieve this.
The following diagram shows how the main software components are deployed.
gmediarender is the core program written by Henner Zeller that handles the UPnP discovery and media rendering. Instructions for getting it to work can be found on Stephen's website, mentioned earlier.
upnp-display is based on upnp-display (also by Henner). It listens to UPnP events and displays them on an LCD. It has been modified in order to publish to inbus.
inbus is a minimalistic message broker that allows messages to be distributed among different components.
power observes the GPIO keys and sends the events to inbus.
display subscribes to events coming from power and upnp-dispay and renders the currently playing song and artist on the OLED display. It uses luma-oled by Richard Hull to do the rendering.
Please refer to Installation for more details.
The casing is a repurposed digital receiver, sourced in the local thrift store for a couple of euros.
After ripping out the main board, I was left with very handy power supply, providing a clean 12V and 5V, or so I thought. Unfortunately it made a strange clicking noise. Digital electronics is a nice enough challenge; messing around with high voltage circuitry is a bridge too far. That's why I opted for the high-tech solution currently in use.
... or almost. The lid has to be screwed on, but that's it.
The wires from the PMC are connected to the LED, OLED and PWR button, mounted on top of the detachable front panel.
Thanks for reading!