I’d like to introduce RPiPlay, an open-source AirPlay mirroring server for the Raspberry Pi!
For a long time, I've wanted to use the Raspberry Pi (And a Zero in particular) as an AirPlay mirroring receiver. Not just the low price point makes it a great device for that purpose, it's also very portable while at the same time having a powerful graphics chip for decoding the H264 that AirPlay uses. Unfortunately though, there wasn't any suitable software available for the Pi. I would even have paid a few dollars for a commercial solution, but the only option (rplay) seems to be mostly abandoned and doesn’t work with recent versions of iOS.
I had also done research on open source implementations for Linux, but couldn’t find any. So, I was hugely surprised when a few weeks ago, a routinely scan of GitHub actually yielded a very promising project: A GitHub user by the name of dsafa22 had published a fully open-source AirPlay mirroring server for Android in C.
Over the last few weeks, I ported this project to the Raspberry Pi, utilizing OpenSSL and the Pi’s hardware acceleration to speed it up until it was reasonably fast for the Pi.
So, we now have a fully open source AirPlay mirroring receiver for the Raspberry Pi! At this point, the screen mirroring is working pretty well on any Raspberry Pi I tested (Pi Zero and Pi 3B+). Unfortunately, the FDK AAC decoder library used for decoding the AAC audio signal is running purely on the CPU (the Pi doesn’t have HW acceleration for audio decoding),
As for the supported sender devices, any iOS device running iOS 9 or newer is supported. From a little research into the AirPlay protocol and its version history (The protocol has evolved far more over time than the recent release of AirPlay 2 would imply), I was able to find that the implemented protocol is considered a legacy protocol by iOS devices running iOS 12. This might mean the current implementation could break with any new iOS release. I added my version history research to the project’s README file.
Now that we have a working starting point, I’m hoping for support from the great Raspberry Pi community for improving and maintaining the project. As mentioned above, I’m expecting Apple to break the implementation with any new iOS version. As I’d like to stress, I also only did the port to the Raspberry Pi, all the hard work was done by dsafa22 (huge kudos to him!). Although I’ll give my best to contribute what’s within my limits of ability, I’m hoping for help from enthusiasts more familiar with multimedia programming and reverse-engineering.
The project can be found at https://github.com/FD-/RPiPlay. Build instructions and more information are available there.
I’m looking forward to this becoming a joint project of the fabulous Raspberry Pi community!