Linux HOW-TO: XBMC machine as Chromecast Receiver.
#1
Work in Progress:

People keep talking about integrating Chromecast and XBMC so I thought I would see if I could implement a Chromecast Receiver app on a XBMC box. The approach is to set up leapcast which in turn opens google-chrome. The chromium-browser included in most linux distros doesn't seem to work, you need the full job from Google. This has been tested on Mythbuntu 12.04, which I use as a basis for my media machines.

(Actually this has little to do with XBMC - leapcast sits in the background until someone casts to it, then it pops up google-chrome fullscreen to play the video, then chrome can be closed either with the sending machine (typically your smartphone) or with a keypress that you assign on your remote.)

1. Install Prerequisites

We need git to get the leapcast source code and we need python-tornado and python-setuptools as a pre-requisite of leapcast:

Code:
sudo apt-get install git python-tornado python-setuptools

2. Install leapcast

Code:
cd Downloads
git clone https://github.com/dz0ny/leapcast.git
cd leapcast
sudo python setup.py develop

leapcast should be installed to /usr/local/bin/leapcast

3. Install google-chrome

First it's dependencies:

Code:
sudo apt-get install libcurl3 libnspr4-0d

I found instructions which suggested this way to install google-chrome:

64 Bit Systems
Code:
cd ~/Downloads
wget -O g-chrome-NoobsLab64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i g-chrome-NoobsLab64.deb

32 Bit Systems
Code:
cd ~/Downloads
wget -O g-chrome-NoobsLab32.deb https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
sudo dpkg -i g-chrome-NoobsLab32.deb

4. Run it

I found this commandline ran it best:

Code:
DISPLAY=:0 leapcast --user_agent TV --fullscreen --chrome /usr/bin/google-chrome

Now get your android or iphone cast something to it via the youtube app.

5. To Do

*Implement remote control keybindings

*Make a startup script so it runs on boot

*Work out why my android phone doesn't let me choose which of several leapcasts running in the house to cast to.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#2
Do you have a video of this feature working?
Reply
#3
no. why?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#4
Thanks for the guide, it works a charm. You missed an s off "stable" in the installing chrome 32bit command.

For choosing which instance of leapcast to connect to, could you try naming each PC's leapcast something unique using --name in the script to run? Just an idea.
Reply
#5
(2013-08-22, 21:57)nickr Wrote: no. why?

Sorry but I use the standalone xbmc and I don't get how this solution works
Reply
#6
well, I've just try to make it work, but I think there is something wrong, I'm getting this half size Window, the connection seems to be working well, but maybe there is different command for 64 bit chrome? http://imgur.com/Byb2EZf
Reply
#7
(2013-08-23, 17:02)Voodooguru Wrote: Thanks for the guide, it works a charm. You missed an s off "stable" in the installing chrome 32bit command.

For choosing which instance of leapcast to connect to, could you try naming each PC's leapcast something unique using --name in the script to run? Just an idea.
Thanks, fixed the typo. Yes the --name parameter would probably fix it!

(2013-08-23, 21:41)flaviobrandao Wrote: well, I've just try to make it work, but I think there is something wrong, I'm getting this half size Window, the connection seems to be working well, but maybe there is different command for 64 bit chrome? http://imgur.com/Byb2EZf
Not sure whats up there, I use 64 bit so the command should be the same. Are you sure you used the --full-screen parameter to leapcast? There is also a --window_size parameter.

Code:
nick@envy ~/Downloads $ leapcast --help
usage: leapcast [-h] [-d] [--name NAME] [--user_agent USER_AGENT]
                [--chrome CHROME] [--fullscreen] [--window_size WINDOW_SIZE]

optional arguments:
  -h, --help            show this help message and exit
  -d                    Debug
  --name NAME           Friendly name for this device
  --user_agent USER_AGENT
                        Custom user agent
  --chrome CHROME       Path to Google Chrome executable
  --fullscreen          Start in full-screen mode
  --window_size WINDOW_SIZE
                        Set the initial chrome window size. eg 1920,1080
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#8

(2013-08-23, 21:41)flaviobrandao Wrote: well, I've just try to make it work, but I think there is something wrong, I'm getting this half size Window, the connection seems to be working well, but maybe there is different command for 64 bit chrome? http://imgur.com/Byb2EZf
nickr Wrote:Not sure whats up there, I use 64 bit so the command should be the same. Are you sure you used the --full-screen parameter to leapcast? There is also a --window_size parameter.

Code:
nick@envy ~/Downloads $ leapcast --help
usage: leapcast [-h] [-d] [--name NAME] [--user_agent USER_AGENT]
                [--chrome CHROME] [--fullscreen] [--window_size WINDOW_SIZE]

optional arguments:
  -h, --help            show this help message and exit
  -d                    Debug
  --name NAME           Friendly name for this device
  --user_agent USER_AGENT
                        Custom user agent
  --chrome CHROME       Path to Google Chrome executable
  --fullscreen          Start in full-screen mode
  --window_size WINDOW_SIZE
                        Set the initial chrome window size. eg 1920,1080

Just get this working!!!!
I've remove the option user_agent and sent to leapcast the size as you said. this is the final command line for my future script. Thanks and sorry for my bad english.

Code:
DISPLAY=:0 leapcast --name MediaCenterPC --fullscreen --window_size 1920,1080 --chrome /usr/bin/google-chrome
Reply
#9
--user_agent TV gives a different interface, one that seems better for a 10 foot interface, for me anyway. Would like to know what other options there are for that parameter.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#10
(2013-08-24, 01:12)nickr Wrote: --user_agent TV gives a different interface, one that seems better for a 10 foot interface, for me anyway. Would like to know what other options there are for that parameter.

looks like PS3 interface...I'm thinking, now with the pipelight, maybe can leapcast send videos from netflix
Reply
#11
Not sure, can't use netflix in NZ anyway.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#12
Netflix service is very popular here in Brazil, can't wait to see this working with xbmc
Reply
#13
Nice.. however I got this
[7:24:0825/130023:ERROR:platform_thread_linux.cc(99)] Failed to set nice value of thread to -10

I had to run it with sudo to actually get anything.. However the sound comes form the movie that plays
Also it was chopping..
But nice work..
Reply
#14
Tongue 
works great, thanks for the guide. Now my daughter can see the teletubbies all day long Wink
Reply
#15
Hi,
Great work!
Does the "Cast entire screen (experimentally)" button work? (See this video if you dont know what I am talking about).

I also wondered if anyone of you know if there is a similar feature for Windows?
Reply

Logout Mark Read Team Forum Stats Members Help
HOW-TO: XBMC machine as Chromecast Receiver.0