Skip to content

Commit

Permalink
feat: contains Readme, prereq install script and systemd service defi…
Browse files Browse the repository at this point in the history
…nition
  • Loading branch information
rumpelrausch committed Dec 30, 2020
0 parents commit 2344757
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions install_libs.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions rpiplay.service
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2344757

Please sign in to comment.