Skip to main content
Contributor I
May 6, 2021

Raspberri PI & Output to Sonos

hi

I am new to raspberry PI. I have a sub and 3 play 1’s and plan to ad the ARC at some stage. I want better sound quality than streaming off the phone or PC so I was planning on some changes.

I like the rasperry pi so I was wanting to guy a PI hat audio streamer and play all my music through it to my sonos speakers. I was thinking of using roon too.

I also have a Synology NAS and I want to stream from that too.

Is there a way to make this happen?? I cant seem to work it out.

 

Thx in advance.

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

19 replies

May 7, 2021

Personally, I have a Pi running Plex Media Server and have both Sonos & Alexa signed into Plex - I can ask Alexa to play FLAC audio from my own library through Sonos.

 

 

This needs the Sonos Alexa integration to be available, correct?

And where does your local library sit?

Corry P
Sonos Staff
May 7, 2021

Hi @Kumar 

Personally, I have a Pi running Plex Media Server and have both Sonos & Alexa signed into Plex - I can ask Alexa to play FLAC audio from my own library through Sonos.

This needs the Sonos Alexa integration to be available, correct?

Yes - I can ask a Sonos One “Alexa, Ask Plex to play Nirvana” (other ways of asking don’t seem to work, unlike Spotify where you can say “Play Nirvana from Spotify”).

The Sonos One has Alexa, Sonos has the Plex service, and Alexa has the Sonos and Plex skills. The Pi knows nothing of Alexa or Sonos.

I should mention that this is unsupported - it works, usually, but you’re kind of on your own. I would help as much as I am able, of course - I just mean if you contact tech support they won’t know much about it.

And where does your local library sit?

Ah. It appears I over-simplified. I used to have Plex Media Server on the Pi, but now it is on my nVidia Shield Pro (for on-the-fly video conversions). But the drives with the music/movies/TV are all ext4 volumes plugged into the Pi still, with SMB (v1, of course) sharing to the network at large.

Occasionally, Plex needs reauthorisation on Sonos (I think after Plex updates, but haven’t really confirmed this) and won’t play. When this happens, I revert to Sonos Music Library (using the app, not Alexa) which addresses the same SMB share until I can be bothered fixing Plex .

 

Although Alexa has a skill for the Shield, this doesn’t do much (similar to the Alexa power control that the Beam/Arc can add to your TV). It doesn’t relate to Plex and this all worked with the Plex server running on the Pi before I ever got the Shield.

"Common sense is the collection of prejudices acquired by age eighteen." - Albert Einstein
mmggffeeAuthor
Contributor I
May 7, 2021

awesome stuff thanks. I was also wanting to try roon and see how this works. The other issue I have is that my place isnt huge so i want to keep the footprint of things to the smaller scale. This was another reason for Pi integration. On a side note wanted to try PI as a private VPN and PI-HOLE too

Corry P
Sonos Staff
May 7, 2021

I nearly mentioned my pi-hole, but thought it crude :joy:

I personally recommend keeping a separate Pi device just for pi-hole - if you need to reinstall/reconfigure software and reboot, it will get in the way of DNS working on your network for other devices. Less software also makes pi-hole quicker and the Pi more stable. In addition, less than a fortnight ago, James and myself both updated pi-hole and it broke both our Linux installs - no more boot. It was easier for me to fix than it was for James just for this reason - I had nothing but Linux and pi-hole to reinstall. There’s no need to get a RPI4 for this task - a slower device will do.

Yes - the Pi makes for a great server as long as you’re not after performance. If you’re not a Linux expert, I recommend you look into Webmin - this allows you to configure Linux via a webpage - makes it easier to set up SMB, drives mounted at boot (I needed to do this when transmission-daemon was loading before USB drive autodetection), drive partitioning, and many other things.

 

Edit: changed “easy” to “easier”.

"Common sense is the collection of prejudices acquired by age eighteen." - Albert Einstein
Stanley_4
Grand Maestro
May 7, 2021

A Pi Zero W works great for Pi-Hole, just get a good 16 GB SD card and a quality power supply and it will run with no issues. If you want a wired connection a used Pi 3 is a good option.

Getting a second card and using the Pi’s built in card backup tool really reduces the risks of tweaking and updates.

I don’t put other things on my Pi-Hole Pi. Other folks seem to think the VPN option is a good fit and there is a good bit of discussion in the Pi-Hole forums on that. The NAS to SMBv1 gateway would also be a good fit.

pwt
Virtuoso
May 8, 2021

If you like tinkering at the command line and want to control Sonos from your Pi, SoCo-CLI allows you to play local audio files to any Sonos speaker:

https://github.com/avantrec/soco-cli#audio-files-on-the-local-filesystem

As for Pi-Hole, personally I run this in a Docker container. Easy to update, and easy to isolate from anything else running on the Pi:

https://hub.docker.com/r/pihole/pihole

4 x P:5 | Sub | 4 x P:1 | 3 x Connect | 2 x Boost | Connect:Amp | 2 x One | Amp | Move | Port | Era 300
Stanley_4
Grand Maestro
May 9, 2021

For controlling my Sonos from the Pi I use this:

http://pascalopitz.github.io/unoffical-sonos-controller-for-linux/

The armv7l.AppImage one works great, download, set to executable and click it.

chicks
May 9, 2021

For controlling my Sonos from the Pi I use this:

http://pascalopitz.github.io/unoffical-sonos-controller-for-linux/

The armv7l.AppImage one works great, download, set to executable and click it.

Yeah, the .deb version works on Chromebooks, too (with Linux enabled and ports open).  I’m not a fan of the UI, especially compared to the LMS Material Skin (or Jivelite on a Pi Zero WH with a nice touchscreen).

Corry P
Sonos Staff
May 11, 2021

For anyone running Pi-Hole, I recommend following the steps on this video: 

 

This adds “unbound” to your configuration and Pi-Hole no longer uses upstream DNS servers - it resolves requests itself and caches the result locally.

"Common sense is the collection of prejudices acquired by age eighteen." - Albert Einstein