This post is long and a more of a brain dump to help others think about
and discuss the issue.

I've done a bit of investigation into Chromecast to see what sort of
solution is possible and whether it would be usable.

As background I've had an original Chromecast for a few years and I've
ordered a Chromecast Audio.

As I see it Chromecast Audio is interesting to LMS users because for non
technical users it is a low cost standalone piece of hardware that can
provide over wifi/ethernet - audio out at hires both digital and
analogue, unlike the alternatives such as Raspberry Pi with Additional
DAC and downloaded s/w which need "assembly".

Making use of Chromecast Audio with LMS can be done in two ways
1. change Chromecast Audio device into a Squeezelite type player - this
would require rewriting the device software i.e. rooting it.
2. enable LMS to send compatible audio to standard Chromecast.

Early Chromecast devices could be be rooted but current ones cannot.
Since Google have taken steps to prevent rooting it is not a good long
term approach. So putting a version of Squeezelite onto Chromecast is
not practical - it doesn't matter what OS is running.

Enabling LMS to send Chromecast compatible streams is a better solution
for many reason
- since there are other "cast players" - it seems to be feasible
- Google is unlikely to take steps to stop it as the "cast players" are
using documented interfaces
- the approach will work with all Chromecast enable devices not just
Audio i.e. Gen 1 & 2 Chromecast for TV, Chromecast enabled TVs (e.g.
Sony) and speakers (e.g. Sony & LG Flow) 

I'm not sure if anybody has tested the suggested "cast player" noted in
earlier posts  but they are written in Javascript and use node.js and
npm. To get them going required loading up a lot of packages and even
then some didn't work as they were out of date (i.e. API used had been
deprecated). I don't believe these packages and Node.js are a good basis
for a LMS solution.  To get to understand Chromecast underpinnings -
I've played around with PyChromecast - a Python based "cast player" and
it was easier to set up.

The message format used by Chromecast is Google Protocol Buffers (aka
Protobuf) which serializes structured data. To help encode/decode
messages there is a special Protobuf compiler which supports C++, Java
and Python. Other languages such as Perl may be supported by 3rd parties
but Perl work stopped in 2011 and it is not clear if the Perl support is
complete. 

A Chromecast player is basically a browser which runs a single page.
Like a browser page it has background, text and multimedia elements such
as video or audio. The Chromecast application is in two parts a Cast
Sender and a Cast Receiver.  A Cast Receiver is an application created
using HTML, Javascript and CSS. It is loaded onto a Cast device (for
example, a Chromecast) through a URL that is accessible over the network
to which the Cast device is connected. There is a basic Default Receiver
which can play a media item and show text.  Custom Receiver apps can be
defined (e.g. fancy background , DRM) but they must be registered with
Google and the Custom Receiver app is loaded from a specific server. 
Since receivers are loaded from Specific servers - it seems the
Chromecast will only work if connected to Internet. All media played or
shown by a Chromecast device is obtained from a server using http. 

A command line (i.e. not using Android or Chrome) Cast Sender
application can tell a Chromecast device to load a specific Receiver
application and then it will interact with the receiver to play media
and change what is displayed. For basic use with LMS on a Chromecast
Audio device the Default Receiver app is sufficient and so there is no
need to develop a Custom Receiver app. 

The Cast Sender Application can tell the Cast Receiver told to play an
URL for a file or an audio stream with relevant cover art and title text
and if compatible Receiver will play it without any further interaction
with the Sender - just requesting data from a HTTP server. This is a bit
like using Local Player which plays the file directly rather askign for
LMS to send the files.

I don't think this mode is suitable for use with LMS as there are
unsupported formats (e.g. WMA) and probably other issues. It seems that
LMS support Sender will have to provide a http server and request an
appropriate HTTP stream from LMS and tell Receiver to play it augmented
by metadata (artwork,Track info, Artist etc).  It is possible the
current uPNP support in LMS might help but only if the Protobuf Perl
support is adequate - otherwise providing a Sender app written in C++ or
Python interacting with LMS could prove to be a challenging mash-up.

As I see it now, more investigation is needed but it is on the LMS side
- mainly determining how to create the http stream that the Chromecast
device will play and how to interact with LMS as a SB player.


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104383

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss

Reply via email to