Raspberry Pi & DAC for Headless Audio Player
Oct 11, 2012 at 1:12 PM Thread Starter Post #1 of 19

mellomoyo

New Head-Fier
Joined
Oct 11, 2012
Posts
8
Likes
10
I know that there's been a lot of buzz around the Internet about the Raspberry Pi and all the cool things people are doing with it. I wanted to share what I've been doing with mine, making it a headless audio player. 
 
I consume music from three main sources: 
1) Purchased audio, either downloaded digitally or bought on media then ripped to my computer. All of these audio files (mp3, FLAC) exist on my home server. It's served up by samba. 
2) Spotify. I'm a premium subscriber (mobile devices + higher quality audio is excellent). 
3) Pandora - mostly for background music situations (parties, etc). 
 
Right now, I usually go iPhone > Fiio E7 DAC > Headphones or Computer > Fiio E7 DAC > Headphones or stereo. This works ok, but then I'm shuffling around devices a lot. I want one device with low power consumption that can just stay on and play music when I want to. I don't need it necessarily, but it would be nice to have a little monitor showing the time and what's now playing. 
 
Enter the Raspberry Pi. 
 
I got my in the mail a few months ago. I just recently got around to this project (had other, non-audio-related projects to fool around with first). 
 
First task: get the DAC working. The Raspberry Pi by default uses ALSA, so I just add this to .asoundrc: 
 
 
pcm.!default {
  type plug
  slave {
    pcm "hw:1"
    channels 2
  }
}

 
...and it worked like a charm. I could play mp3s no problem through the DAC and they're sounding good! 
 
Next, I need to access my files. I installed cifs to access my samba share and mounted it. I can now play audio files with mplayer and hear them through the DAC. However, I really need a better music player. 
 
Enter mpd. 
 
There are a TON of guides online on how to make a killer mpd setup. I personally use ncmpcpp as the client. The Raspberry Pi specific part of the setup is this: 
 
 
audio_output {
        type            "alsa"
        name            "default"
        device          "hw:1" 
}

Make sure that is in your mpd.conf, otherwise it will play out through the onboard audio, which isn't the greatest. 
 
So now we've got mpd playing the media on my home server. What about Spotify? Pandora? 
 
For Spotify, I'm using Despotify (http://despotify.sourceforge.net/). I just cloned the most recent version with SVN and followed the instructions on their site to install all the correct dependencies. It works great and sound coming from it sounds decent (I think it's probably 128 or 192 kbps). 
 
For Pandora, pianobar (http://6xq.net/projects/pianobar/) is in the Raspbian repository, so after a simple apt-get install pianobar, you're off and running. This works well, too. 
 
 
Coming in the mail today will be my 3.5" monitor to display a clock and what's currently playing (hopefully without X? We'll see...)  Any questions? Let me know. I'd love to help any fellow Raspberry Pi-ers where I can. I can also take and post pictures if anyone is interested. 
 
Dec 20, 2012 at 1:37 PM Post #2 of 19
First of all I would like to thank you for this post and to say hi to everybody.
 
I also bought a Raspberry Pi and I would like to build a small hi-fi system that enables me to listen to my music wirelessly using AirPlay.
 
The idea is to connect the RPi (running AirPi) to an amplifier and that's pretty much it.
The problem is that the 3.5mm jack gives you crappy quality because of PWM (from what I could understand on other forums).
 
Possible solutions should include:
 
Since I need to connect the RPi to an amplifier (i was thinking about a t-amp to keep everything as small and portable as possible), I would like to go for a solution that doesn't require another power supply.
 
I am a total noob for what matters Linux, do you have any suggestion or consideration?
 
Thanks,
Andrea
 
Jan 2, 2013 at 12:55 PM Post #4 of 19
Quote:
Hi,
 
Have you done anything further with your RaspberryPi project? I'm curious to see how it goes.

 
It's been going great! I haven't done anything audio-wise lately. I have added a webcam and usb missile launcher (like this guy - http://itr8r.tumblr.com/post/31840231144/raspberry-pi-retaliation ). 
 
My next task is to create some 'button controls'. I bought one of these - http://www.adafruit.com/products/1110 and plan to use the 5 hardware buttons to control the audio - back, vol up/down, play/pause, fast forward and display the current artist/album on the LCD. I will be sure to update that post when I get there! 
 
Feb 13, 2013 at 5:12 PM Post #8 of 19
I am also looking forward to try the Rasberry Pi music server with a DAC. There seems to be a music server project already available at Squeezeplug which could be installed and used with a DAC! Haven't started with the project yet but if somebody tries it out do add your impressions!
 
Feb 24, 2013 at 4:37 AM Post #9 of 19
Hi guys, super noob to this so I'm going to have to ask slowly... I just recently got a RPi from my dad and I'm trying to turn it into a headless audio player. I just got wheezy, what do I do next? So sorry but I'm a quick learner and willing to learn :)
 
Feb 28, 2013 at 7:56 PM Post #10 of 19
hi folks,
 
i have just set up a raspberry pi  based system for my car.
 
raspberry pi with squeezebox server hosts a 1TB laptop sized hard drive via usb.
raspberry pi has fixed IP address and runs headless (access via ssh on my laptop for setup/test)
ethernet from raspberry pi to logitech touch media client.
logitech touch with 'unofficial' app that enables USB output (up to 24/192) feeding Meridian Explorer usb DAC.
line out of DAC to AUX IN of car stereo.
 
works great and after i get my car stereo dealer to give me a few interfaces on the dash, all but the logitech touch will be in the glovebox,
logitech touch connects to +5v, usb and ethernet via interfaces to be installed on dash.
 
i'll put up pictures if anyone is interested.
 
Mar 2, 2013 at 8:48 AM Post #11 of 19
I'm also using my RPi as a headless music server (via an ODAC) with pianobar and MPD. For a couple of weeks now I've almost only listened to Pandora (with pianobar), really became a big fan :)
 
In case someone is interested I'm writing an Android app to remotely control pianobar, see https://play.google.com/store/apps/details?id=com.pianobar.remote and http://raspberrypiserver.no-ip.org/pianobar_pandora_remote_control.html for setup instructions. Works on every Linux computer so there's no need for an RPi specifically.
 
Mar 24, 2013 at 10:39 PM Post #13 of 19
Excellent stuff, last month I was just asking on other forums how the above could be achieved but with one extra function to be able to rip CDs to FLAC or MP3, store and play them back, is that possible with ease? Usb dvd drives are easy enough to come by...
 
I wanted to modify the CD player from my hifi system you see, so it matched. Gut it, and fit something along the lines of a Pi, Dac, 1tb drive, cd player and screen.
 
My worries are controlling it, and dealing with 1tb's worth of music. How does everyone get on with finding what music you want to play? Is making/playing back playlists possible? Searching work ok? Obviously setting up playlists and album layouts before can make things easier.
 
Can basic functions be controlled via just a remote? Could it be setup to search for albums/files from just a remote? Phone style numbers/alphabet on a remote.
 
Some pictures/more details would be great.
 
How would someone go about getting audiophile sound quality from this? Is a good USB dac enough? Or would a sound card/box giving a digital out into a dac be a better option?
 
Mar 25, 2013 at 11:13 AM Post #14 of 19
yes, digital out to a good dac makes a difference.  i use Logitech Touch usb out to a meridian explorer DAC...........great great sound.
 
search and navigate functions are then on the Logitech.
 
Jun 2, 2013 at 3:53 PM Post #15 of 19
It is interesting topic. I use RPi also as a headless media server. I am planning to use USB DAC and stream music over HDMI for now.
 
I use my own media player program, but I got stuck in playing music with sample rate over 48Khz. I saw some post claiming that Linux kernel needs to be recompiled with enabling 24/192. I do not know why this sampling isn't used by default. I am still not comfortable with kernel compilation, so if somebody can suggest reliable procedure and proven records that RPi plays 24/192 after kernel recompilation it gives me more enthusiasm.
 
In case someone is interested I'm using music-barrel available at sourceforge.
 

Users who are viewing this thread

Back
Top