Shairport-sync: Chromcast Audio support

Created on 17 Nov 2015  Â·  13Comments  Â·  Source: mikebrady/shairport-sync

Hi,

Please, can you add (or explain how to configure) support for Chromecast Audio?

I like to use it with shairport but don't know how to do! PulseAudio has support for it:
http://github.com/masmu/pulseaudio-dlna
It's possible to connect Shairport-Sync with PulseAudio

Thank you!

question

All 13 comments

Hi Lars. Thanks for your interest in Shairport Sync. Unfortunately, it does not really support PulseAudio. The pulseaudio back end that is there is basically a relic of the original shairport. It uses the so-called "simple" interface. In particular, it does not do synchronisation. My guess is that the PulseAudio-DLNA bridge doesn't do synchronisation either.

A conceptually easier way, maybe, is to use the pipe interface to direct audio to a PulseAudio sink which could then be connected to the bridge.

Hi @mikebrady ,

Thank you for your response! I don't need the "sync" mode, I only like to use the "regular" streaming mode. Can you, please, provide a simple howto for use the "pipe" bridge with Pulseaudio?

Actually, having a quick look at this, the pulseaudio back end is probably easier. You need to compile Shairport Sync with the --with-pulseaudio option included – the library libpulse-dev seems necessary.

Check it's been included with shairport-sync -V – it will have the word pulse in the response, e.g. 2.6-openssl-Avahi-ALSA-pulse-soxr

Then, you can use command line options (the pulseaudio back end doesn't use the config file) to direct the output to a named pulseaudio sink.

You can check the help options using shairport-sync -h:

Options for output pulse:
    -a server           set the server name
    -s sink             set the output sink
    -n name             set the application name, as seen by PulseAudio
                            defaults to the access point name

Here's the skeleton of a call off shairport-sync:

shairport-sync -d -a "Pulse Audio" -o pulse - -n <sinkname>

Good luck!

Ok. Thank you! I'll try. A bit complex, but I hope it will work.

Thanks – be sure and tell us how things work out, please!

Thanks to you! I'll also try to test vlc with chromecast support. Perhaps it will be easier to use for simple pipe from shairport-sync. What needs to be the command line for use pipes?

Sorry for the delay in responding. Rather than use pipes, it's even easier to use the standard output. You have to include standard output support at compile time with the --with-stdout configuration option included. To check that support is included, look for the word stdout in the version string, so $shairport-sync -V should give you something like this: 2.6-openssl-Avahi-ALSA-stdout-soxr (notice the word stdout in it).

To use it to play to the default pulseaudio output, this works for me:

$shairport-sync -o stdout | paplay --raw

This will make Shairport Sync use the settings in its configuration file, but instead of using the alsa output it will send audio to standard output and this is piped into paplay as raw audio. You would have to tell the PulseAudio system to send the output to ChromeCast, but that's something you'll have to figure out for yourself.

Hi @mikebrady,

Thank you! This seems to be easy to implement... I'll try. ;)

Hi,

With last nightlies of VLC 3.0.0 is possible to send audio directly to a Chromecast Audio, like:

$ vlc -vvv --sout "#chromecast{ip=YOUR_CHROMECAST_IP_HERE}"

So, if it's possible to pipe shairport-sync with vlc?

Hi there. Unfortunately it is not possible. However, from a Mac you can send VLC audio to AirPlay devices, including Shairport Sync.

Hi Mike!

Why is not possible?

  • VLC can read from pipes or stdin
  • Shairport-sync can output to stdout (I suggest to compile "--with-stdaout" enabled by default!)

I feel it can be possible!

Hi,

Someone has implemented it, using Shairport-Sync+stdout+PyChromecast+Python-FLAC and some code.

See this project: AirCast
http://github.com/ains/aircast

The idea is: run Shairport with stdout as the source, realtime transcode to FLAC, and serve it with HTTP to the Chromecast.

I hope, in the future, some native support will be included in Shairport-Sync.
Regards!

Thanks for this information. Closing the issue. Please open a new one if necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corentoulf picture corentoulf  Â·  7Comments

purefan picture purefan  Â·  5Comments

mc002b picture mc002b  Â·  7Comments

pawpawhe picture pawpawhe  Â·  6Comments

moonwatcher picture moonwatcher  Â·  3Comments