Snapcast / music-assistant: stream microphone input

Hi everybody,

I have multiple devices running snapclient around the house, that I can stream music to via music-assistant. This works fine. I use the snapcast addon in order to stream from Home Assistant to these devices.

This all works. But one thing has been bothering me from the start: I haven’t been able to integrate Chromecast in a way that allows me to stream any audio from my phone to these clients.

Afaik there is no native Chromecast client one can just run on a raspberry pi or Home Assistant that will then utilize snapserver to stream to the snapclients. So here’s what I did:

Set up an old Chromecast (regular, not audio); bought an adapter HDMI to audio. Bought an external soundcard (Sound Blaster Play! Analog 3). Connected the audio out from the HDMI-to-audio adapter to this external soundcard, connected that soundcard to Home Assistant.

The card gets recognized. I pretty much didn’t change anything except for the card in snapcast configuration:

So I assumed that now I could just cast some audio to the chromecast – and this audio would be streamed via snapserver. But that doesn’t work. There isn’t anything playing on any client, and I cannot chose microphone / audio in as an audio source in music-assistant.

Hardware-wise, this works. I connected headphones to the HDMI-to-audio adapter, then cast something to the Chromecast, and I can hear the audio just fine. So the hardware setup is fine, I assume.

But is there anything I can do to make Home Assistant / the snapcast addon / music-assistant play this audio? Either to the browser, or to any media players that are connected to this snapserver?

I activated the client (which was on “enable: false”) as well, hoping it would then allow me to use it as a source in music-assistant to stream to other clients, but that wasn’t the case (did it full restart after as well, no difference).

Is this somehow still achievable? Feed the output of an actual chromecast to a snapserver, then have music-assistant stream it to whatever client I chose?

Thank you for your ideas :slight_smile:

Hi,

Don’t know if that is a solution for you but have you had a look at icecast?
You can add an icecast stream as “Internet Radio” input in music assistant.

Hello prankousky,

I’m trying to do the exact same thing, have you found a solution?

Thanks!

I was able to use one device (raspberry pi) with USB audio card to receive audio playback from chromecast and stream it as mp3 stream via ffmpeg; not at home atm so I don’t have the specifics at hand.

Then I used Music Assistant to use this stream as an input, this being able to stream it to other devices (as long as Music Assistant was able to serve to them).

One downside was that the stream wouldn’t be considered active when there was no input, so I’d have to restart it when there hadn’t been playback in a while. But the worst was the bad audio quality; there’d be artifacts when playing this stream, even though I wouldn’t hear these artifacts when connecting the chromecast directly to a speaker. So something must have gone wrong during streaming / receiving / broadcasting the original audio signal.

I haven’t tried @jpfaff solution yet because I got so frustrated with this and gave up. But I’ll give it another shot after the vacation when I’m back home.

I would like to avoid using a raspberry pi and ideally directly connect the chromecast to the Home Assistant server (a NUC in my case), either by using the HDMI port or 3.5mm or a soundcard.
Home assistant has to capture that audio coming from the chromecast (using darkcast and icecast?) but I’m not sure that it is able to do that, I could not find anything about that.
Keep me posted in case you succeed :wink:

1 Like

Hopefully, this will be integrated at some point. There was a poll a few weeks (months?) ago about which feature should be implemented next, and I voted for local audio. Didn’t keep track though, fingers crossed it will be a feature soon :slight_smile: