How can I use Chromecast?

I just saw the video about Chromecast and I am interested in knowing how can I enable this on my Ubuntu PC. My TV has an HDMI port.


The documentation from Google indicates that the Google Cast extension is not supported in Linux, but it actually does work.

To get this working in Ubuntu:

  • Make sure you are running either Chromium or Chrome version 28 or higher. Earlier versions will get a "This application is not supported on this computer. Installation has been disabled." error. The 'chromium-browser' package in Ubuntu 13.04 works fine.

  • Make sure iptables is configured to allow the UPnP/SSDP traffic used by the Google Cast browser extension to discover the ChromeCast device.

    The browser will send a multicast UDP packet from the local IP and an ephemeral (random) port to 239.255.255.250 port 1900. The ChromeCast device will respond with a unicast UDP packet from the ChromeCast device's IP and another ephemeral port to the source IP/port of the multicast packet. Note that this is slightly different than most other UPnP devices, which will usually respond with a unicast UDP packet from port 1900 instead of an ephemeral port.

    The typical iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT rule WILL NOT match the response packet, as iptables does not currently have a conntrack helper that supports SSDP. In addition, the iptables -A INPUT -p udp --sport 1900 -j ACCEPT rule typically used for UPnP/SSDP will not work since the replies from the ChromeCast device do not come from port 1900.

    Therefore, you will need to add a rule to accept UDP packets on all ephemeral ports. The ephemeral port range for the initial multicast packet should be 32768-61000 (Verify with cat /proc/sys/net/ipv4/ip_local_port_range), so the following rule should work (note it inserts at the top of the input rules):

    iptables -I INPUT -p udp -m udp --dport 32768:61000 -j ACCEPT

    After the ChromeCast device has been discovered (each time the browser starts), the browser will control it using TCP (HTTP) connections to port 8008, which should not require any special iptables rules.

  • Install the Google Cast browser extension in either Chromium or Chrome. Note that an app/extension called ChromeCast is available, but this is not what you want.

  • If you have not yet set up your ChromeCast device, follow the instructions that come with the device to set it up.

  • Once your device is configured, you should be able to simply click the Cast button in Chromium to Cast your current tab.


This answer no longer works because the extension has been discontinued; this answer is, however, being left as-is for historical reasons.

It looks as if all you need is the browser Chrome or Chromium and the extension below: https://chrome.google.com/webstore/detail/google-cast/boadgeojelhgndaghljhdicfkmllpafd


pulseaudio-dlna

This project is in active development. From version >= 0.4.6 Chromecast is supported in addition to DLNA.

From Ubuntu >=16.10 pulseaudio-dlna is in the Universe repository.

For older versions the ppa ppa:qos/pulseaudio-dlna needs to be added first:

sudo apt-add-repository ppa:qos/pulseaudio-dlna
sudo apt-get update

We can then install pulseaudio-dlna it with:

sudo apt-get install pulseaudio-dlna

It then can be run from a terminal or script with

pulseaudio-dlna [options]

It will add all DLNA and Chromecast client(s) available in the local network as an audio output device to select from the sound settings menu.

We can then stream the audio from any media player (or browser) to our Chromecast client.

For all options see the project's documentation at GIT.


Since this question was asked 2 years ago, it may be worth mentioning that after Feb 2016, on Xubuntu 15.10, it was as easy as:

  1. Install Chrome or Chromium for Linux
  2. Install the Google Cast browser extension from within Chrome

Cast the tab you want. Easy as that.

EDIT: Now the feature is built in:

screenshot


I'm running Ubuntu 14.04 on my PC & Android 4.3 on my Phone.

First you need to plug the Chromecast in and change the TV source to that HDMI port.

Next install the Phone app from here on play store

Then use the Phone app to connect the Chromecast to your wifi and then it will update and reboot.

After that, go to your Ubuntu PC and open Chromium and install this app from the Chrome web store The Chrome-cast device is now listed. It's that simple.

For video file playback : Go to File > Open File locate the video and open. The Chromium browser has a media player built in. Then you can stream it. Remember to go "full screen" (press F11) :) That's it.

Here are the codecs that work in Chromium : http://www.chromium.org/audio-video

There are other projects like VLC or XBMC that are working on Chromecast compatability, so it won't be long until we can stream everything. If you use Steam you can install VLC or XBMC and stream from one Steam box to another already.