My Raspberry Pi Car Audio Player
A lot of people are using the excellent linux micro computer Raspberry Pi and install it in their cars. Usually they use a color screen that is touch sensitive, being able to play back video and music. But I’m only interested in high quality audio playback, being able to have all my CDs in lossless FLAC format for optimal sound quality. So a 16×2 LCD display with some buttons is plenty. I now have a working system (but not yet installed in my car.) here’s a description on how it’s built. Most of the installations I’ve seen uses the audio out from the Raspberry Pi, but it’s only 11-bit and sounds like crap. I want to use an external DAC and you can get that to work in XBMC, but only menu and music output, not films. There are some HDMI to audio converters, but I’ll rather use a quality USB DAC.
Because a Raspberry Pi is a bona fide linux computer, you can’t just cut the power when you want to turn it off. There’s a risk of corrupting the filesystem just like on your Mac or PC, so to install it into a car, you need a way to keep the Raspberry Pi powered on until the shutdown is complete. First I built my own power supply with its own micro controller to handle the shutdown. But it was large and not very elegant. But after Googling around I found a Raspberry Pi power supply specifically made for use in a car, so I immediately ordered one. There are several different versions, but they only had a 2 Amp version that plugs directly into the Micro-USB connector in stock. Preferably I would have liked the 3 Amp version with two standard female USB connectors on it, but who can wait? And the 2 Amp version manages to drive a SSD drive in an USB enclosure, the HiFimeDIY USB DAC and the AdaFruit 16×2 character LCD display with keypad without a problem so I’m a happy camper.
I’m going to use a flat cable for the display so I can hide the Raspberry Pi, power supply and DAC and only show the display. I probably have to experiment with the length of the cable and see if there is any interference, but hopefully it will work. And I obviously will need to find an enclosure for the display.
Ignition and shutdown
There are three different leads from the power supply. One is for connecting directly to the car battery, one is ground and the third is for connecting to the ACC line of ignition. When the power supply senses that the ACC cable is on, it powers up the Raspberry Pi, and when you turn off the ignition and the ACC cable goes low, it sends a signal to the Raspberry Pi to start shutting down. When the Pi is shut down, another connector goes low and the micro controller on the power supply turns off the power to the Pi. You can set a timeout so the computer doesn’t shut down immediately, which is handy if you just doing a quick errand and don’t want the Raspberry Pi to have to boot up again. Very handy.
The power supply comes with a simple script for handling the shutdown and is easy to install. You can also change the script to use two of the other GPIO pins if you are using it for something else.
HiFimeDIY USB ES9023 DAC Audio card
I ordered an USB sound card that I knew worked with the SqeezePlug linux distribution. It’s called HiFimeDIY and uses an ESS Technology Sabre DAC which is a great DAC, so the sound quality is excellent.
The DAC is plugged into the AUX in on my car stereo system with a 3.5mm to RCA cable.
For handling the playback I installed the Logitech Squeezebox Server. This will handle all the maintenance of the audio files on the SSD disk. I also installed SqueezeSlave for playback.
I’ve written my own Python program that handles the communication with the server and for controlling the menu system. It’s up and running, but needs some more development to handle the display of special characters. But it’s good enough right now to use. I will put up the code on GitHub as soon as I cleaned the code up and fixed it some more.
When everything is up and running, I will make a downloadable image of my setup to make it easy for anyone to get this system working. There where some bugs in one of the Python modules that needed patching and some other stuff, so an image would be preferable so you don’t have to do all that. But I don’t want to upload something half done.
If you have questions or suggestions, write a comment.