Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duo2 touch dead after switching screens #50

Open
9 tasks done
Clanceeinfinity opened this issue Aug 27, 2024 · 27 comments
Open
9 tasks done

Duo2 touch dead after switching screens #50

Clanceeinfinity opened this issue Aug 27, 2024 · 27 comments

Comments

@Clanceeinfinity
Copy link

Acknowledgements

  • I have chosen an appropriate title.
  • All requested information has been provided properly.
  • This is not a feature request.
  • This issue is not a duplicate of an existing issue.
  • The issue is solely related to this GSI.
  • This issue occurs with the latest available build.
  • I am not running a custom vendor on my device.
  • This issue is not kernel related.
  • This issue is not related to Magisk/KernelSU/APatch.

Info

  • Device: duo2
  • GSI version: gapps 07.25.2024
  • Vendor version:

Expected Behavior

you close the device so that both screens are on the outside, then rotate the device to switch your screen, now you should be able to use the device.

Current Behavior

Instead of switching normally, sometimes both screens turn black and additionally every time you try that, touch stops working and you gotta reboot by holding power for a few seconds.

Possible Solution

No response

Steps to Reproduce

  1. turn device on
  2. fold it outwards
  3. rotate to switch to the other screen

Logs

No response

Additional context

No response

@Ethanol10
Copy link

Aye, I get this issue sometimes too

@fisch92
Copy link

fisch92 commented Sep 1, 2024

Problem exists also with Version v2024.08.18. It happens not always, but very often.

@JayBee-git
Copy link

I can confirm I got that issue too, just after a clean install.

@fisch92
Copy link

fisch92 commented Sep 1, 2024

I also get the problem with stock os and lawchair launcher instead of the stock launcher. The stock launcher is a modified microsoft launcher, right? Is it possible to install it on the custom android 14?

@Ethanol10
Copy link

Might be related, but when attempting to switch screens by double tapping, this issue occurs. But also you can repeatedly switch screen by rotating the device and double tapping on each screen. Maybe something to do with how PostureProcessor handles the double tapping?

@Ethanol10
Copy link

@Clanceeinfinity by chance do you have a pen? turns out when the display locks up, you can use the pen to "reset" the touch and it restores the touch input after using the pen.

@Clanceeinfinity
Copy link
Author

ohh i sadly don't have the pen, i will buy it tho!

@Archfx
Copy link
Owner

Archfx commented Sep 11, 2024

How frequently does this issue occur? Potential places that can happen are either posture_processor or the system.

Let's start with the posture processor. For that I need a log file when the issue is replicated in the background.
Use the following command to initiate the log process and recreate the issue.

adb -d logcat | grep POSTURE > log.txt

do a "ctrl + X" to exit the log process. Include the log file here as a text file.

I assume It is getting into an undefined state. Let's see!!

@Clanceeinfinity
Copy link
Author

i never logged before so I'll try it later, as for how often this happens, it's every time you swap screens

@Ethanol10
Copy link

posturelog.txt

Had to run a slightly different command but it should grab the specified logs requested.

@Ethanol10
Copy link

Here is a video of this issue:

Sd2-1.mp4

@Ethanol10
Copy link

Ethanol10 commented Sep 11, 2024

There was also a case I sometimes run into where the screen that should be active is deactivated, and the one behind turns on. Flipping to the other side to use it in this case then sets the other screen active, and vice versa. This is fixed by closing the device and opening it again, resetting it back to usual function. The touch input in this case also disappears until the pen is used, in which normal touch input can be used.

@Archfx
Copy link
Owner

Archfx commented Sep 11, 2024

I see, this is very informative. The issue should be in the touchHAL then. Since the touch pen is working. The original FSM for the posture processor was from Thain. Which I modified later. It either overrides the previous touch object or attaches to a null object or something when the posture is changed. Log does not contain an error since it does not create an error rather a problem in the logic of the FSM.

@Clanceeinfinity
Copy link
Author

Unrelated but i saw a different (now closed) issue here and this is present for you too, when folded you get 2 navigation bars and the home screen shuffles together with the notification panel being waaaay to big. Id recommend going to developer options and changing your minimum width to from 537 to 600!

@Archfx
Copy link
Owner

Archfx commented Sep 11, 2024

Unrelated but i saw a different (now closed) issue here and this is present for you too, when folded you get 2 navigation bars and the home screen shuffles together with the notification panel being waaaay to big. Id recommend going to developer options and changing your minimum width to from 537 to 600!

| See, I thought that it was an issue with the trebuchet launcher. Now seeing this I think the culprit is this patch that I added to resize the allapps window.

Added later: this patch is just adjusting the height of the all app. I think this is still an issue in the trebuchet launcher which is created by a condition that checks the device screen width.

@Archfx
Copy link
Owner

Archfx commented Sep 11, 2024

I see, this is very informative. The issue should be in the touchHAL then. Since the touch pen is working. The original FSM for the posture processor was from Thain. Which I modified later. It either overrides the previous touch object or attaches to a null object or something when the posture is changed. Log does not contain an error since it does not create an error rather a problem in the logic of the FSM.

If anyone is interested in taking a look at the state transition logic, it is here https://github.com/Archfx/duoPosture/blame/main/src/main/kotlin/com/thain/duo/PostureProcessorService.kt#L467

@Archfx
Copy link
Owner

Archfx commented Sep 13, 2024

During the posture change, the device change the system mode between tablet mode and phone mode (I made this to make it more usable in two modes, getting rid of this would have solved this). Upon a lot of inspection (after the observation from @Clanceeinfinity) I realized that there are certain places where the default Android implementation is not properly switching (some elements are still in tablet mode while others are transitioned to phone mode). I think this is affecting this behavior as well as several other reported cosmetic issues. I am trying to fix this (you may have seen multiple alpha releases). I will give an update on this soon.

@Archfx
Copy link
Owner

Archfx commented Sep 18, 2024

After a lot of experiments, I was able to implement a proper way to switch between Tablet mode and Phone mode inside the UI. This fixed a lot of cosmetic issues that were there in the previous releases.

Can you guys try to reproduce this error on the latest release?

@Ethanol10
Copy link

Will report here when I get the chance!

@Ethanol10
Copy link

It seems as if the screens still lose touch input on screen switch. Pen still restores input.

@Archfx
Copy link
Owner

Archfx commented Sep 19, 2024

It seems as if the screens still lose touch input on screen switch. Pen still restores input.

Okay, in this case, it is the posture processor, duo1 and duo2 use two versions of touchHAL,

import vendor.surface.touchpen.V1_0.ITouchPen #duo1
import vendor.surface.touchpen.V1_2.ITouchPen #duo2

Then it looks like duo2 touchHAL is having this issue.

@Archfx
Copy link
Owner

Archfx commented Sep 20, 2024

I am building a test version with the downgraded touchHAL for duo2 devices, lets see what happens.

@Archfx
Copy link
Owner

Archfx commented Sep 20, 2024

Please try the latest version and let me know how it goes. I would like to see a log file on this if it does not fix the issue. This is using touchpen.V1_1.

@Ethanol10
Copy link

On boot, it seems as if the touch does not work at all. Using the pen restores the input.

After trying to change the active side while folded to only show one screen, It seems to shut off both screens with the nav bar active on both screens.

Seems to be worse overall regarding the touchpen downgrade.

I've attached an unfiltered log:
log.txt

@Archfx
Copy link
Owner

Archfx commented Oct 2, 2024

posturelog.txt

Had to run a slightly different command but it should grab the specified logs requested.

Looking at your log file again I found similar scenario we observed in Issue #61.

09-12 01:05:57.275  3381  3381 D POSTURE PROCESSOR: Got posture FlipLRight : R270
09-12 01:05:57.276  3381  3381 D POSTURE PROCESSOR: Loaded X: 1344 Y: 1892 HINGE: 66 OFFSET: 705
09-12 01:05:57.276  3381  3381 D POSTURE PROCESSOR: Processing posture FlipPRight : R0
09-12 01:05:57.286  3381  3381 D POSTURE PROCESSOR: Setting display composition 1 new!
09-12 01:06:02.075  3381  3381 D POSTURE PROCESSOR: Got posture FlipLLeft : R270
09-12 01:06:02.077  3381  3381 D POSTURE PROCESSOR: Loaded X: 1344 Y: 1892 HINGE: 66 OFFSET: 705
09-12 01:06:02.077  3381  3381 D POSTURE PROCESSOR: Processing posture FlipPRight : R0
09-12 01:06:02.087  3381  3381 D POSTURE PROCESSOR: Setting display composition 1 new!
09-12 01:06:28.176  3381  3381 D POSTURE PROCESSOR: Got posture FlipLRight : R270
09-12 01:06:28.179  3381  3381 D POSTURE PROCESSOR: Loaded X: 1344 Y: 1892 HINGE: 66 OFFSET: 705
09-12 01:06:28.179  3381  3381 D POSTURE PROCESSOR: Processing posture FlipPRight : R0
09-12 01:06:28.189  3381  3381 D POSTURE PROCESSOR: Setting display composition 1 new!
09-12 01:06:32.175  3381  3381 D POSTURE PROCESSOR: Got posture FlipLLeft : R90
09-12 01:06:32.176  3381  3381 D POSTURE PROCESSOR: Loaded X: 1344 Y: 1892 HINGE: 66 OFFSET: 705
09-12 01:06:32.176  3381  3381 D POSTURE PROCESSOR: Processing posture FlipPRight : R0

Could you please check the status of this issue on the new release.

@Ethanol10
Copy link

Ethanol10 commented Oct 2, 2024

Touch issues still persist during this release, it can be reset the same way with the pen.

@Clanceeinfinity
Copy link
Author

Yes the touch issue is still present for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants