Well, this tutorial simply follow what I did in order to create RaspyFi, on the Moebius Linux Distribution. But it can work on other Debian distros as well, please note that this tutorial is specifically tailored to the Pi.
First update:
apt-get update
apt-get updgrade
Y, then Y again
When updating process is over:
reboot
Let’s disable Ipv6, that Raspberry Pi
Just add this line at the end of l file /etc/hosts
::1 localhost.localdomain localhost
Now we can install mpd
apt-get install mpd
Y
On the Pi it usually gives some error messages, we can safely ignore them.
reboot
Le’ts create our playlist folder:
mkdir -p ~/.mpd/playlists
Now let’s edit our mpd.conf file:
nano /etc/mpd.conf
And modify the string:
bind_to_address “localhost”
in
bind_to_address “127.0.0.1″
Ctrl + x ,then Y.
If we want to store our music library on a usb storage:
Let’s see how Debian calls our drive: (formatted in fat32):
fdisk -l
Specifically for me: /dev/sda1
Let’s create the Music folder and chmod it :
mkdir /media/Music
chmod -R 777 /media/Music
mount /dev/sda1 /media/Music
Modify the fstab file with our partitions :
nano /etc/fstab
just add this line:
/dev/sda1 /media/Music vfat defaults 0 0
Ctrl+x then Y
Let’s check if everything is ok:
mount -a
If we don’t get any error message, we’re ready to go.
reboot
If we want to use a nas as storage (SAMBA)
Install samba client
apt-get install smbclient
Creating mount directory:
mkdir /mnt/nas
chmod 777 /mnt/nas
Mount the nas
mount -w -t cifs -o username=,password= //192.168.1.nasip/sharename /mnt/nas
If you’ve protected your share with password, insert them. If none password or user has been set, just leave this field empty
Check with:
ls /mnt/nas
If everything is ok, you should see your directories.
Let’s set the automount
nano /etc/fstab
Add this line in the end
//192.168.1.ipnas/sharename /mnt/nas cifs username=,password= 0 0
Check with:
mount -a
If no error appears, again, we’re ready to go
reboot
Ok, last entries in our configuration file:
nano /etc/mpd.conf
Let’s tell mpd where our music is stored:
Usb storage:
music_directory “/media”
Nas storage:
music_directory “/mnt/nas”
If you have a usb dac, let’s tell mpd to use this instead of the shitty analog out:
audio_output {
type “alsa”
name “USB Dac”
device “hw:1,0″ # optional
format “44100:16:2″ # optional
mixer_device “default” # optional
# mixer_control “PCM” # optional
# mixer_index “0″ # optional
These options can be quite different depending how debian calls your dac, but i always used that with different usb dacs and it always worked. You can try by changing in 1,0 instead of 0,1 but this is up to you. As you can see, I din’t changed everything from resampling to buffer size etc etc. This will be done in future tweaking tutorials. Anyway the quality of music reproduction with these settings is pretty awesome, so expect some minor improvements with further tweakings.
Some examples:
If you wish to enable audio buffering (and so ram reading). Uncomment these strings.
#audio_buffer_size “2048″
#buffer_before_play “10%”
If you want to send the audio stream directly to the usb dac, bypassing any software\hardware mixer. Change the string
mixer_device “default”
in
mixer_device “none”
ctrl+ x e Y
reboot
Now You should choose a client in order to control your mpd box. The best available is GMPC for Windows\Linux. Pretty simple and straightforwarding (sometimes it freezes, hope this will get solved) you can find it here. Then you can use Mpdroid or Mpod to control mpd via smartphone. These 2 clients are really good and goodlooking.
Happy music, folks!
Pingback: Raspberry Pi'yi bir Müzik Merkezi'ne dönüştürmek (MPD Kurulumu) - Raspberry Pi Türkiye Topluluğu