Sonos plugin integration

Hi Garrett.

I come back with a feedback regarding the Sonos plugin integration. Sorry, I know, it is very late !
My tests have been run with the new version 3.1.3.0 proposed by the Play Store.

It is working well but not perfectly.

[ul][li]
After sending a command, it seems that you are refreshing data too fast. It is too fast for certain Web services. The consequence is that data is not refreshed in certain cases… What is the delay used ?
[/li]
[li]
OFF and ON buttons are not working. It leads to an error (not implemented). There is no ON/OFF feature with Sonos. What was your idea with these buttons ? What action are you calling ?
[/li]
[li]
I have an album named “Neverworld’s End”. What is displayed is “Neverworld’s End”.
[/li]
[li]
The two buttons on the second line are for “repeat all” and “shuffle” ? They are not working as expected. What parameter value are you using when calling SetPlayMode ? Sonos is using a non-standard value. Should these buttons change color (blue) to show the current state ? It is not working…
[/li]
[li]
Display of the album art is not always working, but I have not a clear case to explain. Sometimes, even Sonos could make time to refresh its own album art. So maybe you refresh data at “wrong” time.
[/li]
[li]
When I change the volume, as soon as I release the slider, I first see the slider moving to my previous position. Then the volume is adjusted and the slider is adjusted again to its new position. It is working but the behaviour is a little strange.
[/li][/ul]

It would be very cool if you could add the same device for this new type “urn:dlna-org:device:DLNAMediaController:1”.

Thank you for the feedback. I’m currently mobile right now, but I’ll respond to your post in me detail when I get to a computer.

  • Garrett

[quote=“lolodomo, post:1, topic:177749”]Hi Garrett.

I come back with a feedback regarding the Sonos plugin integration. Sorry, I know, it is very late !
My tests have been run with the new version 3.1.3.0 proposed by the Play Store.

It is working well but not perfectly.

[ul][li]
After sending a command, it seems that you are refreshing data too fast. It is too fast for certain Web services. The consequence is that data is not refreshed in certain cases… What is the delay used ?
[/li][/ul][/quote]

What should be a reasonable delay between actions? This will not be an issue with auto refresh enabled, but for those who do not want auto refreshing turned on, a suggested delay amount would help.

[quote=“lolodomo, post:1, topic:177749”][ul][li]
OFF and ON buttons are not working. It leads to an error (not implemented). There is no ON/OFF feature with Sonos. What was your idea with these buttons ? What action are you calling ?
[/li][/ul][/quote]

This was a duplicate of the squeezebox interface and I’ll remove them. Since I do not own a sonos, I was not aware they can not be turned off / on.

[quote=“lolodomo, post:1, topic:177749”][ul][li]
I have an album named “Neverworld’s End”. What is displayed is “Neverworld&pos;s End”.
[/li][/ul][/quote]

I would assume you are using some sort of escaping? I am currently just displaying what is given to me.

[quote=“lolodomo, post:1, topic:177749”][ul][li]
The two buttons on the second line are for “repeat all” and “shuffle” ? They are not working as expected. What parameter value are you using when calling SetPlayMode ? Sonos is using a non-standard value. Should these buttons change color (blue) to show the current state ? It is not working…
[/li][/ul][/quote]

The repeat button uses “REPEAT_ONE” and the shuffle button uses “SHUFFLE”. Currently the buttons do not show their current state.

[quote=“lolodomo, post:1, topic:177749”][ul][li]
Display of the album art is not always working, but I have not a clear case to explain. Sometimes, even Sonos could make time to refresh its own album art. So maybe you refresh data at “wrong” time.
[/li][/ul][/quote]

The album issue can be a few things. If the current album art variable hasn’t changed or the app hasn’t refreshed, it will not update. The image is also cached for 5 minutes. But as long as the value has changed and the app is aware of the new album art value, it should reload the image. Also depends on if you are on the local network or remote. If the album art is on the local network and you are remote, it will not load the album art and use a default icon.

[quote=“lolodomo, post:1, topic:177749”][ul][li]
When I change the volume, as soon as I release the slider, I first see the slider moving to my previous position. Then the volume is adjusted and the slider is adjusted again to its new position. It is working but the behaviour is a little strange.
[/li][/ul][/quote]

This unfortunately is a behavior of android and the use of databases and their adapters. I do not modify the database when you perform the action in the app. I wait until the data is refreshed to update the controls. If I were to update the values directly in the database of the app and the command was never acknowledged on Vera’s side, then the app would be out of sync.

I have intentions of adding it. I will add it as soon as things stabilize for the plugin. I will add it to my development vera for testing. Is it pretty much dead on with controls of the Sonos?

  • Garrett

[quote=“garrettwp, post:3, topic:177749”][quote=“lolodomo, post:1, topic:177749”][ul][li]
After sending a command, it seems that you are refreshing data too fast. It is too fast for certain Web services. The consequence is that data is not refreshed in certain cases… What is the delay used ?
[/li][/ul][/quote]

What should be a reasonable delay between actions? This will not be an issue with auto refresh enabled, but for those who do not want auto refreshing turned on, a suggested delay amount would help.[/quote]

Ok, I will test with auto refresh too. I imagine this setting is OFF by default ?
For the appropriate delay, I have no immediate answer but I will give you a delay later.

[quote="lolodomo, post:1, topic:177749"][ul][li] I have an album named "Neverworld's End". What is displayed is "Neverworld's End". [/li][/ul][/quote]

I would assume you are using some sort of escaping? I am currently just displaying what is given to me.

You’re right, the escaping should be done by me. I will check and fix that.

[quote="lolodomo, post:1, topic:177749"][ul][li] The two buttons on the second line are for "repeat all" and "shuffle" ? They are not working as expected. What parameter value are you using when calling SetPlayMode ? Sonos is using a non-standard value. Should these buttons change color (blue) to show the current state ? It is not working... [/li][/ul][/quote]

The repeat button uses “REPEAT_ONE” and the shuffle button uses “SHUFFLE”. Currently the buttons do not show their current state.

Here are the modes supported by Sonos:
NORMAL
REPEAT_ALL
SHUFFLE
SHUFFLE_NOREPEAT

So you can see that REPEAT_ONE is not supported. Sonos only implements REPEAT_ALL.
SHUFFLE is in fact SHUFFLE+REPEAT_ALL
SHUFFLE_NOREPEAT is SHUFFLE
Sonos allows shuffle and repeat at the same time.
So the algorythm is a little less easy and you have to consider the current value .

[quote="lolodomo, post:1, topic:177749"]It would be very cool if you could add the same device for this new type "urn:dlna-org:device:DLNAMediaController:1".[/quote]

I have intentions of adding it. I will add it as soon as things stabilize for the plugin. I will add it to my development vera for testing. Is it pretty much dead on with controls of the Sonos?

  • Garrett

Exactly the same controls as Sonos (meaning without ON and OFF buttons).
For shuffle and repeat controls, you should keep your current implementation, meaning something different from the Sonos.

[quote=“garrettwp, post:3, topic:177749”][quote=“lolodomo, post:1, topic:177749”][ul][li]
OFF and ON buttons are not working. It leads to an error (not implemented). There is no ON/OFF feature with Sonos. What was your idea with these buttons ? What action are you calling ?
[/li][/ul][/quote]

This was a duplicate of the squeezebox interface and I’ll remove them. Since I do not own a sonos, I was not aware they can not be turned off / on.[/quote]

But it would be ok if you can keep an indication if the Sonos is ON or OFF. You can get this information from the boolean variable SonosOnline (urn:micasaverde-com:serviceId:Sonos1).

For the DLNA Media Controller plugin, the variable is Online (urn:dlna-org:serviceId:DLNAMediaController1).

lolodomo,

I changed the repeat button to “REPEAT_ALL” and shuffle to “SHUFFLE_NOREPEAT”. Is this ok? I will add the DLNA MediaController support as it should be pretty simple to integrate. I will get this into the next alpha build which should be released in the next day or two.

  • Garrett

[quote=“lolodomo, post:4, topic:177749”]

[quote=“lolodomo, post:1, topic:177749”][ul][li]
I have an album named “Neverworld’s End”. What is displayed is “Neverworld’s End”.
[/li][/ul][/quote]

I would assume you are using some sort of escaping? I am currently just displaying what is given to me.

You’re right, the escaping should be done by me. I will check and fix that.[/quote]

I fixed that on my side.

[quote=“garrettwp, post:6, topic:177749”]lolodomo,

I changed the repeat button to “REPEAT_ALL” and shuffle to “SHUFFLE_NOREPEAT”. Is this ok?[/quote]

That will better than now.
But it will noit allow REPEAT+SHUFFLE.

Are they toggle buttons or not ?

I will add the DLNA MediaController support as it should be pretty simple to integrate. I will get this into the next alpha build which should be released in the next day or two.
  • Garrett

I will give you a feedback.

I tried yesterday with auto-refresh, and it is working.

We have just to adjust the refresh delay when auto-refresh is off.
What’s your current value ?
We could try with 3 seconds.

[quote=“lolodomo, post:8, topic:177749”][quote=“garrettwp, post:6, topic:177749”]lolodomo,

I changed the repeat button to “REPEAT_ALL” and shuffle to “SHUFFLE_NOREPEAT”. Is this ok?[/quote]

That will better than now.
But it will noit allow REPEAT+SHUFFLE.

Are they toggle buttons or not ?

I will add the DLNA MediaController support as it should be pretty simple to integrate. I will get this into the next alpha build which should be released in the next day or two.
  • Garrett

I will give you a feedback.[/quote]

They are toggle buttons, but they are either on / off.

  • Garrett

Got the original to run on my older Kindle Fire… really great!!!

I’m just confirming that you don’t have Sonos integration for that version?

thanks… nice work.

I do not support the order version any more and have not in some time. Sonos support is only recently.

  • Garrett

Garrett,

I tried the Sonos and DLNA support with the last alpha version.

Volume slider is now working perfectly 8)

For the Sonos, the repeat button still does not work unfortunately, while the shuffle button is ok.

I would like that you try to reduce the refresh delay before updating the screen after a button is pushed. I know that you increased this delay after one of my request, but now I have the feeling that the delay is really too much big. The delay seems to be around 5 seconds. We could try with 3 seconds.

Regarding the DLNA plugin, like for the Sonos plugin, you can erase the ON and OFF buttons.

For the DLNA plugin, you should adjust your slider as the volume range is not 0-100 for all renderers.
I have defined two variables: MinVolume and MaxVolume.
You could first read the value of these 2 variables and use 0-100 by default if the variables are not set.

[quote=“lolodomo, post:13, topic:177749”]Garrett,

I tried the Sonos and DLNA support with the last alpha version.

Volume slider is now working perfectly 8)

For the Sonos, the repeat button still does not work unfortunately, while the shuffle button is ok.

I would like that you try to reduce the refresh delay before updating the screen after a button is pushed. I know that you increased this delay after one of my request, but now I have the feeling that the delay is really too much big. The delay seems to be around 5 seconds. We could try with 3 seconds.

Regarding the DLNA plugin, like for the Sonos plugin, you can erase the ON and OFF buttons.[/quote]

I am not sure how to solve the repeat as I do not own a sonos and would be hard to fix the problem without knowing what is not working.

The refresh rate is set for 3 seconds already for all actions. Should I bring this down to 2 seconds?

I removed the on / off buttons.

  • Garrett

[quote=“lolodomo, post:14, topic:177749”]For the DLNA plugin, you should adjust your slider as the volume range is not 0-100 for all renderers.
I have defined two variables: MinVolume and MaxVolume.
You could first read the value of these 2 variables and use 0-100 by default if the variables are not set.[/quote]

I’ll see what I can do. This will require a little bit of work to implement.

  • Garrett

Yes, please try in the next alpha.
Is 2 seconds the delay you use for all the application, or only for the Sonos plugin ?

Here are the rules:

State Shuffle OFF Repeat OFF; to toggle Shuffle use SHUFFLE_NOREPEAT; final state Shuffle ON Repeat OFF
State Shuffle ON Repeat OFF; to toggle Shuffle use NORMAL; final state Shuffle OFF Repeat OFF
State Shuffle OFF Repeat OFF; to toggle Repeat use REPEAT_ALL; final state Shuffle OFF Repeat ON
State Shuffle OFF Repeat ON; to toggle Repeat use NORMAL; final state Shuffle OFF Repeat OFF
State Shuffle ON Repeat OFF; to toggle Repeat use SHUFFLE; final state Shuffle ON Repeat ON
State Shuffle ON Repeat ON; to toggle Repeat use SHUFFLE_NOREPEAT; final state Shuffle ON Repeat OFF
State Shuffle OFF Repeat ON; to toggle Shuffle use SHUFFLE; final state Shuffle ON Repeat ON
State Shuffle ON Repeat ON; to toggle Shuffle use REPEAT_ALL; final state Shuffle OFF Repeat ON

I made the change to 2 seconds. It varies based on the device. The AVTransport, MediaNavigation, and Renderingcontrol are all set the same (now 2 seconds). This is only the case when auto refresh is not enabled. When auto refresh is enabled, updates will happen as they come in.

Let me study the different states as you listed, a little confusing to understand, but I’ll see what I can do.

  • Garrett

Garrett.

I will change Sonos device type, probably to urn:schemas-micasaverde-com:device:Sonos:1
Could you please take into account this change in the next alpha version ?