Skip to main content

Chromecast audio: mirroring, streaming, authenticating

I was curious about what the Chromecast audio is and how it works - both in terms of hardware and software. After a lot of needless thrashing about, I realized that the wikipedia page has the specifications for the system on a chip, though the ifixit teardown is more detailed and also points out that the Chromecast and Chromecast audio basically have the same system-on-a-chip. Interestingly, the Synology NAS also has a Marvell Armada system. says that the system runs a modified Android system.

I was most curious about was how the software works: specifically, when I play music through the chromecast audio what is the flow of data? My web-search-fu failed me, and could not get any descriptions of this that went beyond user-level, google marketing speak. What I gather is that there are two modes of data transfer: mirroring and streaming.

Mirroring takes the audio data stream playing from a computer (laptop, smart phone, iPad) and redirects it to the Chromecast. Software on the computer (say the chrome browser) is talking to (authenticating with) the server (say youtube), and is streaming the data from the server, doing all the heavy lifting. When you mirror, the audio component of the output, instead of feeding to the components of the operating system that drive the computer speakers, instead is sent back out over the LAN to the Chromecast, which then takes this stream, from your computer, and coverts it into analog signals for the connected speakers.

During streaming on the other hand, the Chromecast does all the heavy lifting - the Chromecast talks to the server, authenticates, and then grabs the data and renders it, doing the same work the laptop was doing during casting. The computer (smart phone, iPad) now acts only as a controller - there is typically an App that is used to select what music to play, but this App is just passing along metadata to the Chromecast, which then relays these instructions to the server and grabs the return data. The App is just a nice UI for the Chromecast, which is the backend.

This data flow is betrayed because I've found casting to often be glitchy, say when my computer stutters, which messes with the audio data flowing from the computer to the Chromecast. Streaming, on the other hand seems to be independent of the host - you can use an App on your phone to start a music stream and then turn off the phone, and the music will keep playing because the Chromecast is doing the actual work.

Found this answer on google's FAQ for Chromecast, that makes this information explicit. They use the terms cast for what I called streaming and tab cast for what I called  mirroring.

A Synology blog post says:
Chromecast is basically a Chrome browser, you can’t see it, you can’t feel it, but it’s there: when you select a song to stream, DS audio/video simply passes the HTTP(S) url to the browser, meaning the stream goes from the DiskStation to the Chromecast, the device is never a bottleneck. And if you kill the app or log out, streaming will carry on uninterrupted!

Streaming should raise some privacy and security concerns in your mind. Say you let the Chromecast connect to your home NAS by supplying the login and password. You've basically given a black box - that has connection to the internet - access to your NAS. We trust this just like we trust that our laptops don't have spyware as part of the OS, or that the NAS itself is not phoning home with our private data, but you never really know, do you? 


Popular posts from this blog

Flowing text in inkscape (Poster making)

You can flow text into arbitrary shapes in inkscape. (From a hint here).

You simply create a text box, type your text into it, create a frame with some drawing tool, select both the text box and the frame (click and shift) and then go to text->flow into frame.


The omnipresent anonymous asked:
Trying to enter sentence so that text forms the number three...any ideas?
The solution:
Type '3' using the text toolConvert to path using object->pathSize as necessaryRemove fillUngroupType in actual text in new text boxSelect the text and the '3' pathFlow the text

Drawing circles using matplotlib

Use the pylab.Circle command

import pylab #Imports matplotlib and a host of other useful modules cir1 = pylab.Circle((0,0), radius=0.75, fc='y') #Creates a patch that looks like a circle (fc= face color) cir2 = pylab.Circle((.5,.5), radius=0.25, alpha =.2, fc='b') #Repeat (alpha=.2 means make it very translucent) ax = pylab.axes(aspect=1) #Creates empty axes (aspect=1 means scale things so that circles look like circles) ax.add_patch(cir1) #Grab the current axes, add the patch to it ax.add_patch(cir2) #Repeat

Running a task in a separate thread in a Tkinter app.

Use Queues to communicate between main thread and sub-threadUse wm_protocol/protocol to handle quit eventUse Event to pass a message to sub-threadimport Tkinter as tki, threading, Queue, time def thread(q, stop_event): """q is a Queue object, stop_event is an Event. stop_event from """ while(not stop_event.is_set()): if q.empty(): q.put(time.strftime('%H:%M:%S')) class App(object): def __init__(self): self.root = tki.Tk() = tki.Text(self.root, undo=True, width=10, height=1)'left') self.queue = Queue.Queue(maxsize=1) self.poll_thread_stop_event = threading.Event() self.poll_thread = threading.Thread(target=thread, name='Thread', args=(self.queue,self.poll_thread_stop_event)) self.poll_thread.start() self.poll_interval = 250 self.poll() self.root.wm_protocol("WM_DELETE…