Screen Mirroring with Raspberry Pi
A while ago I bought a Raspberry Pi (model B). It is quite a nice gadget that is rather popular, so you can easily use it for whatever project you might have in mind that needs a low-powered embedded computer. I use it to share my external USB drive contents via samba, as bittorrent client and as a DLNA server. I followed this guide, and it works like a charm. But I wanted to do more…Looking at the nice quality of the videos on my DLNA-capable TV, I wondered if it was possible to use the TV as a mirrored or second screen for my MacBook. Screen mirroring via wifi is actually trickier than it seems! There aren’t many established protocols so far. Here’s what I found out:
- Even if I thought it would be possible to stream the content of my screen via DLNA, apparently it isn’t that easy. I don’t know the protocol well enough to know what are the exact limitations, but I couldn’t find a solution ready out there.
- I thought about installing a VNC server on my Mac and a client on the Raspberry Pi. The problem is that I don’t run X on the RPi. I tried the DirectVNC client, but it was slow and i was not able to run it in full HD. I thought about trying to install X and a fancier client, but I abandoned the idea because it couldn’t work as a second monitor anyway, and sound would not have been transmitted.
- The most obvious solution would be Apple’s AirPlay. It does exactly what I want, but the receiver should be an Apple TV or an AirPlay-ready device. And I don’t own one.
The pain with AirPlay is that it is a closed source protocol. I found out about few projects that have succeeded in making it work for video (but not screen mirroring), for example with Airplayer, used in Plex.
Then I found out about a beta software called rPlay, created by a company called VMLite. I asked to participate to the beta, so I received an email and received a license key. That means that you will have to install some proprietary software in your Raspberry Pi. I tried anyway, following the instructions from this website.
It did work out!
The resolution is good and the latency is acceptable. And it was easy to set up!
One problem was the instability of the server. In order to activate the mirroring or the second screen, you need to have access to a small menu on the menu bar:
The problem is that the menu does not show up all the time, and it is quite unreliable.
The other problem was that some applications apparently make the external monitor freeze, and sometimes rPlay crashes completely. I imagine that the fact I was running a beta version justifies these problems. But the project is not open source and it isn’t trivial to get support for it. This can be frustrating.
So for now I abandoned rPlay. I might try other options, for example contacting the AirTame guys and ask them about the sources of their project, or to try to reproduce what this guy has done with a Linux machine and UPNP.