Ok. Here we go. First of all you have to know there are EASIER easier ways to do this. This isn’t about easy. This is about having a lean, mean operating system that is lightweight, fast, highly configurable and easy to update.

First we want to get and install Arch Linux for Raspberry Pi. The official Pi website has an Arch Download but it seemed like it was a couple months behind the official Arch ARM release, so I grabbed that. Get it here. Make sure to click the tab that says “Installation” on the page.

It’s really simple. You download the image (img) file and flash it to an SD card. No need to format the SD card or anything. Just insert. Follow the instruction on that page. I have a Mac and here’s how I did it.

Download the file and go to your Downloads folder

Double click the file to extract the zip.

Now open a terminal and type

diskutil list

Determine which disk is your SD card. Just look for the one that is 8 gb in size or whatever size card you have.

Mine is /dev/disk3

now type

sudo dd if=

Now drag your file into the terminal. Keeps you from having to type the whole path

Now add the following to the end of that:

of=/dev/rdisk3 bs=4m

Hit enter, type in your password when prompted and wait 10 minutes or so. Nothing will happen in the terminal screen but it is writing to the SD card.

When it is done, just eject the card and you are ready to boot your Raspberry Pi to Arch Linux. It’s that simple.

But before we do that we’re going to expand the partition on your SD card to use the whole device. Right now you only have a 2gb partition. Not enough to install a whole bunch of stuff. Lets add a swap partition too to help with memory management. This will make things go smoother, especially if you have to compile your media server later in the tutorial.

Hopefully you have a computer that has some partition software. If you do not you can download a bootable CD ISO image of something called SystemRescueCD. You can boot your computer using this CD you made and it has a program called GNU Parted or what we call “gparted”. I have gparted on my linux laptop so we’ll use that. See all that empty space?

BE AWARE THAT YOUR SD CARD MAY NOT BE /dev/sdb AS IN MY EXAMPLE HERE. BE CAREFUL NOT TO ERASE THE HARDDRIVE ON YOUR COMPUTER. NOTICE MY DRIVE SAYS 7.46 GiB. I KNOW THIS IS MY SD CARD WITH ARCH ON IT.

Right click your 1000 MiB partition and select “New” (My screenshot got chopped a bit but you can still see it)

Make a primary partition and select “linux-swap” as the file system.

Now lets stretch /dev/sdb5 to use all that previously empty space. Right click on it and select “Resize/Move”

Strech it out by grabbing the arrows again and hit “Resize/Move”

Now go back to the main screen and hit “Apply” Probably take a minute or so and then you are done.

Now lets activate the swap partition.

Now hook your Pi up to ethernet, a monitor, keyboard and mouse. I use a wireless keyboard and mouse with a USB dongle.

Boot linux and get to a prompt.

user name = rootpassword = root

Lets do the swap partition first

type

blkid

Notice my swap partition is /dev/mmcblk0p3. Yours COULD be different.

Now type

swapon /dev/mmcblk0p3

Now to make it work at every boot lets modify our /etc/fstab file.

add this

/dev/mmcblk0p3 none swap defaults 0 0

CNTL key + X

Y to save

Enter to write the file to /etc/fstab

Time to move on to other things now.

Soon as you are logged in as root change your password. Security and all..........

passwd root

follow the prompts to type your new password twice.

now type

ifconfig

retrieve your IP address under eth0

Mine was 10.0.1.109

now type

systemctl start dhcpcd

systemctl enable dhcpcd.service

This starts ethernet and the second command enables it at boot.

Now ping something to make sure you are up. Google servers are always good and outside your network.

ping 8.8.8.8

If it says “Network is Unreachable” you need further help

If it returns ping data you are golden. Hit Ctrl + C to stop that and then type.

pacman -s openssh

If you have issues with pacman you may have to enable a mirror or establish a key. Should just work though. If it doesn’t,........email me.

OpenSSH is a program to operate a secure shell so you can control the pi from another computer. Say Y to install it. So if you are so inclined you can disconnect the monitor, keyboard and mouse or just keep going.

If you do go the openssh route go to another computer with a terminal on the same network and type

You can now log in as root and do all of the rest of this from the comfort of your laptop.

Now from your prompt lets do some housekeeping.

Okay time to set the time.

Type

timedatectl status

timedatectl list-timezones

timedatectl set-timezone Asia/Tokyo

Asia/Tokyo is me. Set yours to where you are.

Now set the time.

if you don’t have ntpd type

pacman -S ntp

now type

ntpd -qg

That should set your system time. Now you have to make sure it happens at boot. NTP that is.

timedatectl set-ntp 1

Time is set. Add a user.

Okay I’m adding the user John.

Type this:

useradd -m -g users -G wheel -s /bin/bash john

Now type

passwd john

And set your password.

Now if you want to log into a graphical interface do this. If you are content to operate your computer via ssh you DO NOT NEED a graphical interface and can ignore this. Most people will want this though I think. Note that I have chosen LXDE as my graphical environment. You can change that to XFCE or something if you want but we’re following my directions and I like LXDE.

pacman -Sypacman -Supacman -S lxde xf86-video-fbturbo xorg-xinit

so if you are hooked to a monitor you can type

xinit /usr/sbin/lxsession

to start your graphical environment.

Now comes the fun part. Time to add Logitech Media Server. This is going to take a while. Recommend doing this before going to bed so you can let it compile overnight. On a non over clocked pi it took me about 6 hours.

HOWEVER YOU CAN TRY TO USE MY COMPILED PACKAGE FIRST ........Go here and download my package file

Try installing it by typing.

pacman -U logitechmediaserver_armv6h.pkg.tar.xz

Then

systemctl start logitechmediaserver

If it works YOU ARE GOLDEN. Now enable it to start at boot. Then skip to the line below the asterisks a little further down the page *****************************

systemctl enable logitechmediaserver.service

If it doesn’t work you need to build it and follow the directions below.NOTE: All pacman commands must be done as root or su. All other commands should be done as your user unless otherwise required.

makepkg -Asc --asrootIt took a LONG time to compile. About SIX hours. Once compiled then you need to install. Makes a file called logitechmediaserver-7.7.3-2-armv6h.pkg.tar.xzpacman -U logitechmediaserver-7.7.3-2-armv6h.pkg.tar.xz

Now you’ll want to start it and enable it at boot (as root)

systemctl start logitechmediaserver

and / or

systemctl enable logitechmediaserver.service

************************************************************* PICK UP HERE IF MY PACKAGE INSTALL WORKED

Now open a browser and type

youripaddress:9000 (10.0.1.109:9000)

if you are hooked directly to a monitor keyboard and mouse you can type

localhost:9000

I did notice that it took a full minute or so for LMS to become available. If you can’t connect type

top

and look for slimserver.pl

That means it is running. Give it another minute if you see slimserver.

If you did everything right it will list your output devices when you type this at a terminal (make sure you sill super user):

squeezelite -lNotice I have my HiFimeDIY DAC plugged in. That’s the output source I want to use. Now we have to specify that device, give the player a name, and tell it where to find your Logitech Media Server. Easy money.

squeezelite -0 front:CARD=DAC,DEV=0 -n ArchRaspPi -s 127.0.0.1

squeezelite is the command, dash o is our output source, dash n is the name I gave it, and dash s is the server. The server resides on the same computer so you can use the localhost IP address of 127.0.0.1. If you have a server on another computer input that number. If you have one server somewhere you can even leave the dash s off completely and that puts it in auto discovery mode. It’ll find it provided it is on the same network.

Now that’s cool. Lets go to our server and see if we have a player.

There it is. Upper right hand corner shows our player RaspArchPi. You did it. However it may or may not play correctly you may need to add some dependencies. This is the “official” dependencies list however it is from Debian Wheezy. This is Arch

libasound2 libflac-dev libfaad2 libmad0

********These SHOULD do the trick. If they don’t let me know and I’ll investigate further.********

pacman -S alsa-lib

pacman -S libmad

Now the last thing you’ll want to do is to make it start at boot so you don’t have to type that long squeezelite command every time. There’s a lot of different ways to do this and if you Google enough you’ll find a nice script to start and stop squeezelite.

Way too complicated for me. As long as the computer is on I want the server running and I want it up on every boot. No need to finesse this too much. Brute force works here.

Save this file anywhere you want to. I saved mine in my home directory in a folder called “Scripts”. And I named it squeezelite_start.sh

Now go to top

top

and find the squeezelite process and as root kill it. Or just reboot.

See the top entry? To kill squeezelite (as root) type

kill 503

which is the process number.

Now go to a terminal and type (remembering to use your path)

/home/john/Scripts/squeezelite_start.sh

The terminal should say

Squeezelite.....

As that was the echo command I gave it. Notice in the script I told it to sleep for 10 seconds too. For some reason it just would not stay running if immediately launched. So I gave it a delay.

Now lets set this to start at boot.

Type

VISUAL=nano crontab -e

Add the following line

@reboot /home/john/Scripts/squeezelite_start.sh

hit

CNTL key + X

Y (to save)

Hit Enter to write to crontab

reboot

YER DONE. TEST IT.

ADDENDUM

I had some issues with wifi that I finally resolved.

Basically to set up wifi you type

wifi-menu -o

it will scan your networks and then make a profile after you put your password in. I named my profile “wlan0”

So then you enable it by typing

netctl enable wlan0

and sometimes it would work at boot and sometimes it wouldn’t. I put the wifi dongle on a powered hub and it worked better but not completely

Then after an exhaustive search I figured out two network services running at once is bad for business. Early in the tutorial I enabled dhcpcd.

So I turned it off

systemctl disable dhcpcd.service

And then I rebooted and it was fine. Then I shut down and put the wifi dongle back in the Raspberry Pi along with the DAC and then rebooted. Worked perfect. Did it three more times just to make sure it persisted. It did. Working perfectly.

So now what I have is a free standing Raspberry Pi with an Edimax Wifi dongle in the upper port and the USB DAC in the lower port. I use a 2.1 amp generic iPhone 5 brick for a power source and use a Y cable 3.5mm to RCA to connect it to my stereo. I primarily use the services Spotify, Pandora, and TuneIn Radio to output to my stereo.