BaReinhard's Tech Blog

A blog of various technologies, largely based around the Raspberry Pi.

Follow me on GitHub Follow me on Instagram

All-in-One Raspberry Pi Audio Receiver

Good Morning / Early Afternoon

I recently finished putting together a rather extensive project with a lot of help from ehmaes and adenbeckitt. Ehmaes created an older project that setup A2DP Bluetooth, and AirPlay in an easy to setup script for Raspbian Wheezy.

Later, Adenbeckitt updated the script to work on Raspbian Jessie. Shortly there after, I found that the script was missing a few dependencies for how I like to run Shairport-sync and didn’t completely set this up as they should of. Mainly, a few places sudo was used when it didn’t need to be.

So naturally, I forked the repo and updated it. Made sure it worked then transfered it over to GitHub since it was originally on Bitbucket. After testing it out I looked deeper at the code and began adding new features, first was the addition of using sound cards. Next, was the addition of a new volume-watcher service, luckily adenbeckitt pulled through again as he wrote the python script that the service uses. Lastly, was the incorporation of an Access Point, or Internet-less wireless network so the Audio Receiver could be installed in a car and the still would keep the functionality of AirPlay.

I remember a couple years back I actually used the ehmaes script on Jessie and setup a system to listen to my iDevice. Since it was meant for wheezy only the bluetooth functioned. For me that was enough especially because of the complete ease of installation. Didn’t have to understand pulse audio or bluetooth to listen to my music.

So this inspired me to keep it as simple as possible to keep with the spirit of the project. I’ve since done about 5-6 hours of testing making sure everything works on the latest Raspbian Jessie Image. It works with the latest update as of February 14th 2017.

Installation:

So I mentioned it being easy. How easy? You might ask. Well, once you write the image to your microSD card, I suggest adding a blank file called ssh , with no file extension inside the /boot directory. Now stick it in your pi and boot it up. From there simply connect it to an ethernet connection and ssh into it (or use a keyboard and screen).

Next just take the following steps:

sudo apt-get install git
git clone https://github.com/BaReinhard/Raspberry-Pi-Audio-Receiver-Install-Car-Install.git
cd Raspberry-Pi-Audio-Receiver-Install-Car-install
sudo ./runall.sh

The script will prompt you for the name of what you want the Device to be and then for the password for the wireless network. Next you will just sit back and wait until the install finishes. It should approximately take 20-30 minutes.

Then What?

Reboot your pi

sudo reboot

Upon booting backup you can connect to it and use bluetooth and AirPlay to stream music.

Remember this setup requires a sound card, if you don’t want to use a sound card the fix is easy.

sudo nano /etc/asound.conf

Then change the lines that read card 1 to card 0 Next

sudo nano /etc/shairport-sync.conf

Then find the section alsa just below // Backend Settings and replace the line : output_device = "hw:1,0"; with output_device = "hw:0,0"; Reboot your pi and you’re in business.

If you want to take a look at the Project at github or you want the same setup without the access point, since you will be using it in your house on your home wifi then choose the respective link:

Raspberry Pi Audio Receiver Car Installation - Code of this project

Raspberry Pi Audio Receiver Home Installation - Installation is the same just doesn’t require WiFi Password.

Anyway, I hope you find this useful and most importantly enjoy it!

-Brett

EDIT:

Update

The Repo has since moved to an updated Repo Super Simple Raspberry Pi Audio Receiver

The installation process is much easier and allows for more customization. It has integrated sound card support and a number of added features, including the ability to setup the System as a UPnP device, so that android users can connect and stream audio (Unfortunately, I don’t have an android device so I can’t test the setup in this way.) However, I am always looking for others to send me information of how things work when using with different devices.