philippe44 / AirConnect

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

Speakers disappearing while all there right after start #293

Closed Alex9779 closed 3 years ago

Alex9779 commented 3 years ago

I uses airupnp once in a while and for half a year it worked when I needed it. But I think I have now issues maybe because of iOS 14. I just digged into it, updated airupnp to the newest release and I am now in iOS 14.2. My problem ist as the topic tells, when I start the service or directly the speakers pop up on my device but after about 2 minutes they all disappear and won't come back. Sometime I had the reappear when I shut down the service again but not every time. But restarting the service brings them always back but just for 2 minutes. I played with several parameters but no effect. I am using a static config created with "-i" and then changed because the names by the discovery are not nice in my system (using Teufel Raumfeld speakers).

Any ideas what I can do about it?

philippe44 commented 3 years ago

What is your network topology? It looks like some mDNS announces are not relayed. Now, there might be issues in my announces, but I've not found them so far and on my own system, even on iOS 14,2 I don't have that issue

Alex9779 commented 3 years ago

My topology is rather complex though the VM running AirConnect, the speakers and the iOS device are in the same network segment. I also run an mDNS repeater for all segments. What I think is strange that they are there when I start the service and just disappear. Just like some timeout is kicking in and not refreshed...

philippe44 commented 3 years ago

Well, the issue is very likely in the mDNS repeater. All broadcast have a time-to-live (ttl) and although I already corrected a few things there, I would certainly not exclude remaining issues.

In addition, the mDNS repeater and/or iOS 14 might do something "smarter" and discard the mDNS announces because it thinks they are not valid anymore and then then players disappear. Maybe previously the mDNS repeater was messing up something that now iOS 14 does not accept anymore, maybe my mDNS announces had an issue that causes the repeater to make a fault that was accepted before by iOS 14, there are many hypothesis.

But knowing that others don't see the issue, it is certainly around the combination of this with your complex topology.

Also see #160 and https://community.ui.com/questions/Unifi-mdns-repeater-not-working-across-VLANs/b47199a0-5e7e-4caf-a8c6-d3c9c56f1e27

Alex9779 commented 3 years ago

Ok I deactivated the mDNS repeater (shutdown the VM running it) for testing and I still have the issue. I read all posts you mentioned but didn't find a hint. I also see the issue on my MacBook running latest Catalina. I also found that devices started after the service do not get the speakers, I started my iPad after the service, while my iPhone and Mac had the speakers for about 2 minutes the iPad didn't.

I am really not very much into C++ and mDNS and all that matters here but it seems something is not refreshed or resent properly so that the devices think the speakers are gone again. I monitored the service with debug log and it properly does its scheduled updates of devices. No idea why they never come back...

philippe44 commented 3 years ago

Try to take a log with level set to "sdebug". It will be awfully verbose but maybe something will come out of that

Alex9779 commented 3 years ago

Well it seems this self healed... Or maybe iOS update made a difference. I tried the extended debug log but didn't find a hint so I did not post. Update today to the latest version, I know there just have been some minor changes not related to my problem. For now it is working again. All I changed was updating iOS to 14.2.1 maybe that did the trick...