To run airplayer, you'll need:
- Python (>= 2.6)
- Pip
- A compatible DNS-SD library (such as Avahi), on OSX this is installed by default
On Linux you'll have to install a compatible DNS-SD library.
For Ubuntu you should install the following package:
apt-get install libavahi-compat-libdnssd1 python-setuptools python-pip python-dev
yum install python-setuptools python-pip python-devel avahi-compat-libdns_sd
On other Linux distributions you'll have to install a similar package.
There are no specific requirements for Mac OS X.
For Windows you'll have to install the Bonjour SDK.
Get it at http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20737
.
(beware, login required).
Make sure all requirements are met (see above) and execute the following command:
pip install -r requirements.txt
This will install the required python packages airplayer depends on. Note that, depending on your system configuration you might need to execute this command with sudo rights.
Edit settings.py to reflect your setup. For help, read the comments in settings.py.
Airplayer can be run in the foreground in your terminal and in the background as a system daemon (on Linux and OS X). It is advised to first try to run airplayer in your terminal before trying to run it in the background, as it will be easier to spot (configuration) issues when running in the foreground.
To run airplayer in the foreground execute:
python airplayer.py
There are scripts included to make Airplayer run in the background on Ubuntu and Mac OS X. By installing this scripts, Airplayer will also start when your computer boots.
For Ubuntu (and other Debian like systems) there's a init script included in scripts/ubuntu,
to make airplayer run as a system daemon.
You should edit the DAEMON, USER, GROUP value to reflect your setup.
Then place the file in /etc/init.d/ and make it executable (chmod +x). Also make sure the
airplayer.py file itself is executable.
You can now start airplayer in the background by executing /etc/init.d/airplayer start
.
To make airplayer start at boot, execute:
update-rc.d airplayer defaults
There's an launchd script included in scripts/macosx/ to make airplayer run in the background
as a LaunchAgent.
Edit the path/to/airplayer.py
string to match where you've put airplayer.py and
make sure airplayer.py is executable by running chmod +x airplayer.py
.
Then, place the launchd script in /Users/YOUR_USERNAME/Library/LaunchAgents/.
Make sure file permissions are set correctly by executing:
chmod 644 /Users/YOUR_USERNAME/Library/LaunchAgents/org.pwiddershoven.airplayer.plist
chown YOUR_USERNAME:Staff /Users/YOUR_USERNAME/Library/LaunchAgents/org.pwiddershoven.airplayer.plist
Now activate the launch daemon by executing:
launchctl load -w /Users/YOUR_USERNAME/Library/LaunchAgents/org.pwiddershoven.airplayer.plist
You can now start and stop airplayer by issuing the following command:
launchctl start|stop org.pwiddershoven.airplayer
Airplayer will also automatically start when you login. Logs are stored in /Users/YOUR_USERNAME/Library/Logs/airplayer.log.
See this guide, contributed by smaccona, to install Airplayer as a Windows Service and making it automatically start at boot.