Monday, May 5, 2014

Running Rplay on Raspbmc for Airplay Mirroring

I'm sure you can find many other posts about installing and running rplay in raspberry pi. If you haven't heard about rplay, this amazing software is developed by company called Vmlite, that gives us possibility to experiencing airplay mirroring without having Apple TV (but, of course, you still have to own an iOS device :D) by install it on small computer Raspberry Pi. You can check here if you want to know more about this amazing little device.

On many other posts, rplay have to be installed on raspbian, a debian-based linux distro customized for Raspberry Pi. In my situation, since I only have small-size SDcard (4 GB), I can't installed raspbian because it needs you to have at least 8 GB SDcard size. And, I also would like to use raspbmc (XBMC based) to be a media centre and powering up my old CRT TV. So, this post is pure notes of my experience. Let's start :)

I assume most of you who read this post already have Raspberry Pi, and already installing raspbmc on it and using it for many purposes.

1. From Raspbmc dashboard, go to Power Icon on bottom left, then choose EXIT:

2. Immediately press ESC on keyboard (you need to have keyboard attached to Pi, doesn't matter if it's a USB, bluetooth or wireless one), when you saw notification box "Press ESC for command line)

3. When you already in CLI and prompted to login, just input 'pi' as username and 'raspberry' for password, that's the default credential (if you haven't changed it)

4. Update the repository:
$ sudo apt-get update
5.  Installing rpi-update:
$ sudo curl -L --output /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
6. Updating the firmware:
$ sudo rpi-update
7. Allocate more memory to GPU:
sudo raspi-config
then select memory_split, change the value to 256 (Model B device), or 64 or 128 (Model A device)

8. Installing other dependencies:
$ sudo apt-get install libao-dev avahi-utils libavahi-compat-libdnssd-dev libva-dev youtube-dl
9. Updating youtube-dl:
$ sudo youtube-dl --update
10. Download rplay binary and install:
wget -O rplay-1.0.1-armhf.deb
sudo dpkg -i rplay-1.0.1-armhf.deb
This will install and launch /usr/bin/rplay, and it runs automatically on boot.
You can try to reboot your Pi at this point, and rplay should auto start after reboot.

11. Manual start and stop
$ sudo /etc/init.d/rplay start
(NOTE: if you have 2 instances of rplay running, none would work!)
$ sudo /etc/init.d/rplay stop
If you want to see the output message, you can run this way:
$ sudo /user/bin/rplay
Make sure only one instance is running.
12. THIS IS VERY IMPORTANT, enter the license key, without it, AirPlay mirroring won’t work.
Safari browser has problems, try to use other ones. Once rplay is running, go to a browser and open this url:
http://localhost:7100/admin (If you use the browser on the same Pi machine)
The username/password is: admin/admin, go down to the last one, enter the license number, click Submit.

You can also perform other admin tasks here, such as setting password, toggling fullscreen, recording, etc.

The config file is /etc/rplay.conf, you can also manually edit the config file, instead of using the web interface. Append license_key=<your-license-key> to the last line of the file, for example:
admin_password=adminpassword=onscreen_code=0 [or 1]fullscreen=0 [0r 1]license_key=1223dd-your-from-email
13. Test regular AirPlay and AirPlay Mirroring
rPlay supports AirPlay and AirPlay Mirroring. For iphone 4 and iPad 1, you can’t do AirPlay mirroring, but you should be still do AirPlay for Photos/Music/Videos. For iPhone 4S and iPhone 5, iPad 2 and above, you can also do AirPlay mirroring.

On your iOS devices, double click Home button, slide to the most left, and choose rPlay as AirPlay device to connect. For iOS 7, you need to quickly swipe up from the bottom to bring up AirPlay window, and choose rPlay as AirPlay device to connect.

14. Test Chromecast
you need to install and update youtube-dl on pi, run the following command on Pi to auto update it:
$ sudo apt-get install youtube-dl$ sudo youtube-dl –update
right now, this is very simple implementation, it only works with YouTube app, either on Android or iOS. Make sure you download the latest YouTube app on your mobile device, then open YouTube app, pick a video to play, on the top right corner, there will be a square chromecast button, tap it, and choose rPlay to connect. The video should play on Pi, it won’t be able to control with this version, we will improve it.

15. Uninstall rplay
$ sudo /etc/init.d/rplay stop$ sudo dpkg -r rplay
16. If rplay is not found by your devices, you can try to toggle WIFI on your devices, turn it off and then on. You may also power off your router then power it on.

You will get the license key and details about rplay installation by register, login and post in Vmlite forum page.

Some posts on the internet say that we should disable the xbmc in order the rplay to running well. You could refer to Raspbmc FAQ here. But in my situation, I don't need to do that and airplay mirroring feature working just fine.

If you have audio problems, please refer to this article. And if your iOS devices don't see rPlay in the AirPlay device list, make sure avahi daemon is running on the Pi device, refer to this article.

So, that's it. Enjoy the features in airplay and airplay mirroring with rplay in Raspberry Pi :)

1 comment:

  1. please share your licence. vmlite is not doing anything anymore :(


Hi, for all of those who already put comments on my blog post, thanks.. really appreciate it. And for those who have not, just put your comments here :)