bk138 / droidVNC-NG

VNC server app for Android that does not require root privileges.
GNU General Public License v2.0
1.32k stars 187 forks source link

droidVNC-NG keeps disconnecting after long usage #113

Open rnveach opened 1 year ago

rnveach commented 1 year ago

Describe the bug

VNC clients get booted after staying connected to droidVNC-NG 1.3.5 for a long time. Reconnecting to said device displays the screen, but input does not work. I have to physically turn off droidVNC-NG and turn it back on for things to resume.

To Reproduce Install droidVNC-NG 1.3.5 from the playstore. Setup droidVNC-NG and get all permissions granted. Set a password on droidVNC-NG. Download tightvnc Java 2.8.3. Have tightvnc connect to droidVNC-NG. Use for hours, with medium mouse press uses. Eventually client gets disconnected.

Expected Behavior

Expected to be able to connect to the device with droidVNC-NG 1.3.5 and stay connected with no perceived timelimit.

Logs/Backtraces

Tightvnc:

Nov 24, 2022 1:10:42 PM com.glavsoft.rfb.protocol.ReceiverTask run
SEVERE: Close session: Cannot read byte
Nov 24, 2022 1:10:42 PM com.glavsoft.rfb.protocol.SenderTask run
SEVERE: Close session: Cannot write byte
Disposal was interrupted:
java.lang.InterruptedException
    at java.base/java.lang.Object.wait(Native Method)
    at java.base/java.lang.Object.wait(Object.java:328)
    at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1361)
    at java.desktop/java.awt.Window.doDispose(Window.java:1227)
    at java.desktop/java.awt.Window.dispose(Window.java:1164)
    at com.glavsoft.viewer.swing.SwingViewerWindow.close(SwingViewerWindow.java:537)
    at com.glavsoft.viewer.swing.SwingRfbConnectionWorker.cleanUpUISessionAndConnection(SwingRfbConnectionWorker.java:219)
    at com.glavsoft.viewer.swing.SwingRfbConnectionWorker.rfbSessionStopped(SwingRfbConnectionWorker.java:186)
    at com.glavsoft.rfb.protocol.Protocol.cleanUpSession(Protocol.java:258)
    at com.glavsoft.rfb.protocol.SenderTask.run(SenderTask.java:70)
    at java.base/java.lang.Thread.run(Thread.java:834)
Nov 24, 2022 1:10:42 PM com.glavsoft.viewer.swing.SwingRfbConnectionWorker rfbSessionStopped
INFO: Rfb session stopped: Connection closed
Nov 24, 2022 1:10:43 PM com.glavsoft.viewer.swing.SwingRfbConnectionWorker rfbSessionStopped
INFO: Rfb session stopped: Connection closed.
Nov 24, 2022 1:10:55 PM com.glavsoft.viewer.Viewer closeApp
INFO: Connection cancelled.

Your environment (please complete the following information):

Additional context

The latest failure occurred today after being connected for 3 1/2 hours. I have not really seen a constant time before the issue occurs.

droidVNC-NG still says input has been granted on the main screen.

I have confirmed on RealVNC that the inputs do not work anymore when the issue happens.

I have experienced this issues back on older versions, 1.2.6 I believe.

bk138 commented 1 year ago

@rnveach thanks for the report! Most valuable would be logs from the server side, so if you could arrange for a logcat-capturing setup, that'd be awesome!

rnveach commented 1 year ago

@bk138 This is not a rooted android device and I am not really an android developer. Won't logcat technically not work because of Google's separations of apps type permissions? Do I need to do anything special to do this?

bk138 commented 1 year ago

@bk138 This is not a rooted android device and I am not really an android developer. Won't logcat technically not work because of Google's separations of apps type permissions? Do I need to do anything special to do this?

You can do that with any device, it's a bit of setup but worth the effort: https://developer.android.com/studio/command-line/adb

rnveach commented 1 year ago

Let me know if this is enough or how to clip out more.

12-05 11:27:32.476 30323 25546 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:32.476 30323  5238 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:32.476 30323 30335 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:32.677 30323 30331 I ier.droidvnc_ng: Background young concurrent copying GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 255MB/256MB, paused 25us,15us total 200.727ms

12-05 11:27:32.677 30323 25546 I ier.droidvnc_ng: WaitForGcToComplete blocked Alloc on Background for 316.726ms

12-05 11:27:32.677 30323 25546 I ier.droidvnc_ng: Starting a blocking GC Alloc

12-05 11:27:32.677 30323  5238 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:32.677 30323 30335 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:33.276 30323 30331 I ier.droidvnc_ng: Clamp target GC heap from 351MB to 256MB

12-05 11:27:33.276 30323 30331 I ier.droidvnc_ng: Background concurrent copying GC freed 161(5080B) AllocSpace objects, 0(0B) LOS objects, 0% free, 255MB/256MB, paused 38us,16us total 599.228ms

12-05 11:27:33.277 30323  5238 I ier.droidvnc_ng: WaitForGcToComplete blocked Alloc on Background for 800.407ms

12-05 11:27:33.277 30323  5238 I ier.droidvnc_ng: Starting a blocking GC Alloc

12-05 11:27:33.277 30323 30335 I ier.droidvnc_ng: Waiting for a blocking GC Alloc

12-05 11:27:34.125 30323  5238 I ier.droidvnc_ng: Clamp target GC heap from 351MB to 256MB

12-05 11:27:34.125 30323  5238 I ier.droidvnc_ng: Alloc concurrent copying GC freed 19443(666KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 255MB/256MB, paused 23us,17us total 847.977ms

12-05 11:27:34.125 30323 30335 I ier.droidvnc_ng: WaitForGcToComplete blocked Alloc on Alloc for 2.252s

12-05 11:27:34.125 30323 30335 I ier.droidvnc_ng: Starting a blocking GC Alloc

12-05 11:27:34.125 30323 30323 D MainService: image available

12-05 11:27:34.125 30323 30331 I ier.droidvnc_ng: WaitForGcToComplete blocked Background on Alloc for 848.198ms

12-05 11:27:34.125 30323  5238 W ier.droidvnc_ng: Throwing OutOfMemoryError "Failed to allocate a 16 byte allocation with 718000 free bytes and 701KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC." (VmSize 14876188 kB)

12-05 11:27:34.125 30323 30323 D droidvnc-ng (native): vncUpdateFramebuffer: copy took 0.138 ms

12-05 11:27:34.129 30323  5238 W System.err: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 718000 free bytes and 701KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.

12-05 11:27:34.132 30323  5238 W System.err:    at libcore.util.NativeAllocationRegistry.registerNativeAllocation(NativeAllocationRegistry.java:263)

12-05 11:27:34.132 30323  5238 W System.err:    at android.graphics.Path.<init>(Path.java:66)

12-05 11:27:34.132 30323  5238 W System.err:    at net.christianbeier.droidvnc_ng.InputService.startGesture(InputService.java:246)

12-05 11:27:34.132 30323  5238 W System.err:    at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:126)

12-05 11:27:34.132 30323 30323 D MainService: image available

12-05 11:27:34.133 30323 30323 D droidvnc-ng (native): vncUpdateFramebuffer: copy took 0.137 ms

12-05 11:27:34.133 30323  5238 E AndroidRuntime: FATAL EXCEPTION: Thread-2770165

12-05 11:27:34.133 30323  5238 E AndroidRuntime: Process: net.christianbeier.droidvnc_ng, PID: 30323

12-05 11:27:34.133 30323  5238 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 718000 free bytes and 701KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.

12-05 11:27:34.133 30323  5238 E AndroidRuntime:    at libcore.util.NativeAllocationRegistry.registerNativeAllocation(NativeAllocationRegistry.java:263)

12-05 11:27:34.133 30323  5238 E AndroidRuntime:    at android.graphics.Path.<init>(Path.java:66)

12-05 11:27:34.133 30323  5238 E AndroidRuntime:    at net.christianbeier.droidvnc_ng.InputService.startGesture(InputService.java:246)

12-05 11:27:34.133 30323  5238 E AndroidRuntime:    at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:126)

12-05 11:27:34.137  1810 11103 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2

12-05 11:27:34.139  1810  1973 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver

12-05 11:27:34.139  1810  1973 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver

12-05 11:27:34.139 30323  5238 I Process : Sending signal. PID: 30323 SIG: 9

Looking at the logs in some more detail. It looks like I may have kept the app running for a few days, but started using it this morning around 9am. It wasn't until 11:27 then that the out of memory crash occurred. It wasn't until almost less than 2 minutes before the crash did the GC heap messages start appearing.

Current memory usage is 36 megs. Maximum reported usage in the last 1 day is 369 megs.

bk138 commented 1 year ago

Thank you very much for the effort! Looks like a memory leak. Can you try it on a different device to rule out the leak is somewhere in the OS implementation?

rnveach commented 1 year ago

I do not have another android device. Last time I tried testing on the example but I couldn't reproduce the previous issue there. I atleast tried testing there with this issue, but after an hour or so, I haven't seen any increased memory usage.

How do you want me to test this?

bk138 commented 1 year ago

Honestly, no good idea. It might be this special device, another app on the device or droidvnc-ng itself. The only way I see ruling out the first two is to (long-time) test on another device.

rnveach commented 1 year ago

Let me ask a stupid question as I am not an android developer,

at android.graphics.Path.(Path.java:66) at net.christianbeier.droidvnc_ng.InputService.startGesture(InputService.java:246) at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:126)

https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L246 A new path keeps getting created here and it looks like memory hit its limit inside this, which could or could not be related. However, I noticed this Path class has a [close](https://developer.android.com/reference/android/graphics/Path#close()) method which doesn't seemed to be called anywhere. It looks like the close may free some memory as part of it's call since it allocated it. Does the Path's close method need to be called?

I ran against the example server for hours with no change in memory. It at least seems to reason right now, the issue may not be in that piece of code (libvncserver).

bk138 commented 1 year ago

Very nice find! That may well be! One approach to test this out would be trying to run the server without any pointer input. Then it should not leak memory, right?

bk138 commented 1 year ago

Anyway, after thinking about it, https://developer.android.com/reference/android/graphics/Path#close() is probably not the right call as this would connect the path's last point with its first, forming a shape. Definitely not what we want for gesture input ;-)

rnveach commented 1 year ago

@bk138 I wish to try to play with the code on my device, but when I build droidVNC I get an x86 so file (Windows users). How do I match it up with release version, arm64-v8a? I am using Android Studio on my Windows machine.

One thing I wanted to check was just closing the path after it is done with for the instance after its passed to the gesture. https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L263 I was seeing it was cloning the path when it was passed along.

There is also a reset method on the Path.

bk138 commented 1 year ago

@bk138 I wish to try to play with the code on my device, but when I build droidVNC I get an x86 so file (Windows users). How do I match it up with release version, arm64-v8a? I am using Android Studio on my Windows machine.

Sounds like you're building for an emulator, you have to connect your device via USB and it should show up in Android Studio. Then you can simply hit the ▶ icon and the app should launch on the device.

One thing I wanted to check was just closing the path after it is done with for the instance after its passed to the gesture. https://github.com/bk138/droidVNC-NG/blob/master/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java#L263 I was seeing it was cloning the path when it was passed along.

There is also a reset method on the Path.

You can try this, though I suspect that close() is not the right call as it creates a closed shape. I saw that nClose() refers to SkPath, you might want do investigate there.

rnveach commented 1 year ago

@bk138 Thanks, I was able to deploy changes and test on my device.

First, the following change worked fine and did not close the shape in on itself when sending the strokes to the device. I do have an app called "Multi Touch Test" and it shows where on the screen it is being touched and it never went back in on the start even when I was doing odd shapes.

diff --git a/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java b/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java
index a08b5e5..74bca6c 100644
--- a/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java
+++ b/app/src/main/java/net/christianbeier/droidvnc_ng/InputService.java
@@ -261,9 +261,10 @@ public class InputService extends AccessibilityService {
                GestureDescription.Builder builder = new GestureDescription.Builder();
                builder.addStroke(stroke);
                dispatchGesture(builder.build(), null, null);
+               mPath.close();
+               mPath = null;
        }

-
        private  void longPress( int x, int y )
        {
                        dispatchGesture( createClick( x, y, ViewConfiguration.getTapTimeout() + ViewConfiguration.getLongPressTimeout()), null, null );

null assignment was really just to ensure I was understanding the code.

Unfortunately, this did not fix the OOM exception and it did break today. Not sure if it lasted any longer, sort of seemed like it, but theres no way to tell really.

12-13 17:34:25.031 17577  4047 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 187488 free bytes and 183KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
12-13 17:34:25.031 17577  4047 E AndroidRuntime:    at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)
12-13 17:34:25.031 17577  4047 E AndroidRuntime:    at android.os.Binder.execTransact(Binder.java:1242)

I haven't really played around with Android Studio, but I am not sure what else to do at this point.

bk138 commented 1 year ago

@rnveach you might want to keep the device running while having https://developer.android.com/studio/profile/memory-profiler attached, that should bring some insights.

rnveach commented 1 year ago

Does droidVNC do anything from normal screen touching outside of the VNC connection?

(Java) Memory increase is very small that the graph doesn't really show an increase, but you can see 0.1 meg increases every second or so. It does seem to increase only on input like i was originally going with, but it seems it also increases when touching the screen not through the VNC connection which I found odd unless droidVNC is getting callbacks of this event. There does seems to be a GC that eventually happens and it goes back down.

Android Studio crashed when trying to look into 1 hour of data, but from what I could see GestureDescription$TouchPoint and GestureDescription$GestureStep increased from 30k of allocations (30 minutes) to 160k (1 hr). This is still with my above fix applied and Path increased from 26k to 48k.

I think its the point to say that InputService is the issue. It would make sense as when it crashes, I lose the ability to send new inputs when reconnecting to the VNC.

I haven't identified anything more as needing fixing yet, but I am not an android developer.

bk138 commented 1 year ago

Does droidVNC do anything from normal screen touching outside of the VNC connection?

(Java) Memory increase is very small that the graph doesn't really show an increase, but you can see 0.1 meg increases every second or so. It does seem to increase only on input like i was originally going with, but it seems it also increases when touching the screen not through the VNC connection which I found odd unless droidVNC is getting callbacks of this event. There does seems to be a GC that eventually happens and it goes back down.

You might me seeing allocations when the screen contents change.

Android Studio crashed when trying to look into 1 hour of data, but from what I could see GestureDescription$TouchPoint and GestureDescription$GestureStep increased from 30k of allocations (30 minutes) to 160k (1 hr). This is still with my above fix applied and Path increased from 26k to 48k.

I think its the point to say that InputService is the issue. It would make sense as when it crashes, I lose the ability to send new inputs when reconnecting to the VNC.

You could try a longer run that not has input permission given and see if that changes anything.

bk138 commented 1 year ago

FYI had a crash related to #122: the server restarted, but input was not wired up again. Interesting find.

rnveach commented 1 year ago

Thanks. Just for informational, I am not copying text during the connection and currently have clipboard disabled between the 2 in the VNC client.

andih123 commented 1 year ago

I have the same problem. A synthetic process remotely accesses the device with TightVNC Viewer on the physical device every 5 minutes. After 6 days, the device no longer accepts mouse clicks or keystrokes, but still shows the current screen.

Mobile Device: Samsung Galaxy S8

calloatti commented 1 year ago

Started using droidVNC yesterday and run into the same issue today.

constantinoflouras commented 1 year ago

I am also experiencing this issue running version v1.3.5.

KreativeKrise commented 1 year ago

Same issue here. I see the screen, but inputs are not working. After restarting the service, it's working again. Device: BQ Aquaris X (LineageOS 18.1)

bk138 commented 1 year ago

:tada: reproducible w/ adb shell am crash net.christianbeier.droidvnc_ng, might need a adb shell am service-restart-backoff disable net.christianbeier.droidvnc_ng for more tries.

rnveach commented 1 year ago

@bk138 This fix will be released as part of 1.3.6 ? Any ideas on a planned release date?

bk138 commented 1 year ago

1.4.0. Next week hopefully.

rnveach commented 1 year ago

@bk138 So far everything has been working good for this issue, thanks.

rnveach commented 1 year ago

@bk138 Out of Memory exceptions have started appearing again with 2.1.3 . I can't confirm if it is just this version, or any of the priors. The only difference in behavior is when I reconnect, I can still use input by clicking on the screen and such, where as before i couldn't click anything.

Average memory usage is 227 mb, maximum usage is reported as 323 mb (reported by developer settings).

Do you want a new issue for this or re-open this one?

Log:

09-13 12:17:16.472 18975 31663 E AndroidRuntime: Process: net.christianbeier.droidvnc_ng, PID: 18975

09-13 12:17:16.472 18975 31663 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 456736 free bytes and 446KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.

09-13 12:17:16.472 18975 31663 E AndroidRuntime:    at android.accessibilityservice.AccessibilityService.dispatchGesture(AccessibilityService.java:1182)

09-13 12:17:16.472 18975 31663 E AndroidRuntime:    at net.christianbeier.droidvnc_ng.InputService.endGesture(InputService.java:380)

09-13 12:17:16.472 18975 31663 E AndroidRuntime:    at net.christianbeier.droidvnc_ng.InputService.onPointerEvent(InputService.java:225)

09-13 12:17:16.477  1532 28045 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2

09-13 12:17:16.482  1532  1624 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver

09-13 12:17:16.482  1532  1624 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver

09-13 12:17:16.613  1532  3581 I VirtualDisplayAdapter: Virtual display device released because application token died: net.christianbeier.droidvnc_ng

09-13 12:17:16.613  1532  1649 I ActivityManager: Process net.christianbeier.droidvnc_ng (pid 18975) has died: vis FGS 

09-13 12:17:16.615  1532  1622 W WindowManager: removeWindowToken: Attempted to remove non-existing token: null

09-13 12:17:16.616  1532  1614 I DisplayDeviceRepository: Display device removed: DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 468, defaultModeId 468, supportedModes [{id=468, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0}

09-13 12:17:16.618  1532  1614 I LogicalDisplayMapper: Removing display: 467

09-13 12:17:16.621  1532  1612 V WindowManager: Pause the recording session on display 467

09-13 12:17:16.622  1532  1649 W ActivityManager: Scheduling restart of crashed service net.christianbeier.droidvnc_ng/.InputService in 1000ms for connection

09-13 12:17:16.623  1532  1622 W WindowMagnificationMgr: requestConnection duplicated request: connect=false, mConnectionState=DISCONNECTED

09-13 12:17:16.623  1532  1649 W ActivityManager: Scheduling restart of crashed service net.christianbeier.droidvnc_ng/.MainService in 1285574280ms for start-requested

09-13 12:17:16.636  1532  1649 D ActivityManager: sync unfroze 31066 com.google.process.gapps

09-13 12:17:16.637  1532  1649 D ActivityManager: sync unfroze 4177 com.google.android.permissioncontroller

09-13 12:17:16.639  1532  1649 D ActivityManager: sync unfroze 774 com.google.android.projection.gearhead:car

09-13 12:17:16.641  1532  1649 D ActivityManager: sync unfroze 19423 com.reddit.frontpage

09-13 12:17:16.643  1532  1649 D ActivityManager: sync unfroze 31793 com.andrwq.recorder

09-13 12:17:16.754  1532  1623 W ActivityManager: Rescheduling restart of crashed service net.christianbeier.droidvnc_ng/.InputService in 9867ms for mem-pressure-event

09-13 12:17:18.675  1934  3175 D PowerUI : can't show warning due to - plugged: true status unknown: false

09-13 12:17:18.683  1532  1623 W ActivityManager: Rescheduling restart of crashed service net.christianbeier.droidvnc_ng/.InputService in 0ms for mem-pressure-event

09-13 12:17:18.683  1532  1623 W ActivityManager: Rescheduling restart of crashed service net.christianbeier.droidvnc_ng/.MainService in 1285572221ms for mem-pressure-event

09-13 12:17:18.684  1532  1624 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10401; state: DISABLED

09-13 12:17:18.684  1532  1624 D CompatibilityChangeReporter: Compat change id reported: 177438394; UID 10401; state: DISABLED

09-13 12:17:18.684  1532  1624 D CompatibilityChangeReporter: Compat change id reported: 135772972; UID 10401; state: DISABLED

09-13 12:17:18.684  1532  1624 D CompatibilityChangeReporter: Compat change id reported: 135754954; UID 10401; state: ENABLED

09-13 12:17:18.686  1532  1625 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10401; state: ENABLED

09-13 12:17:18.700  1532  1625 I ActivityManager: Start proc 28076:net.christianbeier.droidvnc_ng/u0a401 for service {net.christianbeier.droidvnc_ng/net.christianbeier.droidvnc_ng.InputService}

09-13 12:17:18.724  1532  3639 D CompatibilityChangeReporter: Compat change id reported: 168419799; UID 10401; state: DISABLED

09-13 12:17:18.724  1532  3639 D CompatibilityChangeReporter: Compat change id reported: 273564678; UID 10401; state: DISABLED

09-13 12:17:18.770  1532  1532 W WindowMagnificationMgr: requestConnection duplicated request: connect=false, mConnectionState=DISCONNECTED

09-13 12:17:18.809  1532  3639 I DisplayDeviceRepository: Display device added: DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 469, defaultModeId 469, supportedModes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0}

09-13 12:17:18.810  1532  3639 I LogicalDisplayMapper: Applying layout: [{addr: {port=0, model=0x401ceccbbbeef1}, dispId: 0(ON)}], Previous layout: [{addr: {port=0, model=0x401ceccbbbeef1}, dispId: 0(ON)}]

09-13 12:17:18.810  1532  3639 I LogicalDisplayMapper: Adding new display: 468: DisplayInfo{"droidVNC-NG", displayId 468", displayGroupId -1, FLAG_PRIVATE, FLAG_PRESENTATION, real 600 x 270, largest app 600 x 270, smallest app 600 x 270, appVsyncOff 0, presDeadline 16666666, mode 469, defaultMode 469, modes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], hdrCapabilities null, userDisabledHdrTypes [], minimalPostProcessingSupported false, rotation 0, state ON, committedState UNKNOWN, type VIRTUAL, uniqueId "virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", app 600 x 270, density 420 (420.0 x 420.0) dpi, layerStack 468, colorMode 0, supportedColorModes [0], deviceProductInfo null, owner net.christianbeier.droidvnc_ng (uid 10401), removeMode 1, refreshRateOverride 0.0, brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, installOrientation ROTATION_0}

09-13 12:17:18.810  1532  3639 I LogicalDisplayMapper: Setting new display group 0 for display 468, from previous group: null

09-13 12:17:18.811  1532  3639 W BrightnessThrottler: DeviceConfig BrightnessThrottlingData is null

09-13 12:17:18.811  1532  3639 W DisplayPowerController[468]: Screen brightness nits configuration is unavailable; falling back

09-13 12:17:18.827  1532  1612 W DisplayManagerService: Display DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 469, defaultModeId 469, supportedModes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0} does not support input device matching.

09-13 12:17:18.828  1532  1612 W DisplayManagerService: Display DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 469, defaultModeId 469, supportedModes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0} does not support input device matching.

09-13 12:17:18.833  1532  1612 I WindowManager: Override config changes=20005df8 {0.0 ?mcc?mnc ?localeList ?layoutDir sw103dp w229dp h103dp 420dpi smll land ?uimode ?night -touch -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 600, 270) mAppBounds=Rect(0, 0 - 600, 270) mMaxBounds=Rect(0, 0 - 600, 270) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} ?fontWeightAdjustment} for displayId=468

09-13 12:17:18.834  1934  1958 W DisplayController: Skipping Display Configuration change on non-added display.

09-13 12:17:18.836  1532  1612 I DisplayDevice: [468] Layerstack set to 468 for virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0

09-13 12:17:18.836  1532  1612 W DisplayManagerService: Display DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 469, defaultModeId 469, supportedModes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0} does not support input device matching.

09-13 12:17:18.838  1532  2356 V WindowManager: Handle incoming session on display 468, with a pre-existing session null

09-13 12:17:18.839  1532  1615 V WindowManager: Display 468 has no content and is on, so start recording for state 2

09-13 12:17:18.843  1532  1663 V DisplayPowerController[468]: Brightness [0.0] reason changing to: 'manual', previous reason: '0'.

09-13 12:17:18.843  1532  1663 I DisplayPowerController[468]: BrightnessEvent: disp=468, physDisp=virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0, brt=0.0, initBrt=NaN, rcmdBrt=NaN, preBrt=NaN, lux=0.0, preLux=0.0, hbmMax=1.0, hbmMode=off, rbcStrength=-1, powerFactor=1.0, thrmMax=1.0, wasShortTermModelActive=false, flags=, reason=manual, autoBrightness=false

09-13 12:17:18.843  1532  1663 I DisplayPowerController[468]: BrightnessEvent: disp=468, physDisp=virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0, brt=0.0, initBrt=0.0, rcmdBrt=NaN, preBrt=NaN, lux=0.0, preLux=0.0, hbmMax=1.0, hbmMode=off, rbcStrength=-1, powerFactor=1.0, thrmMax=1.0, wasShortTermModelActive=false, flags=, reason=manual, autoBrightness=false

09-13 12:17:18.843  1532  1663 I DisplayPowerController[468]: BrightnessEvent: disp=468, physDisp=virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0, brt=0.0, initBrt=0.0, rcmdBrt=NaN, preBrt=NaN, lux=0.0, preLux=0.0, hbmMax=1.0, hbmMode=off, rbcStrength=-1, powerFactor=1.0, thrmMax=1.0, wasShortTermModelActive=false, flags=, reason=manual, autoBrightness=false

09-13 12:17:18.844  1532  1663 I DisplayPowerController[468]: BrightnessEvent: disp=468, physDisp=virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0, brt=0.0, initBrt=0.0, rcmdBrt=NaN, preBrt=NaN, lux=0.0, preLux=0.0, hbmMax=1.0, hbmMode=off, rbcStrength=-1, powerFactor=1.0, thrmMax=1.0, wasShortTermModelActive=false, flags=, reason=manual, autoBrightness=false

09-13 12:17:18.844  1532  1612 V WindowManager: Display 468 state is now (2), so update recording?

09-13 12:17:18.845  1532  1615 W DisplayManagerService: Display DisplayDeviceInfo{"droidVNC-NG": uniqueId="virtual:net.christianbeier.droidvnc_ng,10401,droidVNC-NG,0", 600 x 270, modeId 469, defaultModeId 469, supportedModes [{id=469, width=600, height=270, fps=60.0, alternativeRefreshRates=[]}], colorMode 0, supportedColorModes [0], hdrCapabilities null, allmSupported false, gameContentTypeSupported false, density 420, 420.0 x 420.0 dpi, appVsyncOff 0, presDeadline 16666666, touch NONE, rotation 0, type VIRTUAL, deviceProductInfo null, state ON, committedState UNKNOWN, owner net.christianbeier.droidvnc_ng (uid 10401), frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 0.0, brightnessDefault 0.0, FLAG_PRIVATE, FLAG_PRESENTATION, installOrientation 0} does not support input device matching.

09-13 12:17:18.937  1532  1532 W NotificationHistory: Attempted to add notif for locked/gone/disabled user 0

09-13 12:17:19.056  1532  1532 E NotificationService: Muting recently noisy 0|net.christianbeier.droidvnc_ng|11|null|10401

09-13 12:17:28.421  1007  1007 I vendor.google.wifi_ext@1.0-service-vendor: Wifi: Setting SAR Scenario to 3

09-13 12:17:30.417  1532  4524 D CompatibilityChangeReporter: Compat change id reported: 197654537; UID 10155; state: ENABLED

09-13 12:17:30.417  1532  4524 D CompatibilityChangeReporter: Compat change id reported: 197654537; UID 10162; state: ENABLED

--------- beginning of main

09-13 12:17:30.580 28076 28076 D droidvnc-ng (native): vncUpdateFramebuffer: copy took 0.123 ms
bk138 commented 1 year ago

@rnveach sounds like #121 but not quite, as you see OOM errors?

rnveach commented 1 year ago

It is not like #121 from its top description.

The server stops transmitting any updates of the view. The screen on the viewer freezes while the connection and inputs are still working.

For me, the viewer gets completely disconnected. I did NOT see any lost of frame updates as that issues describes before I am disconnected. At https://github.com/bk138/droidVNC-NG/issues/121#issuecomment-1448959931 , they even say they don't see the connection dropping while I am being dropped when the OOM occurs.

Also, I didn't capture it exactly at the time, but my phone currently says I have 2.1 GB of memory free (average use is 5.9 out of 8). So I don't really consider this a low memory situation on my device.

bk138 commented 1 year ago

@rnveach you might want to try https://github.com/bk138/droidVNC-NG/releases/tag/v2.1.2 which has a fix for a memory leak (but is prone to crash when stopping the server). If this works, the incomplete fix in there would be the solution to this here issue.