Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build own Chromecast device

Tags:

google-cast

The Chromecast device is a "receiver device [that] runs a scaled-down Chrome browser with a receiver application". Can I download and install this receiver app on a chrome browser for example on my Windows notebook?

like image 386
Manuel A Avatar asked Jul 24 '13 17:07

Manuel A


People also ask

Can Chromecast be built-in?

Chromecast built-in is a technology that lets you stream your favorite entertainment and apps from your phone, tablet or laptop right to your TV or speakers.

Can I turn a Raspberry Pi into a Chromecast?

As such, you cannot just turn a Raspberry Pi into a Chromecast. Further, the Pi itself is only a piece of hardware, so it needs specific software that'll allow it to communicate with your mobile device and TV. Enter Raspicast, a mobile application that lets you stream media from your device onto your TV.


3 Answers

I have implemented a complete chromecast v2 receiver, called YouMap ChromeCast Receiver, available in Google play store and Amazon store, xda-developer thread here: http://forum.xda-developers.com/android-tv/chromecast/app-youmap-chromecast-receiver-android-t3161851

The current Chromecast protocol is a completely different one from the original DIAL based protocol. Right now, only YouTube still uses the old protocol, which chromecast maintains its backward compatibility.

The discovery is mDNS, exactly same as Apple TV bonjour protocol.

The most difficult part is device authentication, the sender and the receiver perform handshakes by exchanging keys and certificates in a way extremely difficult to crack. AppleTV does the same using FairPlay encryption.

The next difficult part is the mirroring protocol, which is also very complicated, need to deal with packet splits, packet retransmissions. Overall, chromecast mirroring protocol is well designed, better than miracast, better than AirPlay mirroring (I have also implemented both of them, so I know what I am talking about).

When I get chances, will write more here.

like image 174
huisinro Avatar answered Oct 28 '22 18:10

huisinro


The chromecast device works using the DIAL protocol. It is completely possible to emulate this protocol using some simple code to listen on the multicast group for discovery and then handle the HTTP requests to launch applications. It is then the launched application that communicates with the casting device, I believe using the RAMP protocol.

Luckily for us the applications that the chromecast device uses are mostly web applications meaning our device emulator just needs to launch a web browser and point it to a specific url when it receives an application request.

For example the youtube app, after device discovery and establishing where the applications are located (part of DIAL). Will send a HTTP POST request containing a pairing key to /<apps url>/YouTube. All the emulating device needs to do now is open https://www.youtube.com/tv?<pairing key> in a browser window. From here, I believe, communication for controlling the youtube app is not sent through the casting device but through the open tabs on the casting device and the emulator.

This is my understanding of how the chromecast device works and specifically the youtube app from looking at https://github.com/dz0ny/leapcast which is a python emulator that has youtube and google music working.

like image 45
Declan Cook Avatar answered Oct 28 '22 19:10

Declan Cook


Google is in progress of open sourcing some part of the chrome cast.

https://code.google.com/p/chromium/codesearch#chromium/src/chromecast/

https://code.google.com/p/chromium/issues/list?q=label:Chromecast

So theoretically you can build a similar device.

like image 30
Arunprasad Rajkumar Avatar answered Oct 28 '22 20:10

Arunprasad Rajkumar