Release - Sonos Addon

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
chrismcb Offline
Junior Member
Posts: 5
Joined: Jun 2014
Reputation: 0
Post: #106
(2014-06-09 14:20)rob_webset Wrote:  Files stored on your local network should still display OK - it's just the steamed ones will not display information (but the controls still work)
Unfortunately, I rarely use my local network store anymore - Spotify and TuneIn Radio are mostly what's played through my Sonos network.
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #107
Hi All,

The latest version has been published, so should be available soon.

Code:
v1.0.8
- Make sure the Play/Pause button has focus after Play/Pause selected
- Stop screensaver starting when using controller
- Display the next track if not in random play order
- Support auto-pause of Sonos when XBMC media starts
- Add support for Random, Repeat and Crossfade commands
- Add option to automatically reset the IP Address based on the Zone
- Add shortcut to controller from the plugin

Enjoy!

Rob
find quote
thos Offline
Member
Posts: 54
Joined: Dec 2011
Reputation: 0
Post: #108
Thanks Rob, look forward to v1.0.8

What's your view on this other thing - is it Gotham or Skin related?
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #109
(2014-06-11 22:31)thos Wrote:  Thanks Rob, look forward to v1.0.8

What's your view on this other thing - is it Gotham or Skin related?

If it's happing for several skins - then most probably a change in Gotham - you could always do a post for Gotham and see if any of the Gotham Developers can help you.

Rob
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #110
(2014-06-11 22:31)thos Wrote:  Thanks Rob, look forward to v1.0.8

What's your view on this other thing - is it Gotham or Skin related?

I have updated the following post on how to work around this:

http://forum.xbmc.org/showthread.php?tid...pid1733865

Rob
find quote
bruddha Offline
Junior Member
Posts: 3
Joined: Nov 2010
Reputation: 0
Post: #111
(2014-05-28 10:03)rob_webset Wrote:  
(2014-05-19 11:23)bruddha Wrote:  Great addon, thanks. I have a request which is absolutely essential for my usecase. I connected a raspberry running XBMC to my TV. The sound of my raspberry is output by HDMI. The line out of my TV is then connected to the line in of a Play5. This means, the volume control of XBMC doesn't change the HDMI volume. I always have to pick the sonos controller to change the volume. Connecting the analog output of the rasperry directly to the play 5 is no option since I also want to use the Play5 to listen to live TV (which I don't do in XBMC yet). Is it possible to make the volume control of XBMC changing the volume of the sonos player?

Hi bruddha,

I have been working on this for you - but am having some "delay issues". In order to overwrite the remote control, it then calls a script that then contacts the Sonos speaker to increase/decrease the volume. This causes massive delays that just make it un-usable!

For your case, do you think it is enough to "link" the volume of XBMC to the Volume of the Sonos. So if you set the volume on XBMC to 50%, then it will also set the Sonos volume to 50%? - Then if you drop it to 25%, then it will set Sonos to 25%.

Please let me know if this would cover what you wanted?

Rob
hi rob
sorry for the late answer (forgot to subscribe). what you proposed sounds absolutely reasonable. I would even prefer your volume "linking" solution. It would be great to have this in your next update.
I'm looking forward to use my TV sonos the way it is meant to. Thank you.

(2014-05-28 10:03)rob_webset Wrote:  
(2014-05-19 11:23)bruddha Wrote:  Great addon, thanks. I have a request which is absolutely essential for my usecase. I connected a raspberry running XBMC to my TV. The sound of my raspberry is output by HDMI. The line out of my TV is then connected to the line in of a Play5. This means, the volume control of XBMC doesn't change the HDMI volume. I always have to pick the sonos controller to change the volume. Connecting the analog output of the rasperry directly to the play 5 is no option since I also want to use the Play5 to listen to live TV (which I don't do in XBMC yet). Is it possible to make the volume control of XBMC changing the volume of the sonos player?

Hi bruddha,

I have been working on this for you - but am having some "delay issues". In order to overwrite the remote control, it then calls a script that then contacts the Sonos speaker to increase/decrease the volume. This causes massive delays that just make it un-usable!

For your case, do you think it is enough to "link" the volume of XBMC to the Volume of the Sonos. So if you set the volume on XBMC to 50%, then it will also set the Sonos volume to 50%? - Then if you drop it to 25%, then it will set Sonos to 25%.

Please let me know if this would cover what you wanted?

Rob
Wow, after reading further i've seen you already released it. I have to try it when i'm home. Thanks again.
(This post was last modified: 2014-06-16 17:28 by bruddha.)
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #112
(2014-06-16 17:25)bruddha Wrote:  hi rob
sorry for the late answer (forgot to subscribe).

No problems - good to hear back from you - please let me know how you get on.

Thanks

Rob
find quote
TH3 M0L3 Offline
Member
Posts: 96
Joined: Sep 2011
Reputation: 1
Post: #113
Hi
I love sonos, and think It's great to see a sonos add on for xbmc even though I have no real use for it at this moment.

You see, I have the sonos playbar connected to my tv by hdmi. Rpi running xbmc is also connected via hdmi to the same tv, so the cec adapter takes care of all the remote functions when watching movies / tv. I have disabled the tv speakers, so the tv remote only changes the volume on sonos.
I only have one instance of xbmc, and the one sonos speaker right now, but am keen to extend my sonos range by adding a pair of play:1's and sub to make a 5.1 surround.
( excited )

Router -> Ethernet to bridge -> wireless to playbar -> hdmi to tv
Router -> Ethernet to RPI -> HDMI to TV
Router -> twin ethernet to NAS

I don't really use xbmc to listen to music anymore, only to manage my music library so sonos can read it. I feel that sonos, and the sonos app meet my listening needs sufficiently.
I feel it a bit of an overkill, and waste of power having my tv on if I'm just listening to music.

All that said, I like the way xbmc plays music back and shows artist images, visualisations etc when I am entertaining, so will get the addon and have a play about and provide my feedback.

Keep up the great work Rob!

[Image: 2342785296.png]
find quote
psuter Offline
Junior Member
Posts: 2
Joined: Feb 2004
Reputation: 0
Post: #114
Hi Rob
first of all, thanks for providing this great addon. i have just laied hands on a sonos connect:amp with line-in and connected a htpc running xbmc to it. the combo will be used in a showroom to play music through sonos and eventually show a promotional video or some pictures on a tv that is connected to the xbmc pc.
my goal was to get the sonos to switch to line-in as soon as a video starts playing on the screen.
unlike others, we don't shut down the xbmc computer as it only consumes a few watts when idling, so switching to line-in on startup does not do the job for us.

that's why i have modified your addon slightly to also switch to line-in as soon as a video starts playing. having no prior experience with addon programming i could greatly profit from the example provided by your auto-pause function and the line-in switch during startup. i simply merged the two together into a new class and embedded it into the main method of service.py.

i further noticed, that when your addon switches to line-in, sonos needs to also get a play command in order to actually play the sound from its line-in port and not just pre-select the input. so i added a line for that too ..

here is a diff against version 1.0.8 with my changes. I hope you can embed this into the official release so that i can follow your updates in the future without losing my modification every time i upgrade.

Code:
140a141
>                 self.sonosDevice.play()
144a146,171
>
> #####################################################################
> # Automatically switches to Line-In if XBMC starts playing something
> #####################################################################
> class SonosLineInLink():
>     def __init__(self, sonosDevice):
>         self.sonosDevice = sonosDevice
>         self.xbmcPlayState = False
>        
>     def check(self):
>         if Settings.switchSonosToLineIn():
>             # Check to see if something has started playing
>             if xbmc.Player().isPlaying():
>                 # If this is a change in play state since the last time we checked
>                 if self.xbmcPlayState == False:
>                     log("SonosLineInLink: Automatically switching to LineIn")
>                     try:
>                         # Not all speakers support line-in - so catch exception
>                         self.sonosDevice.switch_to_line_in()
>                         self.sonosDevice.play()
>                     except:
>                         log("SonosService: Failed to switch to Line-In for speaker %s" % Settings.getIPAddress())
>                         log("SonosService: %s" % traceback.format_exc())
>             else:
>                 self.xbmcPlayState = False
>
288a316,318
>             # Class that handles the automatic switching to line-in upon playing something in xbmc
>             lineInLink = SonosLineInLink(sonosDevice)
>
295a326,329
>                
>                 # check to see if sonos needs to be switched to line-in
>                 lineInLink.check()
>

one thing that i think needs some rework is the way the volume is controlled. in a setup where xbmc can only play its sound through sonos, the xbmc volume should always remain at 100% while changing the volume should cause sonos to increase or lower the volume. i have no idea if and how this is possible to achieve as ideally xbmc's volume bar should show and control the sonos volume and leave the system volume untouched at 100% at all times.

does anybody know how something like this could be done?

kind regards
Pascal
find quote
bruddha Offline
Junior Member
Posts: 3
Joined: Nov 2010
Reputation: 0
Post: #115
Hi Rob
i finally had some time to test the volume synchronization i had requested. it works perfectly well, thank you. my setup makes much more sense now.
@psuter: there's is no need to switch to line in manually or by code, since sonos (at least my play5) can be configured to switch automatically if it detects a signal on line in. if i turn on the tv it switches from whatever is playing on sonos to line in.
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #116
(2014-07-01 16:55)psuter Wrote:  first of all, thanks for providing this great addon.

Thanks, I'm glad people are finding uses for it! Laugh

(2014-07-01 16:55)psuter Wrote:  i have modified your addon slightly to also switch to line-in as soon as a video starts playing. having no prior experience with addon programming i could greatly profit from the example provided by your auto-pause function and the line-in switch during startup. i simply merged the two together into a new class and embedded it into the main method of service.py.

Thanks for providing the patch, it gives a clear idea of what you wanted - I've implemented it slightly differently, but there is a patch of all the changes:

https://code.google.com/p/robwebset/source/detail?r=458

You may want to try it out and see if it does what you want - there should now be an option in settings to enable it. Please remember that I do not have a Sonos Speaker/Amp with a line-in so am really coding blind with this sort of thing!

(2014-07-01 16:55)psuter Wrote:  i further noticed, that when your addon switches to line-in, sonos needs to also get a play command in order to actually play the sound from its line-in port and not just pre-select the input. so i added a line for that too ..

I have added this in the above patch - this may differ for each type of equipment, but if it's needed with the AMP, lets add it - if some-one reports a problem with it sending the play - then we can make it optional (Again - not something I can fully test)

(2014-07-01 16:55)psuter Wrote:  one thing that i think needs some rework is the way the volume is controlled. in a setup where xbmc can only play its sound through sonos, the xbmc volume should always remain at 100% while changing the volume should cause sonos to increase or lower the volume. i have no idea if and how this is possible to achieve as ideally xbmc's volume bar should show and control the sonos volume and leave the system volume untouched at 100% at all times.

does anybody know how something like this could be done?

I spent a while looking at different ways to control the volume, if you look at earlier posts, I tried mapping remote control keys directly - but that was painfully slow! The only sensible way to do it automatically was to map the volume to XBMCs volume, this seems to fix all cases - you can see the volume level - it's relatively responsive (there is a small lag still). If you didn't want it mapped, then you can call up the Sonos Controller on XBMC and use that to change the volume (That is is "independent" way of changing the Sonos volume).

(2014-07-01 17:34)bruddha Wrote:  i finally had some time to test the volume synchronization i had requested. it works perfectly well, thank you. my setup makes much more sense now.

Glad you managed to get it working OK for you.

Rob
find quote
rob_webset Offline
Fan
Posts: 651
Joined: Sep 2013
Reputation: 20
Post: #117
Hi All,

I have just requested a publish of a new version of the Sonos Addon, this includes:

Code:
v1.0.9
- Add option to Switch Sonos To Line-In On Media Start
- Add check that Artist Slideshow has transparent image enabled
- Populate information when using streaming service
- Add next track details when random is set

I think this was all the outstanding requests, other than the "Different player/Artist Slideshow" layouts/views - which I'd be happy to give a go if people sketch out roughly what they want.

Please let me know if you hit any issues.

Thanks

Rob
find quote
Post Reply