I am experiencing this issue on a Pixel 9a with Android 16 (GrapheneOS).
Over the last weeks I first git bisected the wrapper and then syncthing native.
The commit causing this issue is 9d425b05880236928c561da0b7152e41d795a5ac in Syncthing Native. It uses a new library, anet to fix some methods regarding network interfaces and addresses for Android 10+.
Instead of downgrading to v1, I found this workaround which resolves the issue for me: DisablingSettings -> Syncthing Options -> Local Discovery.
I’d be interested to hear if this workaround works for other people here having this issue.
I am still trying to figure out if the root cause is in the commit that I found (or rather the anet library) or if the root cause is in another part of the Local Discovery feature and the fix for Local Discovery on Android 10+ only made the issue visible on newer Android versions.
I’m not using DNS records, but global discovery works even for local connections, as the clients share all of their IPs with the global discovery server.
When I disabled Local Discovery on Pixel 9a my phone is Disconnected (Remote Devices) on desktop app. I have to use Android tile: Enable for 5 minutes to sync to my desktop. After that app starts syncing and Pixel 9a is Up to Date (Remote Devices).
My Run Conditions:
Run on Wi-Fi - enabled
Run on specified Wi-Fi - enabled
Battery consumption is less than 1% per day.
Before that my battery consumption was about 25% when I have enabled Local Discovery.
Thanks for all the progress that has been made on this. I am currently running syncthing in termux and with local discovery disabled, battery consumption goes back to being negligible when on wifi. When I’m on 5G however, Android again reports elevated use and the battery is drained notably quicker. Is anyone else experiencing this now?
I would suggest you enter the IP addresses or FQDNs on each side (I use Syncthing over Tailscale, so I use my Tailscale DNS for this). I would recommend that you experiment with turning off Local and Global Discovery on the Android side.
I have tested the change for a few hours, and the battery draining seems to be less (~15% instead of ~30%), but still significantly higher than without local discovery (<1%).
Regarding anet, I took a look at the code, and I did not find anything suspicious that could be the cause. Most of the code seems to be copied from the GoLang’s net library, and some syscalls were changed as they are no longer available on newer Android versions.
This could be the same problem if your 5G interface has the broadcast and/or multicast flag, as local discovery advertisement is attempted on all interfaces where the running flag and broadcast or multicast flag is set.
Unfortunately my connection is refused on Remote Device. I used tcp address and info is described in red.
I have to use Android tile: Enable for 5 minutes to sync to my desktop again. I will live with this small inconvenience and lack of automaticity But low battery consumption is a priority.
Thanks for your reply. To check that I understand you correctly, this can happen even when Local Discovery is turned off? Given what we know now, is there another way I can prevent it?
As a side-note: I’ve now added all my devices to a wireguard vpn, so I’m gonna try using IPs without discovery too.
To add to the above: unfortunately, even with only static IP addresses configured and Local Discovery, Global Discovery, NAT traversing and relays disabled, battery consumption goes up considerably when on 5G, without syncthing apparently doing anything.
Do you have Run on mobile data enabled? I didn’t yet check if I have the issue without wifi, but I’d expect syncthing to not run with that option disabled.