Home

Awesome

Experimental

Very quick python implementation of AP2 protocol using minimal multi-room features. For now it implements:

For now it does not implement:

This code is experimental. This receiver do not expect to be a real receiver but a toolbox for learning/debugging all airplay protocols and related pairing/authentication methods.

Latest additions:

Next steps:


Raspberry Pi 4

Install docker and then build the image:

docker build -f docker/Dockerfile -t invano/ap2-receiver .

To run the receiver:

docker run -it --rm --device /dev/snd --net host invano/ap2-receiver

Default network device is wlan0, you can change this with AP2IFACE env variable:

docker run -it --rm --device /dev/snd --env AP2IFACE=eth0 --net host invano/ap2-receiver

macOS Catalina

To run the receiver please use Python 3 and do the following:

brew install python3
brew install portaudio
virtualenv -p /usr/local/bin/python3 proto
source proto/bin/activate
pip install -r requirements.txt
pip install --global-option=build_ext --global-option="-I/usr/local/Cellar/portaudio/19.6.0/include" --global-option="-L/usr/local/Cellar/portaudio/19.6.0/lib" pyaudio


python ap2-receiver.py -m myap2 --netiface=en0

Windows

To run the receiver please use Python 3 and do the following:

cd [WHERE_YOU_CLONED_AIRPLAY2_RECEIVER]
virtualenv airplay2-receiver
cd airplay2-receiver
.\Scripts\activate
pip install -r requirements.txt
pip install pipwin
pipwin install pyaudio

python ap2-receiver.py -m myap2 -n [YOUR_INTERFACE_GUID] (looks like this for instance {02681AC0-AD52-4E15-9BD6-8C6A08C4F836} )

Tested on Python 3.7.5 / macOS 10.15.2 with iPhone X 13.3 and Raspberry Pi 4

Protocol notes

https://emanuelecozzi.net/docs/airplay2