1

I would like to listen to good quality audio while watching a video, but my Sonos does not have a line in.

My idea is to stream it from the Raspberry Pi and listen to it on the Sonos by tuning in to a local radio station.

I don't mind the delay - I can adjust the synchronization in Kodi.

3

It took me weeks to get a workable solution and in the process I read hundreds of webpages with ideas, instructions and software to download.

Finally I was able to reject 90% of it and come up with a relatively simple solution.

In summary:

Kodi -> Alsa -> avconv -> ezstream -> Icecast2 -> Sonos

The steps:

Kodi

I've only tried this with OSMC v2015.12-4 (Kodi 15.2) There are two things to do within Kodi:

  • Switch the audio output device
  • Adjust the video/audio sync (this method has approx. 5,3 sec. delay)

Alsa

To be able to tap into the audio stream, the simplest thing is to install the loopback sound module under Alsa. Life is too short for PulseAudio…

Avconv

avconv (aka. ffmpeg) will capture the audio from the Alsa loopback, convert it to mp3 and send it to Ezstream.

Ezstream

Ezstream can take an mp3 file or stream and feed it to Icecast2.

Icecast2

To stream audio you can use Icecast2. It’s highly configurable, can take many sources and exposes a web interface.

Sonos

Your Sonos system will need to setup to play a local radio station (mp3 over http) from Icecast2.


For all the details, read my blog article with step-by-step instructions here: http://jgivoni.tumblr.com/post/137612797027/streaming-the-audio-from-a-raspberry-pi-2-with

  • Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Note that as written it comes very close to self promotion and or spam. – Steve Robillard Jan 20 '16 at 0:11
  • Reading: "...Life is too short for PulseAudio…" in your article made me smile - please write it up here! 8-) – SlySven Jan 20 '16 at 9:32
  • @SteveRobillard I see your point and I expected some users to turn it down for those reasons. I just wanted to give people a chance to find this answer. However, I might improve the answer when I get a few minutes if it can help avoiding those nasty downvotes :-) – jgivoni Jan 20 '16 at 16:23

protected by Community Oct 29 '18 at 15:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.