LoginSignup
7
8

More than 3 years have passed since last update.

RPiPlay試してみた

Last updated at Posted at 2020-03-22

やりたいこと

ラズパイを使って、PC用のディスプレイをワイヤレスディスプレイにしたいと思います。
もう少し具体的に言うと、ラズパイをAirPlayサーバーのようにしておいて、MacやiPhoneの画面を無線でディスプレイ上に表示したいです。

RPiPlayとは

やり方を調べていたらラズパイのフォーラムでこのような記事を見つけました。

RPiPlayはラズパイ用のオープンソースのAirPlayミラーリングサーバーで、2019年5月にGithubに公開されたそうです。

これを使えばちょうどやりたいことができそうだったので、試してみました。

環境

  • Raspberry Pi 3 Model B
$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
$sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G11023
  • iPhone 8 (iOS 13.2, 接続確認用)

インストール

https://github.com/FD-/RPiPlay
こちらに記載されているように順番にコマンドを実行するだけです。


git clone https://github.com/FD-/RPiPlay.git
cd RPiPlay
sudo apt-get install cmake
sudo apt-get install libavahi-compat-libdnssd-dev
sudo apt-get install libssl-dev
mkdir build
cd build
cmake ..
make

最初にapt-getしたときに次のようなエラーが表示されましたが、
sudo dhclient wlan0を実行することで解決しました。


エラー:1 http://raspbian.raspberrypi.org/raspbian buster/main armhf cmake-data all 3.13.4-1
  'raspbian.raspberrypi.org' が一時的に解決できません

動作確認

makeが終わると、buildディレクトリにrpiplayという実行ファイルが作成されているので、実行してみまます。


$ ./rpiplay -h
RPiPlay 1.2: An open-source AirPlay mirroring server for Raspberry Pi
Usage: ./rpiplay [-n name] [-b (on|auto|off)] [-r (90|180|270)] [-l] [-a (hdmi|analog|off)]
Options:
-n name               Specify the network name of the AirPlay server
-b (on|auto|off)      Show black background always, only during active connection, or never
-r (90|180|270)       Specify image rotation in multiples of 90 degrees
-l                    Enable low-latency mode (disables render clock)
-a (hdmi|analog|off)  Set audio output device
-d                    Enable debug logging
-v/-h                 Displays this help and version information

./rpiplay -n MyAirPlay -b autoを実行します。
-bのオプションに対してautoを指定している理由は、AirPlayを使用していない時はラズパイの画面を表示させたいためです。お好みに合わせてオプションを指定してください。

あとはMacとiPhoneから無線でディスプレイに画面を表示できるのか確認します。

Macの画面をミラーリング

画面右上のディスプレイのアイコンをからMyAirPlayを選択します。

screen01.png

screen02.png

screen03.png

無事にディスプレイに画面を表示できました。

iPhoneから画面表示

iPhoneから「画面ミラーリング」をタップして、MyAirPlayをタップします。

screen04.JPG

こちらも画面に表示できました。

7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8