philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.56k stars 218 forks source link

All Sonos devices marked as Slave, no advertisements #195

Closed arron-f closed 5 years ago

arron-f commented 5 years ago

Hello,

First issue logging so apologies, if I miss something.

I have three sonos speakers and a sub (all working and active via IOS App), which are all detected by upnp. At initial startup of 'airupnp-arm' one device is listed as master (and I see it on the iphone for <5sec) then is downgraded to slave. All devices are now slave and nothing is seen on the iphone. No device is later promoter to master. I would expect three masters when there are three zones (i.e. all speakers are independent).

Output from the app is listed below

I have tried the following;

  1. If I run the aircast-arm it correctly advertises a chromecast device, so i don't believe the problem is 'network/connectivity'.
  2. I've tried grouping by the sonos app, in different combinations, no change.
  3. I tried a static config file and disabling each devices, no change.
  4. I tried reading the code to identify what causes a device to be marked as master, to see if I can determine the cause and/or override. See below, but i'm unable to identify the problem.
pi@retropie3:~ $ /var/lib/airconnect/airupnp-arm -d all=debug
[19:31:51.820010] main:1349 Starting airupnp version: v0.2.21.2 (Sep 25 2019 @ 03:21:25)
[19:31:51.820753] main:1357 no config file, using defaults
[19:31:51.824235] Start:1078 Binding to 192.168.0.52:49152
[19:31:51.948727] AddMRDevice:980 [0x96f28]: adding renderer (Upstairs)
[19:31:51.957995] MasterHandler:647 [0x96f28]: subscribe success
[19:31:52.233362] GetMaster:114 Found Master RINCON_5xxx
[19:31:52.246749] AddMRDevice:978 [0x99370] skipping Sonos slave 192.168.0.102 - Sonos SUB
[19:31:52.255776] MasterHandler:649 [0x99370]: subscribe fail, re-trying 1
[19:31:52.265186] MasterHandler:649 [0x99370]: subscribe fail, re-trying 2
[19:31:52.274095] MasterHandler:649 [0x99370]: subscribe fail, re-trying 3
[19:31:52.282422] MasterHandler:653 [0x99370]: subscribe fail, volume feedback will not work
[19:31:52.291087] GetMaster:114 Found Master RINCON_xxxx
[19:31:52.300833] AddMRDevice:978 [0x9b7b8] skipping Sonos slave 192.168.0.188 - Sonos PLAYBAR
[19:31:52.307446] MasterHandler:647 [0x9b7b8]: subscribe success
[19:31:52.321070] GetMaster:114 Found Master RINCON_xxxx
[19:31:52.321365] UpdateThread:756 [0x9b7b8] UPnP keep alive: 192.168.0.188 - Sonos PLAYBAR+
[19:31:52.378379] GetMaster:114 Found Master RINCON_xxx
[19:31:52.382965] AddMRDevice:978 [0x9dc00] skipping Sonos slave 192.168.0.14 - Sonos PLAY:1
[19:31:52.394371] MasterHandler:647 [0x9dc00]: subscribe success
[19:31:52.397216] GetMaster:114 Found Master RINCON_xxx
[19:31:52.397472] UpdateThread:756 [0x9dc00] UPnP keep alive: 192.168.0.14 - Sonos PLAY:1+
[19:31:52.430104] GetMaster:114 Found Master RINCON_xxx
[19:31:52.430426] UpdateThread:756 [0x96f28] UPnP keep alive: Upstairs+
[19:31:52.456356] UpdateThread:765 [0x96f28]: Device name change 192.168.0.86 - Sonos PLAY:1 Upstairs
[19:31:52.456620] UpdateThread:784 [0x96f28]: Sonos 192.168.0.86 - Sonos PLAY:1+ is now slave
[19:31:52.490019] GetMaster:114 Found Master RINCON_xxx
[19:31:52.490267] UpdateThread:756 [0x99370] UPnP keep alive: 192.168.0.102 - Sonos SUB+
[19:32:11.004747] UpdateThread:703 Presence checking
[19:32:11.504975] GetMaster:114 Found Master RINCON_xxx
[19:32:11.505368] UpdateThread:756 [0x9b7b8] UPnP keep alive: 192.168.0.188 - Sonos PLAYBAR+
[19:32:11.585707] GetMaster:114 Found Master RINCON_xxx
[19:32:11.586114] UpdateThread:756 [0x99370] UPnP keep alive: 192.168.0.102 - Sonos SUB+
[19:32:11.670648] GetMaster:114 Found Master RINCON_xxx
[19:32:11.671046] UpdateThread:756 [0x96f28] UPnP keep alive: 192.168.0.86 - Sonos PLAY:1+
[19:32:11.831309] GetMaster:114 Found Master RINCON_xxx
[19:32:11.831745] UpdateThread:756 [0x9dc00] UPnP keep alive: 192.168.0.14 - Sonos PLAY:1+
[19:32:11.901692] GetMaster:114 Found Master RINCON_xxx
[19:32:11.902466] UpdateThread:756 [0x99370] UPnP keep alive: 192.168.0.102 - Sonos SUB+
[19:32:11.950736] GetMaster:114 Found Master RINCON_xxx
[19:32:11.951081] UpdateThread:756 [0x9b7b8] UPnP keep alive: 192.168.0.188 - Sonos PLAYBAR+
[19:32:12.031344] GetMaster:114 Found Master RINCON_xxx
[19:32:12.032655] UpdateThread:756 [0x96f28] UPnP keep alive: 192.168.0.86 - Sonos PLAY:1+
[19:32:12.309653] GetMaster:114 Found Master RINCON_xxx
[19:32:12.310699] UpdateThread:756 [0x9dc00] UPnP keep alive: 192.168.0.14 - Sonos PLAY:1+

Based on my 'basic' level knowledge I looked at your code base and guessed that 'coordinator' flag needs to be set in some form of xml (GetMaster ... GetZoneGroupState).

If I go to 'http://192.168.0.188:1400/support/review' and Zone Players. Three of the devices are listed as coordinators which is what I would expect.

Zone Name | Coordinator | Group | Location | UUID | Version | MinCompatVer | Compat | WiMode | HasSSID | WiFreq | WiEna | BeEx
-- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --
Upstairs | true | RINCON_xxx:30 | http://192.168.0.86:1400/xml/device_description.xml | RINCON_xxx | 36.4-42130 | 35.0-00000 |   | 0 | 1 | 2437 | 1 | 0
Lounge | false | RINCON_xxx:2914534995 | http://192.168.0.102:1400/xml/device_description.xml | RINCON_xxx | 36.4-42130 | 35.0-00000 |   | 0 | 1 | 5200 | 1 | 0
Kitchen | true | RINCON_xxx:30 | http://192.168.0.14:1400/xml/device_description.xml | RINCON_xxx | 36.4-42130 | 35.0-00000 |   | 0 | 1 | 2437 | 1 | 0
Lounge | true | RINCON_xxx:80 | http://192.168.0.188:1400/xml/device_description.xml | RINCON_xxx | 36.4-42130 | 35.0-00000 |   | 0 | 1 | 2437 | 1 | 0

I retrieved the device_description.xml for 'Upstairs'/192.168.0.86, I cant see any coordinator flag. I saw a reference to ZoneGroupTopology1.xml, and retrieved that again I cant see any coordinator reference.

I'm looking for assistance,

philippe44 commented 5 years ago

You need to make a UPnP call to getzonegroupstate function and there you should see the coordinator entry in the response. You can use devicespy to do that on Windows

arron-f commented 5 years ago

Thank you for your response, I did a software upgrade on the Sonos speakers. They all show up fine now.

Sorry for the bother.