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.


1 Answer 1


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:


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)


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 (aka. ffmpeg) will capture the audio from the Alsa loopback, convert it to mp3 and send it to Ezstream.


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


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


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. Jan 20, 2016 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, 2016 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, 2016 at 16:23
  • I followed the steps on the Tumblr post and got “ DBus error: org.freedesktop.DBus.Error.ServiceUnknown - The name org.freedesktop.UPower was not provided by any .service files” when I restarted. And OSMC would not boot - it flashed a sad face. To get OSMC to boot correctly, I had to undo the configuration steps under the “Alsa Looback” section. I documented at discourse.osmc.tv/t/… . Any suggestions?
    – Mike Eng
    Aug 9, 2020 at 17:34

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