tlk / beoplay-macos-remote-gui

Remote control B&O Beoplay loudspeakers from macOS
MIT License
16 stars 1 forks source link

Sporadic failure to resolve device(s) #29

Closed tlk closed 2 years ago

tlk commented 3 years ago

There is an issue where the BeoplayRemoteGUI.app sometimes, but not always, fails to auto-connect to the device it was last connected to.

This issue was observed quite frequently on recent macOS releases while macOS 11.5.2 appears to have reduced the failure rate.

I have observed similar behaviour using the DNS-SD Browser discovery.app where a device is discovered but sometimes resolving is either very slow or fails to complete.

tlk commented 3 years ago

I had a look at updating the code to use the Network framework (like this changeset https://github.com/dhleong/castable/commit/de8ae8e6ef6ad7af2e0cd8c53a09ef27b06ebb7d) only to find that it does not provide a way to get the service port.

Consider dropping the resolve code and simply hardcode the port number to 8080.

tlk commented 2 years ago

So I inspected network traffic, instrumented the code, inspected the code for threading and ARC issues, rewrote relevant parts of the code, etc but failed to figure out what caused this issue.

As far as I can see, network traffic looks identical during success and failure scenarios.

The issue seems to be happening less frequently the more you look for it.

Leave it for a couple of hours and the issue is very likely to appear.

As a work around, I have Implemented a watchdog to compensate for any sporadic resolver issues.