Chromecast on Linux
I was recently pondering purchasing a Google Chromecast unit to mess around with at home. The price is so low that they are almost giving them away. I assume that is so Google can harvest your viewing habits and resell them, but that is another story. Originally I was thinking about using a Raspberry Pi unit with XMBC to do media streaming, but as cool as it is, I don't have the time to install, configure and train my family... even if it is way cooler and would give me way more geek cred. While Minimum System Requirements for using the Chromecast includes most of the normal equipment to be found on my home network, it doesn't support Linux. Now, thanks to the best (and in depth protocol) explanation from Paul Donahue on the AskUbuntu forum, I know that I'm covered with my Linux devices at home. Now all is right with the world again. Thanks again Paul, you made my day a little better. Now if Google would officially support it as a product and not a beta, that would be cool.
Edit/Addition: I actually wrote this a few weeks ago but never ended up publishing it. Since then I've bought two Chromecast units to hook up to various TVs around the house. I would rather have a direct Ethernet connection to them, but they never skip and you really can't beat the price. I mainly use Ubuntu 13.10 with Chromium to cast content to the Chromecast units, but my kids use the iPad client and it is seamless. Sometimes less is more.
Source from AskUbuntu:
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 220.127.116.11 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:
iptables -A 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.