Pages

Wednesday, October 7, 2015

chromecast

I've had a Google Chromecast gathering dust in my workshop since just after they were announced. This dusty nap wasn't really its fault. The device just didn't seem very useful after I gave away the television.

Google's recent announcement of second-generation Chromecast hardware included an audio-only version that sparked in me new interest. I dug my old Chromecast out of a drawer and plugged it into
an HDMI monitor that can split HDMI audio out to external speakers.

I was pleasantly surprised. The experience of streaming a tab-full of audio out of Chrome into the Chromecast was worse than streaming audio from iTunes to Airplay but better than directing Mac system audio into Airplay.

Airplay is just about the only thing that iTunes does well. In any case, I had already banished iTunes from my machine and I play all my tunes by drag-and-drop with a web app, phonoh, that runs in Safari, Firefox, Chrome, or as a Chrome app. I'm happy this setup but it has left me without a pleasant way to beam audio from the browser to any of the speakers in my house.

Ten minutes with the Chromecast had me beaming tunes from phonoh into speakers. The crippling downside is that I have to cast the entire tab for this to work. Why? For starters, Google's cast SDK fails totally for web apps hosted from the filesystem with file://. For nexters, there is a gigantic disconnect between the ease with which tab-casting works and the Kafka-ocracy of hosting a receiver app, registering an app id, enabling magic developer mode on your device, blah, blah, blah for an app where there is fundamentally nothing worth hosting anywhere but in Chrome in the first place.

I drop files onto the web app from the desktop or from another web app. That's it. Essentially every audio track I have ever played is smaller than a single RAW file from my eight-year-old DSLR. I'm not a media hoarding survivalist with a ridiculous HTPC, a shotgun, a vault of ripped Blu-Ray discs, and food for a month. I'm just a dude who is going to listen to less than a terabyte of music between now and death. Why stream the soundtrack to my demise when most of it would fit on a microSD card in the space of a fingernail?

I took a tour through the two megabytes (!!) of minimized Javascript that make up the Cast extension that Google distributes. I thought it might be simpler to just write my own Chrome extension that lets me manage the WebRTC plumbing that appears to make tab-casting go.

I poked around in there to find the Chrome mDNS support and I built that into phonoh. Chrome's mDNS found my Airplay devices in short order but not the Chromecast!

At this point, I decided that I would just build a registered custom receiver that could be used with any app. I thought I could build a receiver web app that presented a generic remote-DOM interface to
the Chromecast. This appears possible, but generic (or even re-useable) custom receiver apps are forbidden by the SDK terms of service! Nearly every aspect of what I wanted to build is explicitly forbidden by the terms of service.

The Chromecast dongle is now in the ewaste pile. I was never meant to be the customer for Chromecast. I was somehow meant to be the product.

My point isn't that Chromecast is broken or evil. My real point is that Chrome, or Chromium, and Firefox are the only local, graphical, general purpose computing platforms worth programming today. Chrome, through extensions written in Javascript, can even host its own local development. Chrome is demonstrably adequate for interesting systems programming -- look no further than the cast plugin or the Chromecast themselves.

Chrome and Firefox are essentially fully baked as platforms. Most of the rest is removing the damage they inflict on themselves through administrative fiat. For example, Firefox doesn't allow self-hosted apps to use privileged APIs -- which is most of the APIs that distinguish an app from a web page. I can't build an alarm clock in Firefox without permission from Firefox World HQ. Even worse, Firefox reserves some permissions just for the 'manufacturer' and presumably still others for themselves. Manufacturer, here, means one particular middleman out of the many between you and the orphans at the conflict mineral mine who dug your device up from the earth a handful at a time. There is no higher plane of privilege reserved for the owner. Or for the orphans, for that matter.

By the way, Orphan Rights Management would be awesome. This tantalum isn't for pornography. This indium can't be used for human trafficking. This tin can't be used by despotic regimes that don't follow the Terms of Service in the UN Universal Declaration of Human Rights.

Let's stop treating audio and video as technological special cases. Let's give up on the idea that clients are somehow less than servers. Let's stop pretending that we can keep the bad men out by preventing users from using their computers. Let's take back 'rooting' and just call it 'owning' again. Leave the rooting to wild pigs.

No comments:

Post a Comment