Chromecast Audio output

Hello everyone. I have a few Chromecast Audio devices that have been collecting dust since I discovered the existance if Volumio.

I had the idea today to try and run multiple instances of Volumio on my windows PC in Virtualbox as VM’s and was able to successfully install and configure them so that they’re accessible from any device on my network just like a proper Volumio device such as a Raspberry Pi. The local interface as well as web interface on my smartphone worked perfectly and I was able to play music from my PC speakers.

NOW…the second part to my plan was to try and use one chromecast as the audio output device for each of the separate VM’s. Now I know this isn’t going to produce outstanding audio quality but my main goal would be to add Volumio installations to a couple rooms in my house with the hardware I already have at hand.

I have been playing around with this for several hours today with no success. Has anyone had success with Chromecast Audio streaming on either Volumio or the base linux of Volumio which is Debian? I will keep messing with it and share my results but in the meantime but any input from more experienced users would be welcome.

The most promising lead I have found so far is a package called pulseaudio-dlna which will stream to a Chromecast but I will have to mess with Volumio’s configuration to direct MPD to use that and hope everything plays nice together.

Ok so after a lot of playing around I still have no luck. I couldn’t be bothered with anything pulseaudio so I am trying to get the mkchromecast package working via ALSA. I haven’t had any luck with getting a working loopback device set up though. Any suggestions or quirks that are present in Volumio vs a standard Debian or Ubuntu installation? I know that some of the equalizer plugins use loopback devices so I guess I will try to dissect on of them next.

Yes you can have a look at the equalizer plugin or other Audio device plugin I made. This documented in lndex.js. If you need some help, just ask :wink:

I too have been intrigued on what it might take to get Chromecast devices to work with something like Volumio.

The main thing to note about the Chromecast is that it has built-in streaming for MP3, WAV and FLAC. To get the chromecast to play your MP3 or FLAC file, you don’t need to actually uncompress a PCM stream and feed it like you would to a sound device but instead only need to host that file on a HTTP server and instruct the device to play the URL. That URL need only be accessible to the chromecast via your own LAN.

Getting Volumio to do all that is a big change from the normal behaviour or streaming to a DSP. So if there is a quick win, it will be with mkchromecast. I will play around with mkchromecast in the coming weeks to see if I can make it work.

But to demo the native chromecast approach I did some tests today using python scripts and pychromecast, I was able to directly stream MP3 and FLAC files to both the normal HDMI-variant and Chromecast Audio devices.

For anyone with a dev background or enough tinkering on a Linux to get by, you may be able to replicate the same simple testing as detailed below:

I installed pychromecast:

sudo pip install pychromecast (or pip3 if you’re using python3). I did this on my Mac. But it will work the exact same way if done on a Pi or any Linux server. You might get some success on Windows if using Cygwin. This library implements the discovery and also media controller interface for Chromecast and makes it quite simple for a python script to control the devices.

Then in my home dir, I put two test flac files…

$ ls *.flac
test.flac test2.flac

One on terminal, I ran the very handy python web server module from my home directory:

$ python -m SimpleHTTPServer Serving HTTP on port 8000 ...

That runs a simple HTTP server on port 8000 for all IP addresses on that host and serves the current directory as its site root. This will act as a serving node for the FLAC files. If running this on a Mac or PC, you may need to open port 8000 on your firewall to allow other LAN clients talk to port 8000. On a Pi, I don’t think the firewall is usually active and this should just work. To test it, browse to the IP:8000 of the machine and you should see a HTTP directory listing of the current directory contents.

Then this short python script will use the installed pychromecast library to detect chromecasts on the LAN, specifically identify one by name, in my case “Office Chromecast” and instruct the device to stream the desired flac file from the simple python web server. The URL is simply the IP:port/ and I hardcoded that to my machines local LAN IP, port 8000 and the path for the file. The play_media call also specifies the type which in this case was “audio/flac” but could also be “audio/mp3”.

[code]import pychromecast

devices = pychromecast.get_chromecasts()

for cc in devices:
if (cc.device.friendly_name == “Office Chromecast”):
mc = cc.media_controller
mc.play_media(“”, content_type = “audio/flac”)

I put this code into a file and ran it with python3. Then the HTTP server terminal showed this output after a few seconds… - - [30/Dec/2018 19:25:09] "GET /test2.flac HTTP/1.1" 200 -

and that is confirming that my targeted chromecast was discovered and directed to play the file. On the video Chromecasts, you get a basic built-in GUI showing the playback progress of the file being streamed.

BTW: I also tried 24/96 5.1 FLAC files. They would not play via the Video Chromecasts but did play via the Audio variant. . I didn’t get a chance to test that via optical SPDIF to my AVR but I suspect that only 2 channels come in as 24/96 in that scenario and that we’re seeing it selecting only the L/R pair or downmixing the 5.1 to 2 on the device itself. It was a pity this doesn’t seem to be supported on the video variant as the HDMI would be perfect for carrying a 5.1 LPCM lossless feed to an AVR.

I’ve had some success here with getting Volumio to stream to Chromecast. I didn’t go the mkchromecast route in the end.

See this topic… #p59221

Hey I’m glad to see I’m not the only one with interest in getting chromecast working as an output. I haven’t had any luck with several attempts with mkchromecast and forked-daapd, and other possible avenues.

I figured I would wait until the Stretch release of Volumio is out so the software packages in the repo’s will be more current and hope I have better luck then.

Your link doesn’t work - can you check it?

What if you install bubbleupnp on your PC or even on the raspberry and assign the chromecast device as an OpenHome renderer?
You could then use an app like Lumin ( ipad app ) to controll the chromecast device.
I know that does not involve Volumio but it should work.

Somehow my other post on this solution got deleted while I was editing it. So I reposted it again.

Link here with installation details and link to github for the script.


Happy to report that the new x86 alpha image posted over in the development forum which is based on Debian Stretch is working in virtualbox with mkchromecast without any extra tweaking. Just follow the instructions in tje wiki for ALSA output.

The only catch is that you need to switch audio output in Volumio to Loopback and connect to the chromecast before playing any music. There is a significant delay from 5 to 10 seconds though so I’ll have to play with it some more.

Is it still true tho?

Hey Rees,

Did you ever get Volumio and your Chromecast Audio to stream at the same time? So you could have music in two different zones?