In this project I turn an old stereo tuner into a high end Pi-based streaming music player.
A music streaming player takes audio files like MP3 and flac from a network location (like a NAS) and plays them back as digital or analog audio. The player can be connected to an audio amplifier, receiver or powered speakers. Although you could use a smart phone or computer to do the same thing, a streaming player is a dedicated device that doesn't tie up your other equipment when you want to play music. It is often sold as a standalone audio component to use with a high end audio system.
However, these dedicated audio streamers can come at a high price. If you are handy with a Raspberry Pi, you can replicate many of the features of these high end streaming devices but at a fraction of the cost. One item usually lacking from such DIY streamers is the physical case and controls. With this in mind, I set out to build a Pi-powered streamer using the case and controls from an old stereo tuner. That way, I could benefit from the low cost DIY build and stack it with my other standard sized stereo components. It's also convenient to have front panel buttons to play a playlist or pause the music.
For the streaming player software I decided to use the open-source moOde Audio project because it has an easy-to-use API and many customization features. The moOde API will be used to drive the alphanumeric LCD, and also to change functions based on the front-panel button presses.
Gathering the partsFor the hardware, any Raspberry Pi 4 should work well, however the more RAM the better. I used a 4GB version which performs well. There are many options to get quality audio out of the Pi. You first need to decide if you want digital or analog output. If you want analog out, you'll need a DAC HAT such as the Raspberry Pi DAC Pro or a more expensive one for those that can hear the difference (debatable, but not getting into that here!)
If you already have a DAC or an amplifier/reciever with one built-in, you can simply get a digital audio output board like the HiFiBerry Digi2 Pro. Since I'm using an amplifier with a built-in DAC, that's the HAT I went with.
FM stereo tuners from the 1990s and later can often be found in thrift stores for $5 - $15 dollars each. I looked for one that had a nice amount of buttons and space for an alphanumeric LCD display and found a Sony ST-JX411 that fit the bill.
The first step was to remove all of the boards and connectors from inside the tuner except the logic board that houses the front-panel buttons, since I wanted to reuse them. Initially I thought I would have to wire all of the buttons separately to the Pi GPIO pins. However, I was lucky enough to find the tuner's schematic diagram online that showed how the switches were wired in a matrix. That way I could just read row and column values reducing the number of wires needed from 17 to 11.
After removing the existing vacuum fluorescent from the tuner's logic board, I was able to attach the new alphanumeric LCD in its place. A "LCD Backpack" is used to convert the LCD's many pins to just the four needed for SPI connection to the Pi. Normally, I would solder the LCD backpack to the back of the display, but there was no room, so I used ribbon cable to extend the display's wires to a separately mounted backpack.
I used a small proto board as a way to connect the logic board's wires to the Pi using some headers and female-to-female jumper cables. Finally, I used the panel mount items in this project's parts list to extend the Pi's power, USB, Ethernet, and HAT output to the tuner's back panel.
Since moOde has an API to control most functions, I wrote some Python code to call the API based on the buttons that are pressed. To drive the display, I use a moOde feature called "LCD updater" which runs a Python script whenever moOde's state changes. I modified this script to call my code that updated the LCD screen with artist name, file info, etc...
I'm using moOde's stock image and installing Docker on it so that my code runs in containers, thus isolating them from any of moOde's code. My container runs a Flask API that listens for requests from the moOde LCD updater script.
I have made my code available on Github so you can use it as a guide for creating your own streamer. There are also more details, parts lists, and installation tips in the repository. Although many tuners will vary in design and circuitry, hopefully you can use this guide as a template for a similar project.
Network music streamers can be a nice addition to your audio setup, and they're even more fun to use when you build them yourself!
Comments