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 161 forks source link

MPD to Chromecast Setup #376

Open hotwheelzffx2 opened 5 years ago

hotwheelzffx2 commented 5 years ago

I have pulseaudio-dlna working to the point that I can render audio from VLC to any Chromecast. But, I am trying to get my MPD instance to also stream to a Chromecast. I can't quite get this to work. My MPD instance does play to the local speakers. I have setup an additional audio ouput in mpd.conf audio_output { type "pulse" name "office_chromecast"

sink "office_chromecast"

server "127.0.0.1" }

I have tried multiple versions of Office (Chromecast), Office, etc. I just cannot get sound pushed to this Chromecast or any Chromecast device. What is the correct options for the audio_output in mpd.conf?

masmu commented 5 years ago

List all the sinks available with pacmd list sinks | grep name Just a wild guess, but probably office_chromecast.monitor

hotwheelzffx2 commented 5 years ago

From this - audio_output { type "pulse" name "Office Speaker" sink "officespeaker_chromecast.monitor" mixer_type "software" }

I see the following error in the mpd.log

Feb 21 10:02 : output: opened plugin=pulse name="Office Speaker" audio_format=44100:24:2 Feb 21 10:02 : pulse_output: "Office Speaker" [pulse] failed to play: failed to connect the stream: No such entity Feb 21 10:02 : output: closed plugin=pulse name="Office Speaker"

hotwheelzffx2 commented 5 years ago

Changing it to this: audio_output { type "pulse" name "officespeaker_chromecast.monitor" }

Gives me this in the mpd.log - although I have no sound yet.

Feb 21 10:05 : output: opened plugin=pulse name="officespeaker_chromecast.monitor" audio_format=44100:24:2

masmu commented 5 years ago

I am sorry but I am quite unfamiliar with MPD.

launacorp commented 5 years ago

@hotwheelzffx2

I got it working.

pactl list | grep sink listed me sink_name="pioneera676_chromecast" sink_properties=device.description="Pioneer\ A-676\ (Chromecast)"

Stop mpd: systemctl stop mpd

Edit the /etc/mpd.conf:

Remove ALSA by comment it: # MPD supports various audio output types, as well as playing through multiple # audio outputs at the same time, through multiple audio_output settings # blocks. Setting this block is optional, though the server will only attempt # autodetection for one sound card. # # An example of an ALSA output: # #audio_output { # type "alsa" # name "My ALSA Device" # device "hw:0,0" # optional # mixer_type "hardware" # optional # mixer_device "default" # optional # mixer_control "PCM" # optional # mixer_index "0" # optional #} #

Add PULSE by uncomment & edit: # An example of a pulseaudio output (streaming to a remote pulseaudio server) # Please see README.Debian if you want mpd to play through the pulseaudio # daemon started as part of your graphical desktop session! # audio_output { type "pulse" name "pioneera676_chromecast" server "localhost" # optional sink "pioneera676_chromecast" # optional } #

Start mpd: systemctl start mpd

After mpc add http://URL & mpc play it tooks about 10 seconds before i can hear the output of my speakers.

NOTE: I use a Chromecast-Audio so it might not work on Chromcast-HDMI-Sticks