Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

rPlay for Linux and Raspberry Pi

rPlay turns a Linux machine into an AirPlay 2 receiver: an iPhone or iPad mirrors its screen to it over Wi-Fi, video flung from apps such as YouTube plays back natively, and you can drive the phone from the machine's mouse and keyboard. It also mirrors over a plain USB cable, with no network at all.

⬇ Download

rplay_0.5.0_arm64.deb — Raspberry Pi OS Bookworm, 64-bit

sudo apt-get install -y ./rplay_0.5.0_arm64.deb
/opt/rplay/bin/rplay

Click Start, then pick rPlay from Control Centre → Screen Mirroring.

📖 Complete Raspberry Pi guide — start here · Report a problem

This repository is for releases, documentation and issues. The source code is not public.

Raspberry Pi

Built and running natively on Raspberry Pi OS Bookworm (64-bit), verified on a Raspberry Pi 4 Model B.

rPlay mirroring an iPhone on a Raspberry Pi 4

The whole Pi desktop: the rPlay window, the live iPhone mirror at 534×1080, and the tool rail for pin, home, screenshot, record and input.

The rPlay window while mirroring

The receiver window on its own.

rPlay idle on Raspberry Pi OS

Idle, advertising itself over Bonjour as an AirPlay receiver.

Latency

Measured on a Raspberry Pi 4 Model B with an iPhone 12, software decoding, stopwatch against a running timer on the phone:

AirPlay (Wi-Fi) USB cable
Latency 40–60 ms ~480 ms
Frame rate 30–49 fps 19 fps
CPU ~1 core of 4 ~1.4 cores of 4
Resolution 534×1080 888×1920

40–60 ms over Wi-Fi is low enough that scrolling and typing feel attached to the mouse rather than lagging behind it.

On a Pi, use AirPlay rather than USB. USB delivers a near-native 888×1920 stream — 2.9× the pixels — and a Cortex-A72 cannot software-decode that in time; the shortfall shows up as latency. The same code does USB mirroring at 50 ms on an x86 PC.

What works today

  • AirPlay 2 screen mirroring from iPhone and iPad
  • Video streaming from apps (YouTube and similar), decoded on the Pi — including ad breaks, seeking and autoplay to the next video
  • AirPlay audio, with or without video
  • Control features — drive the phone from your mouse and keyboard. Pair the phone over Bluetooth and turn on Settings → Accessibility → Zoom on it. See the guide.
  • USB-cable mirroring through a separate rplay_wd daemon, so a crash there cannot take the receiver down
  • Bonjour advertising through Apple's own mDNSResponder
  • Headless operation--autostart, --usb-mirror, --no-host-prepare for a boot script

Built on the Pi from

Component Version
Raspberry Pi OS Bookworm, 64-bit
FFmpeg 5.1 (libavcodec 59.37.100), aarch64 with NEON
SDL2 2.0.22, X11 and KMSDRM
OpenSSL 1.1.1w
fdk-aac 2.0.2
libimobiledevice / libusb for USB mirroring
Bonjour Apple mDNSResponder

A full native build takes roughly 100 minutes on a Pi 4, most of it FFmpeg. The result is packaged as an arm64 .deb.

Known issues

  • Do not enable hardware H.264 decode. h264_v4l2m2m opens the device and negotiates correctly, then produces no frames — the mirror stays black — and closing that window has hard-locked a Pi outright. The driver is fine (the same stream decodes at 4.6× realtime from the command line), so this is ours to fix and it is not fixed yet. Leave RPLAY_H264_DECODER unset; software decode is what the numbers above are.
  • USB mirroring is slow on a Pi (~480 ms), for the reason above.
  • Occasional brief hiccup — a ~400 ms stall turns up roughly once every few minutes in some sessions and not at all in others. Cause not yet identified.
  • Some app content served from the phone itself does not play. iQiyi serves certain items from the handset; those fail to open and are skipped, so playback advances to the next item rather than stalling.
  • First USB pairing needs a replug, and reconnecting after an unplug can leave the mirror dead.

Pi 5 has no hardware H.264 decoder and is untested. Pi 3 is untested and is likely short of both CPU and memory.

Reporting a problem

Open an issue and include:

  1. Pi model and RAM, and the output of cat /etc/os-release
  2. iPhone or iPad model and iOS version
  3. What you did and what happened
  4. The receiver log: /opt/rplay/bin/rplay 2>&1 | tee /tmp/rplay.log
  5. /opt/rplay/bin/usb-host-services.sh status

Licence

For personal use only — free to use on hardware you own, for your own non-commercial purposes. No redistribution, resale, bundling or commercial use without written permission. Provided as is, without warranty. See LICENSE.

Status

Early, and published for a first round of testing. Mirroring, audio, control, video fling and USB all work on a Pi 4; the frame rate under software decode is the main thing being improved.

About

rPlay for Linux and Raspberry Pi: issue tracker, screenshots and release notes. Source is not public.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors