John's Musings


Yeah, Me Neither

Raspberry Pi Audio - How to get started easily

RASPBERRY PI WITH HIFIBERRY DAC PLUS INSTALLED




One of the easiest Raspberry Pi projects to make is a home audio device. But even though it's one of the easiest it probably still seems prohibitive to the non-initiated. No more. I'm going to make it as easy as I possibly can. First of all you need to buy stuff. Here's a concise list with links. Bear in mind that you probably already have a cell phone charger with a micro USB port (minimum 1 amp output) and a micro SD card that is at least 8GB in size minimum so already you can save some bucks!


Parts Required

Cost

Raspberry Pi

$35.69

SD Card 16GB

$9.99

HiFiBerry DAC+ (Pro)

$22.90 to $44.90

Charger 2.5A

$9.99


I recommend the Hifiberry Digital to Analog Converter, DAC + Pro which is what is depicted above. Note that there are other DAC's for the Raspberry Pi but I like HiFiBerry because their support is excellent.

Not only that, they make it extremely easy to configure their hardware so you can kind of plug and play by using a program called HiFiBerry Installer. At the end of the day though all that does is make the hardware work. That leaves you, the newbie, to figure out how to install and configure some audio server software which means you need to have secure shell access and some command line experience. THAT is what we're trying to avoid here.


Let's talk just a bit more about the Hifiberry Installer. If you make your SD card using the Installer it puts a script file in the Operating system which auto-detects which Hifiberry device you have. In other words the downloadable image file below WILL WORK FOR ANY HIFIBERRY DEVICE. YOU DON'T NEED TO CONFIGURE OR CHANGE ANYTHING! Sweet!


So I'm going to provide you a downloadable image that has preconfigured the HiFiberry DAC, logitechmediaserver, and a player so that all you need to do is create an on-line account on mysqueezebox.com and then add some apps. Be forewarned that some apps will require pay service such as Spotify, Pandora, or Tidal. However most streaming radio apps are entirely free and you can plug a USB drive into your Raspberry Pi and play your locally stored music.


"The downloadable image file below WILL WORK FOR ANY HIFIBERRY DEVICE. YOU DON'T NEED TO CONFIGURE OR CHANGE ANYTHING!"


DOWNLOAD MY PRE-CONFIGURED IMAGE FROM HERE (approx 1 GB in size and will begin downloading as soon as you click on it).


Once downloaded then unzip the file which reveals a file named hifiberry_raspbian.img


Then by far the easiest thing to do is to download Etcher which will write your image file to your SD card. Etcher works on Linux, Mac, and Windows. Select the file, select the drive your SD card is, and push the button that says "Flash!". Easy.




Or if you want to do it the hard way on the command line the best most concise instructions for installing Raspbian from an image file are found on the Raspberry Pi website here.


My software image is based on Raspbian Jessie Lite dated Nov 2016 and has the following details:

- Hostname = hifiberrydac

- SSH access enabled

- User name (for SSH login) = pi

- Password = raspberry

- No wifi configured, must boot to ethernet first ( I don't know your wifi SSID and Password so it would do no good to set this up)

- Hifiberry Dac + enabled and should light up (green light on top) upon boot.

- Latest (as of 5 December 2016) Logitechmediaserver

- Squeezelite player installed and appears as "HiFiBerry" in Logitechmediaserver (once accounts are created and you are logged in).


All you need to do is find the IP address of your raspberry pi. One of the easiest ways is to use a free Network app called Fing. Here's what that will look like. Note the address of 192.168.1.105



Or you can boot the raspberry pi attached to keyboard, monitor and mouse and type ifconfig after logging in with the user name and password. It'll look like this: (Note that my address below is 192.168.1.105)



Also before we tackle this Logitechmediaserver thing lets do some Pi Maintenance now that we have the IP address.


Open a terminal in Mac or Linux and type


ssh 192.168.1.105 -l pi (Use your IP address here)


if it barks at you about ssh keys type this:


ssh-keygen -R 192.168.1.105


Then login again. This makes new login keys.




Now type


sudo raspi-config


Hit enter on "expand filesystem". This will fill up your SD card. My image was roughly 2.7 GB and you probably have a 16 GB card at least. This fills the card. Expand the filesystem then reboot and login again.



While you are in raspi-config...........PLEASE USE OPTION 2 and change your User Password. Please! Do that.


NOW.......you can start configuring your Logitechmediaserver!


Go to a browser and type:


http://192.168.1.105:9000



Then create the account and add apps. A non paying app to try is TuneIn Radio.




Here's an example of my apps. Note that you can make a FREE TuneIn Radio account. You'll have to do that too if you go that route.



Once you make your account be sure to go back in to your 192.168.1.105:9000 (make sure to use your IP address here) and log into your new mysqueezebox.com account.


Once you have this set up you are done. Plug your pi in somewhere, hook it to an amp or your stereo and go to the address of your logitechmediaserver in your browser and start streaming.


After you set up your mysqeezebox.com account and log in it should look like this (depending on what apps you selected) Note that my Squeezelite player "HiFiBerry" is selected in the upper right hand corner.



Now I'm playing music from FolkAlley.com. Highly recommended!




And that's it! Easiest Linux music server you'll ever configure. Feel free to leave me comments below.


24,149