Free, portable AirPlay Server implementation similar to ShairPort.
Currently, only AirPort Express emulation is supported.
Before building, a number of external dependencies needs to be installed (depending on your platform).
Name | Title |
---|---|
libao | Cross platform audio library |
libavahi | DNS/DNS-SD service discovery |
autoconf | Generatinge configure scripts |
automake | Generating Makefiles |
libtool | Creating portable compiled libraries |
pkg-config | Gathering metadata of installed packages |
Using apt-get:
sudo apt-get install autoconf automake libtool libltdl-dev
sudo apt-get libao-dev
sudo apt-get libavahi-compat-libdnssd-dev
sudo apt-get install avahi-daemon
On Apple OSX, a third-party package manager such as Homebrew needs to be installed before installing dependencies.
After installing Homebrew, run:
brew install autoconf automake libtool pkg-config
brew install libao
In order to build the shairplay application, the libao audio library dependency needs to be installed - otherwise, only the library will be built.
./autogen.sh
./configure
make clean
make
Output | Location |
---|---|
Application Binary | src/shairplay |
Static Library | src/lib/.libs/libshairplay.a |
Dynamic Library | src/lib/.libs/libshairplay.0.dylib |
Both the Shairplay application and library are available as targets within a main XCode project file. Internal dependencies are registered as dependencies within this project.
./autogen.sh
./configure
make clean
XCode Project File | Location |
---|---|
Main Project | extras/xcode/shairplay/shairplay.xcodeproj |
Dependency: Crypto | extras/xcode/crypto/crypto.xcodeproj |
Dependency: ALAC | extras/xcode/alac/alac.xcodeproj |
All XCode build output is deployed the "build" folder.
After building, run:
sudo make install
The results will be located at
/usr/local/bin
(application binary)/usr/local/lib
(static & dynamic libraries)/usr/local/include/shairplay
(library header files)
Place the airport.key file in your working directory. Then, start the server with:
shairplay [options...]
If you are connected to a Wi-Fi, the server should show as an AirPort Express on your iOS devices and Mac OS X computers in the same network.
- -a, --apname=AirPort - Sets Airport name (Default: Shairplay)
- -p, --password=secret - Sets password
- -o, --server_port=5000 - Sets port for RAOP service
- -h, --help - Help
- --hwaddr=address - Sets the MAC address, useful if running multiple instances
- --ao_driver=driver - Sets the ao driver
- --ao_devicename=devicename - Sets the ao device name
- --ao_deviceid=id - Sets the ao device id
Example:
shairplay --help
You need to have the airport.key file in the current working directory when starting the server.
It is not included in the binary for legal reasons.
Component | Folder |
---|---|
Main Application & Library sources | src/lib/ |
Main Library public headers | include/shairplay/ |
Qt4 Application sources | AirTV-Qt/ |
Python bindings | src/bindings/python/ |
Qt bindings | src/bindings/qt4/ |
File | Contents |
---|---|
shairplay.c | Shairplay application |
File | Contents |
---|---|
base64.* | base64 encoder/decoder |
dnssd.* | dnssd helper functions |
http_parser.* | HTTP parser from joyent (nginx fork) |
http_request.* | Request parser that uses http_parser |
http_response.* | Extremely simple HTTP response serializer |
httpd.* | Generic HTTP/RTSP server |
logger.* | Logging related functions |
netutils.* | Mostly socket related code |
raop.* | Main RAOP handler, handles all RTSP stuff |
raop_rtp.* | Handles the RAOP RTP related stuff (UDP/TCP) |
raop_buffer.* | Parses and buffers RAOP packets, resend logic here |
rsakey.* | Decrypts and parses the RSA key to bigints |
rsapem.* | Converts the RSA PEM key to DER encoded bytes |
sdp.* | Extremely simple RAOP specific SDP parser |
utils.* | Utils for reading a file and handling strings |
File | Contents |
---|---|
main.cpp | Initializes the application |
mainapplication.cpp | Creates the tray icon and starts RAOP |
raopservice.cpp | Handles all communication with the library |
raopcallbackhandler.cpp | Converts C callbacks to Qt callbacks |
audiooutput.cpp | Takes care of the actual audio output |
All the resources in this repository are written using only freely available information from the internet. The code and related resources are meant for educational purposes only. It is the responsibility of the user to make sure all local laws are adhered to.