UDP goes to sleep resulting in slow reconnect
As reported in “Some buttons not working on Android 5.1.0” I've been having some annoying issues with one of my Android phones. As I think I might have narrowed down the issue I'm posting this new bug report with a more accurate title. The issue is that on one of my phones it takes almost 20 seconds for Unified Remote to reconnect (see log post in the previous bug report) resulting in the remote being non-responsive for 15-20 seconds. I was suspecting that it was the UDP (fast connection) that was the issue and after googling I did find that some chipsets turns off UDP send/receive during sleep. But there are ways to keep it live. See for example: http://stackoverflow.com/questions/9363389/udp-broadcast-packets-not-received-in-sleep-mode
and hence I downloaded some random UDP app in the hope that it would keep UDP alive if I just kept it running (listening) in the background. Sure enough, after installing “UDP Sender / Receiver” from the app store and keeping it running in the background the problematic Android phone now seems to consistently reconnect in 1 second, removing the annoying non-responsiveness. The suggestions (MulticastLock and PARTIAL_WAKE_LOCK) in the stackoverflow.com article are really way over my head, but could you please look into some sort of solution for chipsets that wants to put UDP to sleep? It's kinda strange to have to keep a random UDP app running in the background all the time. Thanks!
any suggestions as to what i can look into in order to figure out why it's taking so long for it to connect to the server (see log below)? a remote with close to 20 seconds delay is unfortunately pretty much useless. clearly the phone has OK network connection as it is able to immediately ask for a connection according to the log (discovery request from 192.168.1.211:xxxx). i've also tested using the Sony TV remote (as the TV is one of things I control (over http)) and it never displays any lag, even if the phone has been sleeping over night. so for some reason the unified remote server has problems connecting with the client on this phone after sleep. just need to figure out why.... Thanks
2015-10-08 19:28:00 (I) Discovery: discovery request from 192.168.1.211:42473
2015-10-08 19:28:18 (I) Manager: 192.168.1.211:50208: connected
2015-10-08 19:28:18 (I) Connection: android-dbfdb06681ce2053: received valid handshake
2015-10-08 19:28:18 (I) Connection: android-dbfdb06681ce2053: supports client nonce
2015-10-08 19:28:18 (I) Connection: android-dbfdb06681ce2053: ignoring authentication
2015-10-08 19:28:18 (I) Connection: android-dbfdb06681ce2053: syncing hash (1950376107)
2015-10-08 19:28:18 (I) Connection: android-dbfdb06681ce2053: starting new session
2015-10-08 19:28:18 (I) Session: android-dbfdb06681ce2053: loading (Jonas.TV)
We are investigating your previous post. We have not managed to reproduce it. What kind of phone do you have?
it's a meizu m2. and it doesn't happen on my galaxy s5 mini, so it is definitely the combination of unified remote server and this particular phone/os version. and i completely understand that this phone/os version is not common and hence not a major focus for you. therefore i was hoping i could help out by running some tests on my side. otherwise i'll have to send you the phone so you can borrow it :-)
joe huang 00
I got the same problem.
it always automatically disconnects after not using it for awhile .
the sad part is it takes 30 secs to reconnect to the server
2015-10-31 17:48:14 Agent: loading: Relmtech.Basic Input
2015-10-31 17:48:14 Session: android-18e4990ff9913b8: loading (Relmtech.Basic Input)
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: starting new session
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: updating fast capability (true)
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: syncing hash (1742257675)
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: ignoring authentication
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: supports client nonce
2015-10-31 17:48:14 Connection: android-18e4990ff9913b8: received valid handshake
2015-10-31 17:48:14 Manager: 192.168.1.10:33679: connected <-
2015-10-31 17:47:44 Discovery: discovery request from 192.168.1.10:49094 <-
2015-10-31 17:47:42 Manager: 192.168.1.10:50007: disconnected
I'm having the same problem.
After initially launching the app, it's about a 30 second delay before it starts working.
If I leave it unused for about 5 mins, it's the same again.
LG G4 H815T stock.
I have the same phone and this is how i solved this:
Installed "wake lock power manager" from play store. Enable the "partial wake lock" setting.
Works great now.
/Bigfoot This is the app
Enabling partial wake lock as suggested by Bigfoot (thanks!) seems to solve the issue for me as well. Would be great if that could be added as a setting in the UR app as the current "wake lock" seems to keep the screen on as well? Which drains the battery faster than using the partial wake lock in the app suggested by Bigfoot.