diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..bd81da8 --- /dev/null +++ b/Readme.md @@ -0,0 +1,59 @@ +# RPiPlay / deploy + +## What's this? + +Sync iOS screen to a Raspberry Pi running OSMC. +It's based upon a fork from https://github.com/FD-/RPiPlay. + +## In which environment does it work? + +The binary is successfully tested with a Raspberry Pi 3 A+ running +OSMC version 2020.10-1. +It runs properly in parallel with OSMC as long as there's no video +or audio playing from OSMC. + +To circumvent the slow render capabilities it uses the "low latency" +mode of RPiPlay. This may result in occasional loss of video frames +but keeps audio uninterrupted. + +The systemd file will run on any systemd-enabled Raspbian derivate, but +the precompiled binary is specifically built for OSMC. + +## Prerequisites + +- Raspberry Pi attached to a TV/screen via HDMI. +- OSMC + The precompiled binary is linked against some OSMC specific libraries. +- Mobile device with iOS version >= 9. +- Both systems have to be connected to the same WiFi. + WiFi must allow device-to-device connections (which sometimes is disabled). + +## Installation + +If your Pi is attached to the internet the easiest way to download +the files is from a shell at the device. +You could use wget or curl to download files. + +1. Download the script `install_libs.sh` + and sudo run it: + `sudo sh ./install_libs` + +1. Download the precompiled binary `rpiplay` from the latest release + https://github.com/rumpelrausch/rpiplay-bin/releases + Modify it to your liking (change the `NAME` variable). + Move it to `/etc/systemd/system`. + +2. Download the systemd service file. + Sudo move it to /usr/local/bin. + Apply read/execute rights: + `sudo chmod a+rx /usr/local/bin/rpiplay` + +3. Enable and start the systemd service: + `sudo systemctl enable rpiplay` + `sudo systemctl start rpiplay` + +## Usage + +At your iOS device, open the screen sharing dialog (not the instant AirPlay redirection). It should list the `rpiplay` instance with the name you assigned +within the systemd service file. Tap that name, and after a few seconds your +TV should show the iPhone / iPad screen. \ No newline at end of file diff --git a/install_libs.sh b/install_libs.sh new file mode 100644 index 0000000..7dc8e88 --- /dev/null +++ b/install_libs.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sudo apt install libavahi-compat-libdnssd1 libavahi-common3 libavahi-compat-libdnssd1 libblkid1 libdbus-1-3 libffi6 libgcc-8-dev libgcc1 libgcrypt20 libglib2.0-0 libglib2.0-dev libgpg-error0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 liblz4-1 liblzma5 libmount1 liborc-0.4-0 libpcre3 libplist3 libselinux1 libssl1.1 libstdc++6 libsystemd0 libuuid1 rbp-userland-osmc rbp2-armmem-osmc zlib1g diff --git a/rpiplay.service b/rpiplay.service new file mode 100644 index 0000000..41dfac9 --- /dev/null +++ b/rpiplay.service @@ -0,0 +1,12 @@ +[Unit] +Description=AirPlay mirroring service +After=network.target + +[Service] +Type=simple +Restart=always +Environment=NAME="My OSMC installation" +ExecStart=/usr/local/bin/rpiplay -n ${NAME} -b auto -a hdmi -vr rpi -ar rpi -l + +[Install] +WantedBy=multi-user.target