Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shairport-sync & ArchLinuxArm 7 with wifi on Raspberry Pi2 #2

Open
nhwebforge opened this issue Jun 27, 2015 · 2 comments
Open

shairport-sync & ArchLinuxArm 7 with wifi on Raspberry Pi2 #2

nhwebforge opened this issue Jun 27, 2015 · 2 comments

Comments

@nhwebforge
Copy link

Hi

After literally hours of trial and error (I'm not a Linux guy but love playing with my Raspberry Pi's), I have FINALLY got shairport-sync running on ArchLinux Arm 7 on my Raspberry Pi 2. I used numerous different sources to find all the different workarounds. I documented it and would like to give something back to the community... so here it is. I hope it's helpful.

Disclaimer: I'm sure I could have been a lot more efficient in my approach but I hope this will serve as a starting point for others.

  1. RaspberryPi.org are not offering an ArchLinux image for Arm7 yet but some friendly guy has created his own and kindly put it on Mega.co.nz for all to use. Download the ArchLinux Arm 7 image for Raspberry Pi 2 from here: https://mega.co.nz/#!2JZS0CqD!KxlXr9B6URZ79zTP23vKVdrdOGVOYIeasjcjcBMoPzo

  2. Write to a formatted SD card (at least 4GB) using Win32DiskImager.

  3. Put in Pi and boot up with a wired network connection.

  4. SSH into the Pi (User: root, Password: root).

  5. Update ArchLinux, setup WiFi, install dependencies, install Shairport-sync using the ArchLinux package (EliaCereda/shairport-sync-PKGBUILD), set to run at startup. Here's the process I used:

Update:
# pacman -Suy

Install required packages for this process:
# pacman -S dialog wpa_supplicant base-devel git

Use wifi-menu to connect to wifi (note, it's a lowercase letter o at the end, not a zero):
# wifi-menu -o
Choose wireless access point SSID, enter key and give the profile a name.

Enable the wireless profile:
# netctl enable YOUR_PROFILE_NAME_CHOSEN_IN_PREVIOUS_STEP
For example, wlan0-my_wifi

Reboot:
# reboot
Unplug Ethernet while rebooting - you'll be on wifi!

ArchLinux won't let you use makepkg as root so I did this:
# sudo passwd nobody
and Create password for user 'nobody' - I chose "nobody".

Add user "nobody" to sudoers
# EDITOR=nano visudo
Move down to "User privilege specification" and add "nobody ALL=(ALL) ALL" after "root ALL=(ALL) ALL". Exit, save.

Next, create a directory and set the required privileges:

# mkdir /home/build
# chgrp nobody /home/build
# chmod g+ws /home/build
# setfacl -m u::rwx,g::rwx /home/build
# setfacl -d --set u::rwx,g::rwx,o::- /home/build

Move to that directory:
# cd /home/build

Clone the shairport-sync package for ArchLinux:
# git clone https://github.com/EliaCereda/shairport-sync-PKGBUILD.git

Move to the newly created directory:
# cd shairport-sync-PKGBUILD

Make the package:
# sudo -u nobody makepkg -sfi

Enable avahi-daemon to start on boot:
# systemctl enable avahi-daemon

I then made some SIMPLE conf settings to get it working (you could probably play with this more):
# nano /etc/conf.d/shairport-sync
Make the following changes to give your Airplay point a name:
SHAIRPORT_ARGS="-a AirPi"
(making sure to remove quotes from around the Shairport "name" if copying from elsewhere)

Get the service ready so we can run it at boot
# nano /etc/systemd/system/shairport-sync.service

Paste the following

[Unit]
Description=Shairport-sync AirTunes receiver
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service

[Service]
ExecStart=/usr/bin/shairport-sync "$SHAIRPORT_ARGS"
User=shairport-sync
Group=shairport-sync
EnvironmentFile=/etc/conf.d/shairport-sync
Restart=always

[Install]
WantedBy=multi-user.target

Enable the service to run at boot:
# systemctl enable shairport-sync

Reboot the system:
# reboot

And, you should now see your Raspberry Pi 2 as an option in your Airplay menu on your Apple device. Mine works like a charm. Note, the default output is to the audio jack.

Oh, and you probably want to remove the user "nobody" from the sudoers.

As I said, I hope this is helpful.

@gat45
Copy link

gat45 commented Dec 12, 2015

hello your link is no found

@mikebrady
Copy link

Thanks for your interest in this. I recently went through installing Shairport Sync on Arch Linux on a Raspberry Pi, which might help – see mikebrady/shairport-sync#168 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants