Monday, January 16, 2012

Music Player Daemon

This is to deploy a HP Mini D1000 series (model 1030NR) netbook PC as a music server.
1. Downloaded the Voyage MPD Live CD linux image from the Voyage site
2. Downloaded Win 32 Disk Imager from here to my main Windows computer
3. On my main Windows computer, ran Win 32 Disk Imager and copied the iso to a USB flash drive (need to select * in the file type selection drop down in Win 32 Disk Imager file open dialog window).
4. Booted the netbook from the USB flash drive prepared in the previous step
5. Installed Voyage Linux with MPD following the Live CD installation instructions on the Voyage site (linked above).
6. Logged in as root
7. Changed the root password. For all subsequent configuration steps remember to run command remountrw before attempting to update files etc on the netbook.
8. Added ftp.us.debian.org to /etc/apt/sources.list file
deb http://ftp.us.debian.org/debian squeeze main contrib non-free
9. Connected the netbook to a router using an ethernet cable
10. Ran command apt-get update
11. Installed the firmware-b43-lpphy-installer as required for the Broadcom wi-fi card on this netbook (See this page)
12. Updated /etc/network/interfaces for a static ip. Made sure non-required entries were commented out using a # for the very first column:

auto wlan0
iface wlan0 inet static
address *.*.*.* <-- this is the ip of the netbook
gateway *.*.*.* <-- this is the ip of the router
dns-nameservers <-- specify the OpenDNS DNS servers here
netmask 255.255.255.0
broadcast *.*.*.255 <-- the last octet should be 255, first three octets as per your network
up iwconfig wlan0 essid <"essid"> <-- do not add mode parameter

13. Set up static ip for netbook on the router and restart the netbook
14. Useful commands while setting up wireless: iwconfig, ifconfig, dmesg
15. Connected USB HDD drive containing the music
16. Determined the device name using the fdisk -l command
17. Added this line to /etc/apt/sources.list:
deb http://ftp.us.debian.org/debian sid main
18. Ran apt-get update followed by installing package ntfs-config (now connected over wireless! all done while logged in as root!)
19. Edited /etc/fstab by adding this line to mount the USB HDD:
device name tab mount point directory tab ntfs-3g tab defaults tab 0 tab 0
20. Created the mount directory
21. Create a user account for mpd and add it to the audio group
22. Configure mpd as per guidance here.
23. Run command aplay -L to determine sound card properties (as shown here)

24: Edit /etc/mpd.conf as follows to force use of the Musical Fidelity V-Link always:
audio_output {
    type "ALSA"
    name "V-Link"
    device "front:CARD=VLink,DEV=0"
25. Be sure to configure a port # in the mpd.conf, you need it for the client
26. Install mpod on iphone and point it to the netbook IP and port #!
27. Needed to
do this to stabilize the wifi connection which was dropping every few minutes:
sudo touch /etc/modprobe.d/b43.conf
echo "options b43 pio=1 qos=0" | sudo tee -a /etc/modprobe.d/b43.conf
The explanation is that the QOS setting depends on the processor, for some it has to be 1:
QOS on --> Intel Core Duo, Intel Atom
QOS off --> Intel Core Solo, Intel Core 2 Duo, Intel Core i3/i5/i7, and AMD
Setting qos=0 seems to help, even though the netbook is Intel Atom. Without the setting, the connection breaks within 5 minutes. It "calls the CRDA to update the world regulatory settings" and successfully gets the information, but then drops the connection. With the setting, it is more stable. When this happens, if I do a ifdown wlan0 and then ifup wlan0 the connection is reestablished.
28. Use Putty to ssh to the netbook.
29. Tweak mpd settings (see here). Disabled the mixer completely. Doubled the values for ax_command_list_size and max_output_buffer_size
That's it!

Update Oct 2014: Edited /etc/sysctl.conf. Uncommented the following line:

        net.ipv4.tcp_syncookies=1

No comments: