masmu / pulseaudio-dlna

A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux
GNU General Public License v3.0
1.25k stars 162 forks source link

Does not work with Google home mini, #388

Open blurkis opened 4 years ago

blurkis commented 4 years ago

I wanted to use my google home mini as a speaker for my linux desktop which lacks bluetooth so pulseaudio-dlna would be perfect... i guessed. The device shows up in the speaker-settings, but if I try to make it default i get this message:

01-22 15:17:12 pychromecast INFO Querying device status 01-22 15:17:12 pulseaudio_dlna.pulseaudio ERROR The device "Vardagsrummet (Chromecast)" failed to play! (500) - Chromecast 192.168.1.87:8009 is connecting... 01-22 15:17:13 pulseaudio_dlna.pulseaudio INFO _async_handle_sink_update /org/pulseaudio/core1/sink3 finished!

bubuntux commented 4 years ago

same issue here

clemtaylor commented 4 years ago

I wasn't able to get it to work with a home mini either.

pulseaudio-dlna finds 2 home mini's, a 1st gen home and a playback group, but is unable to play back on any of them.

FYI, I've used https://github.com/balloob/pychromecast.git in the past to stream to the home mini and it seems to work just fine (although the latency is pretty bad, but the groups are in sync)

04-17 10:54:12 pychromecast                                   INFO     Querying device status
04-17 10:54:12 pulseaudio_dlna.pulseaudio                     ERROR    The device "Office (Chromecast)" failed to play! (500) - Chromecast 192.168.1.231:8009 is connecting...
Failure: No such entity
waynew commented 4 years ago

It might have something to do with the stream and the Home Mini?

Here's an example of something that works:

python3 -m http.server  # somewhere you have mp3s. Grab the link

Spin up this:

import pychromecast

print('Loading cast devices...')
casts = pychromecast.get_chromecasts()
print('Cool')
for cc in casts:
    if cc.device.friendly_name.lower() == 'your name':
        cc.wait()
        cc.media_controller.play_media('your mp3 url here', 'audio/mp3')

That should work.

oh heck! I was trying to write up my hax, but I totally got it working! All you should need to do is go into pulseaudio_dlna/plugins/chromecast/renderer.py and find the line:

chromecast = self._create_pychromecast()
chromecast.media_controller.play_media(

and stick chromecast.wait in there:

chromecast = self._create_pychromecast()
chromecast.wait()
chromecast.media_controller.play_media(

It may take several seconds before the chromecast picks up, but that worked for me!

waynew commented 4 years ago

Hah, yeah, looks like there's already a fix in #398 :+1: