Skip to content

Commit

Permalink
Updated license information
Browse files Browse the repository at this point in the history
  • Loading branch information
FD- committed May 7, 2019
1 parent e434a6e commit 0e952e3
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 1,167 deletions.
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,17 @@ The goal is to make it run smoothly even on a Raspberry Pi Zero.

# State

Screen mirroring and audio works. The GPU is used for decoding the h264
video stream. The Pi has no hardware acceleration for audio (AirPlay uses AAC),
so the FDK-AAC decoder is used for that.
Screen mirroring and audio works for iOS 9 or newer. Recent macOS versions also seem to be compatible. The GPU is used for decoding the h264 video stream. The Pi has no hardware acceleration for audio (AirPlay uses AAC), so the FDK-AAC decoder is used for that.

Both works fine one a Raspberry Pi 3B+. Unfortunately, it seems the Pi Zero
is too slow for decoding audio at a reasonable speed.
In order to get audio decoding fast enough for the Pi Zero, we likely have
to use a different AAC decoder library.
Both works fine one a Raspberry Pi 3B+. Unfortunately, it seems the Pi Zero is too slow for decoding audio at a reasonable speed. In order to get audio decoding fast enough for the Pi Zero, we likely have to use a different AAC decoder library.

By using OpenSSL for AES decryption, I was able to speed up the decryption of
video packets from up to 0.2 seconds to up to 0.007 seconds for large packets
(On the Pi Zero). Average is now more like 0.002 seconds.
By using OpenSSL for AES decryption, I was able to speed up the decryption of video packets from up to 0.2 seconds to up to 0.007 seconds for large packets (On the Pi Zero). Average is now more like 0.002 seconds.

If you are seeing long playback pauses, make sure the DUMP flags are not active.
Disk IO can slow down the whole program when dumping to files.
If you are seeing long playback pauses, make sure the DUMP flags are not active. Disk IO can slow down the whole program when dumping to files.

There still are some minor issues. Have a look at the TODO list below.

Please note RPiPlay might not be suitable for remote video playback, as it
lacks a dedicated component for that: It seems like AirPlay on an AppleTV
switches to a standard AirPlay connection when video playback starts, thus
avoiding the re-encoding of the video.
Please note RPiPlay might not be suitable for remote video playback, as it lacks a dedicated component for that: It seems like AirPlay on an AppleTV switches to a standard AirPlay connection when video playback starts, thus avoiding the re-encoding of the video.
For details, refer to the [inofficial AirPlay specification](https://nto.github.io/AirPlay.html#screenmirroring).

# Building
Expand Down Expand Up @@ -68,7 +57,7 @@ At the moment, these options are implemented:

The code in this repository accumulated from various sources over time. Here is my attempt at listing the various authors and the components they created:

* **dsafa22**: Created an [AirPlay 2 mirroring server](https://github.com/dsafa22/AirplayServer) for Android based on ShairPlay. This project is basically a port of dsafa22's code to the Raspberry Pi, utilizing OpenMAX and OpenSSL for better performance on the Pi. All code in `lib/` with a header crediting `Administrator` is dsafa22's work. License: unknown
* **dsafa22**: Created an [AirPlay 2 mirroring server](https://github.com/dsafa22/AirplayServer) for Android based on ShairPlay. This project is basically a port of dsafa22's code to the Raspberry Pi, utilizing OpenMAX and OpenSSL for better performance on the Pi. All code in `lib/` with a header crediting `Administrator` is dsafa22's work. License: GNU LGPLv2.1+
* **Juho Vähä-Herttua** and contributors: Created an AirPlay audio server called [ShairPlay](https://github.com/juhovh/shairplay), including support for Fairplay based on PlayFair. Most of the code in `lib/` originally stems from this project. License: GNU LGPLv2.1+
* **EstebanKubata**: Created a FairPlay library called [PlayFair](https://github.com/EstebanKubata/playfair). Located in the `lib/playfair` folder. License: GNU GPL
* **Jonathan Beck, Nikias Bassen** and contributors: Created a library for plist handling called [libplist](https://github.com/libimobiledevice/libplist). Located in the `lib/plist` folder. License: GNU LGPLv2.1+
Expand All @@ -80,7 +69,7 @@ The code in this repository accumulated from various sources over time. Here is

# Contributing

I'm not planning to regularly maintain this project. Instead, I'm hoping this project can be improved in a community effort. I'll fix and add as much as I need for personal use, and I count on you to do the same!
I'm afraid I won't have time to regularly maintain this project. Instead, I'm hoping this project can be improved in a community effort. I'll fix and add as much as I need for personal use, and I count on you to do the same!

Your contributions are more than welcome!

Expand Down Expand Up @@ -131,4 +120,4 @@ iOS 11.4 added AirPlay 2 in 2018. Although extensively covered by the media, it'


From captures of the traffic between an iOS device running iOS 12.2 and an AppleTV running tvOS 12.2.1, one can see that the communication on the main mirroring HTTP connection is encrypted once the handshake is completed. This could theoretically be part of the new AirPlay 2 protocol. The AppleTV running tvOS 12.2.1 identifies as AirTunes/380.20.1.
When connecting from the same iOS device to an AppleTV 3rd generation (reporting as AirTunes/220.68), the communication is still visible in plain. From the log messages that the iOS device produces when connected to an AppleTV 3rd generation, it becomes apparent that the iOS device is treating this plain protocol as the legacy protocol (as originally introduced with iOS 9). Further research showed that at the moment, all available third-party AirPlay mirroring receivers (servers) are using this legacy protocol. Given Apple considers this a legacy protocol, it can be expected to be removed entirely in the future. This means that all third-party AirPlay receivers will have to be updated to the new (fully encrypted) protocol at some point.
When connecting from the same iOS device to an AppleTV 3rd generation (reporting as AirTunes/220.68), the communication is still visible in plain. From the log messages that the iOS device produces when connected to an AppleTV 3rd generation, it becomes apparent that the iOS device is treating this plain protocol as the legacy protocol (as originally introduced with iOS 9). Further research showed that at the moment, all available third-party AirPlay mirroring receivers (servers) are using this legacy protocol. Given Apple considers this a legacy protocol, it can be expected to be removed entirely in the future. This means that all third-party AirPlay receivers will have to be updated to the new (fully encrypted) protocol at some point.
3 changes: 3 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ add_library( play-lib
${DIR_SRCS}
)


set($ENV{OPENSSL_ROOT_DIR} "/usr/local/opt/openssl@1.1/")
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@1.1/")
find_package(OpenSSL REQUIRED)

target_link_libraries( play-lib
Expand Down
16 changes: 13 additions & 3 deletions lib/byteutils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
//
// Created by Administrator on 2019/1/10/010.
//
/*
* Copyright (c) 2019 dsafa22, All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/

#include <time.h>
#include "byteutils.h"
Expand Down
16 changes: 13 additions & 3 deletions lib/byteutils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
//
// Created by Administrator on 2019/1/10/010.
//
/*
* Copyright (c) 2019 dsafa22, All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/

#ifndef AIRPLAYSERVER_BYTEUTILS_H
#define AIRPLAYSERVER_BYTEUTILS_H
Expand Down
16 changes: 13 additions & 3 deletions lib/mirror_buffer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
//
// Created by Administrator on 2019/1/29/029.
//
/*
* Copyright (c) 2019 dsafa22, All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/

#include "mirror_buffer.h"
#include "raop_rtp.h"
Expand Down
16 changes: 13 additions & 3 deletions lib/mirror_buffer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
//
// Created by Administrator on 2019/1/29/029.
//
/*
* Copyright (c) 2019 dsafa22, All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/

#ifndef MIRROR_BUFFER_H
#define MIRROR_BUFFER_H
Expand Down
Loading

0 comments on commit 0e952e3

Please sign in to comment.