Sonos with Linux detailed Howto



Show first post
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.

50 replies

Userlevel 2
Is the Web Sonos Controller still maintained? It works, more or less, but there are a lot of errors generated from the perl code. This one happens quite a lot: Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./sonos.pl line 1798. Anybody still using the code, making fixes?
Userlevel 2
I just finished following this guide, and ran into some time consuming problems which I finally resolved. I'll list them here so as to possibly help someone else who runs into similar issues.

At the end of the guide, I would type \\server\musicshare into the sonos desktop controller software, but my computer was unable to find the share, or even connect to "server". The command smbtree in the terminal returned nothing.

It turns out the line "interfaces = lo eth0" in the smb.conf file was the root cause. Deleting this entry from the file resolved the problem.

Also, restarting the server using the command mentioned in the guide: "sudo /etc/init.d/samba restart" returned for me "sudo: /etc/init.d/samba: command not found"

The command "sudo service smbd restart; sudo service nmbd restart" on the other hand does work.

Thanks dougalf for the guide, without it I would have probably been at a loss.
Userlevel 2
Bingo! Thank you very much Majik-Keith. I'm up and running. I had been trying 'add music stored on this pc' option as thats where the files were and as nothing showed up when i browsed the network connections i didn't pursue that enough. so thanks for the guidance. - Niallo
Hello I'm having a problem setting up my music library. I'm running the sonos desktop controller in wine on ubuntu10.10. The controller can see my zone players and has control over them but cannot set up the music library. I follow the wizard to select my music source;

The Desktop Controller Music Setup wizard will not work under Wine.

The Wizard basically configures standard Windows Filesharing. It's a shortcut for those who are running windows, but it's not essential. You can do this manually on any OS.

I have used samba to share the target music directory (at least i think i have). I know i must be doing something stupid or not doing something obvious so any suggestions would be greatly appreciated. Thanks


If Samba is set up then you really only need to point Sonos at the shares you have created. To do this from the DTC:

1. Select the "Music" menu

2. Select "Setup Music Library..."

3. In the popup dialogue window click the "Add a share" button

4. In the next page, select "Add music stored in folders that are currently shard on the network" and click "Next >"

5. Enter the path to the share. Note that Browse probably won't work. The format of the path is shown in the dialogue box. You will need to know the share hostname and share name. Also if you have configured secure access, you'll need to enter the username and password here.

(As a hint, if you open a command shell and type "smbtree" then it should list all of the shares on your network. You may need to enter your password).

After that, Sonos should start indexing your music collection.

If you have something other than the Desktop controller, such as an iPod controller or CR200, it's actually easier to use that to set up the music share as the browsing normally works on these.

Cheers,

Keith
Userlevel 2
Hello I'm having a problem setting up my music library. I'm running the sonos desktop controller in wine on ubuntu10.10. The controller can see my zone players and has control over them but cannot set up the music library. I follow the wizard to select my music source; when i add the directory to where i have some music (on the same pc) the wizard responds with a message - " Windows Fire Wall and File sharing - the desktop controller needs to adjust the following windows settings to allow your zone players to access your music files on this computer:" it does not actually list any settings and when i press next the sonos app crashes. I have used samba to share the target music directory (at least i think i have). I know i must be doing something stupid or not doing something obvious so any suggestions would be greatly appreciated. Thanks
Sorry Snille I've just followed my own HOWTO and I get the same problem as you. I'm very embarrassed. I've fixed the post now but it may be too late for you to recover 😞 I think the problem is that Purple (which I didn't write by the way!) relies on the CPAN rather than the Ubuntu Perl libraries. I patched it up a little by
code:

sudo apt-get remove libsoap-lite-perl libxml-simple-perl

then do it properly
code:
sudo perl -MCPAN -e "install Data::Dumper"
sudo perl -MCPAN -e "install SOAP::Lite"
sudo perl -MCPAN -e "install LWP::UserAgent"
sudo perl -MCPAN -e "install HTTP::Daemon"
sudo perl -MCPAN -e "install XML::Simple"
sudo perl -MCPAN -e "install HTML::Template"l

It takes some time and might give some errors which I just ignored.
It's not perfect because the playlist isn't displayed even though it works fine. I think that the Ubuntu install pulled in some extra perl dependencies but I can't figure out what they are now. I hope you can get this far and that it's good enough for you?

Alternatively you could do
code:
sudo apt-get install mediatomb

I don't remember doing any config. This turns your music into a UPnP media source. The Sonos box is already a media player so all you need is a controller. If you have a Nokia n900 then Zhaan works well although I don't find it as handy for searching as Purple. Perhaps you can find another UPnP controller in the Ubuntu repositories? I'm afraid I don't have time to experiment at the moment.

I know that the person behind Purple used to visit these forums, I don't know if you can get their attention and ask for their help in patching your Perl install....?

Good luck and sorry again,
cheers,
Dougal
Userlevel 2
Hi dougalf,
I hope you still develop a bit on this one... :)
I'm trying to run your perlscript on one of my servers. After some smaller installation problems I got it to run. But it exists all the time with this error message: "Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./sonos.pl line 1798.". I have tried different "skins" but it is the same error message for most of them. However the simplest skins seams to work...

I hope this makes sense and that you still work on this nice scripts... 🙂
The Sonosweb app has it's uses, but for a desktop environment, the Sonos native Desktop Controller is far better.

Great you hear you got it working!

Cheers,

Keith
Userlevel 3
Badge +2
Actually, it doesn't have to be on the same box.

My music is also on a NAS and I used to run sonosweb on a separate machine.

I think I misunderstood.

I'm not very familiar with Linux - during the config of SonosWeb it asks for the directory where the music is so it can index it. I tried putting in the location, which is a samba share, so 'smb://music', but it said that wasn't a directory.

I tried various ways of mounting the location into a normal directory path, and although that seemed to work, SonosWeb still wouldn't do its thing.

Using WINE and SONOS Desktop Controller just worked straight away.

Dave
Userlevel 2
I also tried the perl sonosweb solution - before realising that it has to be running on the same box as the music resides (my MP3s are on a Buffalo NAS).


Actually, it doesn't have to be on the same box.

My music is also on a NAS and I used to run sonosweb on a separate machine.
Userlevel 3
Badge +2
I tried the java-based controller on my wife's Ubuntu laptop. It just about worked, but was very sluggish and took multiple double-click and button clicks to get it to play.

I also tried the perl sonosweb solution - before realising that it has to be running on the same box as the music resides (my MP3s are on a Buffalo NAS).

The WINE + Sonos Desktop Controller solution is perfect and works without the hassle of having to configure scripts etc.

Dave
Userlevel 2

What we really need is a cross-platform controller, of course.


There is a java-based controller than runs on Linux, but it's feature set is quite small, and I haven't had time to work on it much recently...

http://forums.sonos.com/showthread.php?t=10499
Userlevel 2
If you are using ubuntu, do the following:

Install Wine (a guide can be found on the official Wine homepage, google)
Download the Sonos setup file from the main side (what to buy->Controllers->Sonos Desktop Controller for Windows->Download)
Double click the file you downloaded and the install wizard will show
As soon as it is needed, Sonos will prompt you that you need Samba, Ubuntu will guide you through the settings, and you will avoid the need of a password

alot easier, since you completely avoid to use the Console 😛
Userlevel 2
Sonos without Windows
I have a Linux server running Debian, a close relation of Ubuntu and a laptop running Ubuntu. I bought a Sonos ZP90 but not the controller. I found various bits and pieces on the internet on how to get this working but no complete howto so I thought it would be useful to others if I created a detailed guide for Google to find


Note that you can also run the Windows desktop controller with WINE. It works for 95% of the functionality.

What we really need is a cross-platform controller, of course.