henkelis / sonospy

Sonospy is a UPnP control point and Windows Media proxy for the Sonos multi-room audio system.
GNU General Public License v3.0
113 stars 16 forks source link

Almost there .. sonos controllers don't see sonospy .. only plays single track at a time #79

Open delbydev opened 9 years ago

delbydev commented 9 years ago

Fantastic job of creating this - really well done.

My environment: FreeNAS 9.2.1 | Jail contains Python 2.7 | Locale set to UTF for jail SQLite database schema created and populated - Found 130 ish "missing" tracks - I think because the tags are borked. Have removed the files from the archive to enable progress Rescanned - entries for the "missing" files still there.

Presumably need to remove the database and start again to remove the "missing" tracks from catalogue? - Not done yet - want to progress as far as possible without "restarting" Scanning does not report any errors even with Python verbose mode. - so all good

Main sonospy page renders nicely (port 8000) Shows my sonos ZP in the renderers Shows my plex media server (hosted on the same FreeNAS, different Jail) Shows the music catalogue on the plexmedia server Plays single track on selected renderer - Sonos Controllers show that the player is playing selected track.

Problem 1 - even when right clicking on an album name and selecting "Play Now don't queue" - it only plays the first track in the album and none of the others Problem 2 Sonos Controllers (OS X, Win 7, Android) cannot see the sonospy service.

Mrs delbydev is happy with the port 8000 page - she can finally see all tracks by a single artist across all albums in one "page" -

But? Where should I start looking to:

get the sonospy port 8000 page to Play multiple tracks without manual selection of each track? Enable Sonos Controllers to see the sonospy service?

Help really appreciated -

Sincerely

Derrin

delbydev commented 9 years ago

Just to add - I am probably not being thorough enough - but I cannot seem to link in my understanding how to open data traffic on the ports 10243, 10244, 50101 -> 50103 etc. I have started sonospy_proxy as follows

sonospy_proxy -wSonospy=Henkelis,mortsonos.db and left the ini files largely untouched.

henkelis commented 9 years ago

Hi,

Regarding the erroneous files - if you remove files the next scan should delete them from the database, but that can fail if you have had runs ending in error. You can run scan with the -r option, which will keep the scanned tags but regenerate the rest of the database - then run another scan and it should remove entries for the removed files.

With the command line you're using the Windows Media Player clone (-wSonospy) - to get that to show up in Sonos controllers you need to turn that on in the controller settings - Advanced/Music Servers/Show Windows Media Servers. It doesn't appear that your FreeNAS has a firewall, so you shouldn't have to open any ports.

I haven't tested the browser interface for quite a while, as I didn't think anyone was using it - it certainly used to allow playing of whole albums, but it's possible that Sonos have changed something (I'll have a look when I get some time). Now that the SMAPI interface is available, you can create whatever indexes you want and have them on the Sonos controllers - so you ought to be able to create an index showing all tracks by an artist for instance (I'll have to check how to do that). To enable the SMAPI interface use -sSonospy rather than -wSonospy (you can run them both at the same time too, as well as running multiple SMAPI interfaces) - then go to More Music on a Sonos controller and find the Sonospy service (by whatever name you use on the command line) and add it (and it should appear on the main page).

Mark.

delbydev commented 9 years ago

Hi Mark

Thanks very much responding -

After getting the .ini files in a mess I started from scratch and reinstated the build from the tar file.

The Web interface is operating correctly - it can see all sonos zone players and UPNP media servers on the LAN The Web Interface is not (and I now notice has never) shown any catalogue for the Sonospy database I have rendered and surfaced using sonos_proxy - it is showing all renderers and servers on the LAN except sonospy The Web interface "single track play behaviour" I mentioned is when I select a track from a plexmediaserver on one of the Sonos Zone players. What I notice is that I have not as yet managed to propagate the index built in mortmusic.db - should this catalogue be visible in the web interface ? Have started with -s and network ports are now opened - thank you - nearly there but not quite.

Recall of set up summary

Scanned music library evidence

root@sonospy:~/sonospy-msrefactor5 # sqlite3 sonospy/mortmusic.db sqlite> .tables Albumartist GenreArtistAlbumTrack
AlbumartistAlbum TrackNumbers
AlbumartistAlbumTrack albums
AlbumartistAlbumsonly albumsonly
... sqlite> select count(*) from tags; 12553 sqlite> .exit

Left the .ini files as shipped e.g. pycpoint.ini [INI] controlpoint_port=50101 proxy_port=50102 comms_port=50103 wmp_proxy_port=10243 wmp_internal_port=10244 internal_proxy_udn=uuid:5e0fc086-1c37-4648-805c-ec2aba2b0a27

services started : as follows: root@sonospy:~/sonospy-msrefactor5 # ./sonospy_proxy -wSonospy=MortonMusic,mortmusic.db,pycpoint.ini

root@sonospy:~/sonospy-msrefactor5 # ./sonospy_proxy -sSonospy=MortonMusicSP,mortmusic.db,pycpoint.ini

Unix Processes root@sonospy:~/sonospy-msrefactor5 # ps

PID TT STAT TIME COMMAND 65161 0 SJ 0:00.09 csh 65809 0 IJ 0:32.52 python web2py/web2py.py -L options.py (python2.7) 66071 0 RJ 8:50.10 python pycpoint.py -p -wSonospy=MortonMusic,mortmusic.db,pycpoint.ini (python2.7) 66149 0 IJ 3:56.80 python pycpoint.py -p -sSonospy=MortonMusicSP,mortmusic.db,pycpoint.ini (python2.7) 66224 0 R+J 0:00.00 ps 76691 4- SJ 92:44.72 python pycpoint.py (python2.7)

Network Ports Opened (now see WMP port opened 10243 - after using -s switch - thank you) BUT NOT 10244 - I think this is the missing link?

root@sonospy:~/sonospy-msrefactor5 # netstat -a | grep -v TIMEWAIT Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 sonospy.8000 10.234.56.111.60814 ESTABLISHED tcp4 0 0 sonospy.8000 10.234.56.111.60805 ESTABLISHED tcp4 0 0 sonospy.8000 10.234.56.111.60786 ESTABLISHED tcp4 0 0 .10243 . LISTEN tcp4 0 0 localhost.50104 . LISTEN tcp4 0 0 .8000 . LISTEN tcp4 0 0 localhost.50101 . LISTEN udp4 0 0 .7900 .
udp4 0 0
.2149
.
udp4 0 0
.1900 .
udp4 0 0
.10218
.
udp4 0 0
.syslog .
udp6 0 0
.syslog
._
Active UNIX domain sockets Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr fffffe0147ba7960 dgram 0 0 0 fffffe03399df780 0 0 fffffe03399df780 dgram 0 0 fffffe0166e1a1f8 0 fffffe0147ba7960 0 /var/run/logpriv fffffe01feb10870 dgram 0 0 fffffe02fc9359d8 0 0 0 /var/run/log

Thanks again - but could you confirm the commands above are correct please?

Derrin

delbydev commented 9 years ago

Nudge - any ideas why WMP tcp port 10244 is not listening please?

henkelis commented 9 years ago
The Web interface is operating correctly - it can see all sonos
zone players and UPNP media servers on the LAN
The Web Interface is not (and I now notice has never) shown any
catalogue for the Sonospy database I have rendered and surfaced
using sonos_proxy - it is showing all renderers and servers on the
LAN except sonospy
The Web interface "single track play behaviour" I mentioned is
when I select a track from a plexmediaserver on one of the Sonos
Zone players.
What I notice is that I have not as yet managed to propagate the
index built in mortmusic.db - should this catalogue be visible in
the web interface ?
Have started with -s and network ports are now opened - thank you
- nearly there but not quite.

I'll have to check what behavior is working for the web interface - I haven't tested that in a long time, whilst the media server has changed quite a bit, as has Sonos behavior in this area.

services started : as follows: root@sonospy:~/sonospy-msrefactor5 # ./sonospy_proxy -wSonospy=MortonMusic,mortmusic.db,pycpoint.ini

root@sonospy:~/sonospy-msrefactor5 # ./sonospy_proxy -sSonospy=MortonMusicSP,mortmusic.db,pycpoint.ini

You can start both proxies on the one command line if you like (just include both -w and -s options). You should add -r to the command line too.

Port 10244 is used by -w but not -s - if you can see MortonMusic in a Sonos controller (the -w option) and play music from it, then it is working ok.