Sonos - The Beginning

Posted on
Thu Feb 23, 2012 1:14 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Terry - never responded on how Vol Up and Down should work. I increment/decrement by 2 on each call.

Posted on
Thu Feb 23, 2012 3:33 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

That looks like its resolved the issues. Great work!

Only tested for a few minutes but all looks good.

Play/pause/stop and volume working!

Will check the stability over the next hour or so and will report in again.

Mat

Late 2018 mini 10.14

Posted on
Thu Feb 23, 2012 5:00 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

The following is after a reboot to make sure nothing untoward is going on.

Report after half an hour continuous use without touching controls, and all is solid. States are correctly reporting track and artist details etc

A significant improvement and defiantly a move from "proof of concept" to useable beta! Congrates :D :D 8)

I'll number potential issues for reference if that helps...(?)

Issue 1

When I start using the plugin controls, it's occasionally crashing to an extent. I can't yet identify the cause. Some are worse than others. Restart of plugin would not resolve issue. Restart of sonospy is only resolution. Occurred four times during "heavier than normal" use of controls.

Log only reported errors when sonospy stopped, before being restarted. I take this to mean sonospy had not crashed otherwise the plugin would have been reporting errors earlier.

The result generally is that all zones show the same status as the zone being controlled, but each is still controllable. If the controlled zone is paused, all zones status shows pause. If played, all zones show play status. The actual audable status of the zones doesn't change. On one occasion, all control was lost by the plugin.

I'm trying to isolate cause and circumstance, but may be linked (but is different from) issue 2 below.

Leave this one with me for now.

Issue 2

If I hit "play/pause" on a control page via an action group three or more times in quick succession (four times or more causes the error more frequently) other zones pause or start playing. Not only does their status change, they actually play or pause.

Hope this helps and excuse dyslexia


Regards

Mat
Last edited by mat on Thu Feb 23, 2012 6:00 pm, edited 1 time in total.

Late 2018 mini 10.14

Posted on
Thu Feb 23, 2012 5:41 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

My results are similar to Mat's. Only thing I would add is very slow response times after the first command is issued (which is almost immediate).

Posted on
Thu Feb 23, 2012 5:53 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Terry, when are you experiencing delays? When pressing play or pause? Or is the delay with the status update. Sonospy is not always immediate, but I'm not experiencing anything more than half a second? If you let me know what and when, Ill check it out here.

I know its jumping ahead but.....

Issue 3

When zones are linked, the track details on the zone that is added doesnt update. Nor does the status.

Late 2018 mini 10.14

Posted on
Thu Feb 23, 2012 9:26 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Glad it's getting better fellas. Will commit more time tomorrow to work on these issues. Appreciate the testing - I'm still excited about integrating Sonos - I hope SonosPy will not be an issue. I'm doing my best to avoid all the SOAP calls which would be a rewrite of a lot of SonosPy. Hopefully these bugs all revolve around timing.

Posted on
Thu Feb 23, 2012 9:54 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Mat

It was across all the commands. First vol up workd fine second up delayed or not at all.

I am going to reevaluate tomorrow when I have more time.

When I look at the sonoweb page, the selected zone currently playing changes to nothing or to one of the tracks in the queue at random and back again. On your system are the queues on the sonoweb page populated? Mine are all empty no matter what is in the queue of the player as shown on Sonos desktop. Are the sonospy and Sonos Controller systems supposed to stay on synch?

I am still not sure I have a stable sonospy install and I have not found a useful forum on sonospy.

Terry

Posted on
Fri Feb 24, 2012 7:34 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Unfortunately you cannot use the Sonospy web control page with this plugin active. The two will interfere with each other. I think there is a way to start Sonospy without launching the http server - will investigate that over the weekend. Bringing up the web page and even selecting a ZonePlayer will kill the thing.

As far as the Sonospy crash, there is a log file in the sonospy directory called pycpoint.log. Can you take a look and see if there is anything relevant at the point the crash occurred.

Thanks.

Posted on
Fri Feb 24, 2012 8:21 am
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

That could be a large part of my problems because I have been running both and trying to use both. I will retry today without it and will post the logs for you.

To be sure I understand where we are. You have to select tracks and load queue from Sonos interface and then use the plugin to play, stop, change vol etc? You can also use Sonos interface to play etc? If this is not correct please let me know.

Posted on
Fri Feb 24, 2012 8:48 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

You can use the Sonos desktop or mobile application as much as you want - there will be no problem there as those apps are communicating directly with the ZonePlayers. With SonosPy, the plugin is basically consuming the communications so we can't have the Sonospy web interface interfere with that. Knowing that we hav to carefully keep communications single threaded is the critical bit of information.

Posted on
Fri Feb 24, 2012 11:39 am
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Retested without touching sonospyweb page

Issued through sonosdesktop all commands play,stop play pause next etc. on three zones. The statuses of all the zone devices in indigo changed correctly. There was a consistent 2 to 4 sec lag.

Issued action group commands and all appeared to work.

Looked at event log and it was showing a continuous stream of errors a sample of which are:


Sonos Error Error getting ZonePlayer data: Guest%20Room%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Library%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Master%20Bedroom%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Office%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Portable%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Shop%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Sitting%20Room%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Guest%20Room%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Library%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Master%20Bedroom%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Office%20%28ZP%29
Sonos Error Error getting ZonePlayer data: Portable%20%28ZP%29

Interesting that the controls using action groups still continued to function. Even with the error stream running I was able to issue successful action group play and stop commands and the sonos zone responded correctly.

I tried reload, disable/enable on the plugin with no change in the errors. The only thing that stopped them was a stop and restart on sonospy_web.

I decided to try to find what caused the errors to start so I did the following

1. stopped and restarted sonospy_web

2. Let it set there without doing anything in indigo or sonos

3. After 10 minutes 47 seconds, the errors started again.

$. Stopped testing because until this is fixed any other test results would be suspect.

Here are the last few lines of the pycpoint.log and I have attached the entire log for your use.

Unhandled exception in thread started by <bound method SSDPServer._datagram_received of <brisa.upnp.ssdp.SSDPServer object at 0x10d598d50>>
Traceback (most recent call last):
File "/Users/housemini/sonospy/sonospy/brisa/upnp/ssdp.py", line 214, in _datagram_received
self._discovery_request(headers, (host, port))
File "/Users/housemini/sonospy/sonospy/brisa/upnp/ssdp.py", line 274, in _discovery_request
host, port)
File "/Users/housemini/sonospy/sonospy/brisa/core/network_senders.py", line 69, in send_delayed
t.start()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 473, in start
thread.error: can't start new thread
Unhandled exception in thread started by <bound method SSDPServer._datagram_received of <brisa.upnp.ssdp.SSDPServer object at 0x10d598d50>>
Traceback (most recent call last):
File "/Users/housemini/sonospy/sonospy/brisa/upnp/ssdp.py", line 214, in _datagram_received
self._discovery_request(headers, (host, port))
File "/Users/housemini/sonospy/sonospy/brisa/upnp/ssdp.py", line 274, in _discovery_request
host, port)
File "/Users/housemini/sonospy/sonospy/brisa/core/network_senders.py", line 69, in send_delayed
t.start()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 473, in start
thread.error: can't start new thread

Terry






















I decided to try to find out what caused the error stream to start

Posted on
Fri Feb 24, 2012 11:41 am
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

It would not let me post log file. Pm me and I will send if you need.

Posted on
Fri Feb 24, 2012 1:22 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

The post of errors was helpful. Seems that the plugin is keeping threads open too long in the form of url requests and gets backed up after a few minutes. Once we get over 100, results would be unpredictable. I'm not sure what the thread limit in Python 2.7 is, but it definitely exposes a bug in my code.

Posted on
Fri Feb 24, 2012 2:12 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Ahhhh, that might be an issue with 100 treads approx limit. I have over 2,000 python threads open!

It might be me though, as I'm adapting a plugin to run dmx lighting control.

Will check it out, just having a cup of tea after getting my son to bed.

Late 2018 mini 10.14

Posted on
Fri Feb 24, 2012 2:25 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Yep, looks like the plugin is eating thread for breakfast....sorry.

I'd estimate at about 5-7 new threads per second.

Late 2018 mini 10.14

Page 6 of 37 1 ... 3, 4, 5, 6, 7, 8, 9 ... 37

Who is online

Users browsing this forum: No registered users and 2 guests

cron