Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Display upside down or no touch #5

Closed
stylefish opened this issue Sep 27, 2019 · 15 comments · Fixed by #7
Closed

Display upside down or no touch #5

stylefish opened this issue Sep 27, 2019 · 15 comments · Fixed by #7

Comments

@stylefish
Copy link
Contributor

stylefish commented Sep 27, 2019

Hi AsteroidOS Team,

first: thanks for all the work to bring this project to life! :)

i have a problem on my KW88 (recently bought from GearBest) but i think this might be a newer hardware model? i read sth about a 2018 model. SP Flash says:

Chip Name: MT6580
Chip Version: 0x0000ca00

when i flash the "harmony" images i'll get a 180 degree flipped "upside down" view of AsteroidOS with touch working. but completely flipped (e.g. top left touch initiates a press at bottom right).

When i flash the "inharmony" image the watch is in correct orientation but touch does not work.
so i thought it might be just a little issue with a config file mix of both images, but i'm unable to determine at which files to look, otherwise i would've tried to fix this myself :)

what can i do about this, do you have any hints for me where to look or do you maybe know what the issue might be?

thanks for any help, and keep up the great work! :)

@stylefish stylefish changed the title Display Upside down or no touch Display upside down or no touch Sep 27, 2019
@FlorentRevest
Copy link
Member

Hi stylefish,
Thanks for looking into this! I can point you to the three places where screen is rotated:
qml-asteroid: https://github.com/AsteroidOS/meta-mtk6580-hybris/tree/master/recipes-asteroid/qml-asteroid
asteroid-launcher: https://github.com/AsteroidOS/meta-mtk6580-hybris/tree/master/recipes-asteroid/asteroid-launcher
psplash: https://github.com/AsteroidOS/meta-mtk6580-hybris/tree/master/recipes-core/psplash
lipstick: https://github.com/AsteroidOS/meta-mtk6580-hybris/tree/master/recipes-nemomobile/lipstick
In all cases you'll find a .bbappend that includes a rotation patch for harmony and a subdirectory that contains the rotation to apply. If you want to play with rotations maybe you can tweak those files.

Regarding the touchscreen, this is defined in default.conf https://github.com/AsteroidOS/meta-mtk6580-hybris/blob/master/recipes-asteroid/asteroid-launcher/asteroid-launcher/default.conf#L3
I see it is included in harmony but not in inharmony! https://github.com/AsteroidOS/meta-mtk6580-hybris/blob/master/recipes-asteroid/asteroid-launcher/asteroid-launcher_%25.bbappend#L2 This is probably the bug you are after.
Try adding SRC_URI_append_inharmony = " file://default.conf" at the end of the file and recompiile an image for inharmony. This should probably help.

@stylefish
Copy link
Contributor Author

Hey @FlorentRevest thanks for your input, i tried to build asteroid (without changes at first) on my local ubuntu VM (disco) with and without docker, clean repository. i cloned i freshly from the asteroid repo (
seems sth. is broken? but i dont really have the expertise to tell whats wrong and fix it on my own...

i attached a log, maybe you can point me to a fix?

thanks :)
log.do_compile.2004.zip

@stylefish
Copy link
Contributor Author

little update on this:
ok, i simply set up a new vm, dont know why the last build failed with interrupt... in there i tried to build a cleanly cloned asteroidos for inharmony exactly as stated in the docs (with docker). but i'm still unable to compile successfully, hopefully with an error thats easier to fix? i googled a bit, but i dont think i can fix this one on my own.

unknown signature for 'Iso8601/+0000' at /asteroid/build/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/tzdata-timed/+gitAUTOINC+5b8b301e6e-r1/git/scripts/find-aliases.perl line 222.
make: *** [Makefile:52: find-aliases] Error 255
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /asteroid/build/tmp-glibc/work/armv7vet2hf-neon-oe-linux-gnueabi/tzdata-timed/+gitAUTOINC+5b8b301e6e-r1/temp/log.do_compile.18729)

the mentioned log is attached. i will try to figure this out on my own in parallel, but if you have a hint it would be much appreciated.

log.do_compile.18729.zip

@FlorentRevest
Copy link
Member

Hi stylefish,
I couldn't figure it out myself yet. For now I just removed the package from the build and could build with that.
Remove "tzdata-timed" from src/meta-asteroid/recipes-nemomobile/timed/timed_git.bb

@stylefish
Copy link
Contributor Author

stylefish commented Oct 11, 2019

nice, touchscreen is working, but the touch is still inverted. so my current situation:

  • display: correct orientation, works
  • touch: inverted orientation but works (when i touch the display at the top a tap on the bottom is emitted, left -> tap right, swipe up -> swipes down etc.)

another hint where i can tweak the touch orientation? in the meantime i will have a look what i can do.

EDIT:
i added the file://0002-GestureFilterArea-Fix-swipe-interaction-on-rotated-s.patch to the bbappend and now the touchscreen is correct on the "main display" but inverted in the app list etc. i think i have to apply the "touch rotation" to these areas as well?

greetings and thanks for your help so far :)

@allan175
Copy link

You can change the orientation for everything by changing CONFIG_MTK_TOUCHPANEL_PHYSICAL_ROTATION
in src/meta-mtk6580-hybris/recipes-kernel/linux/linux-harmony/defconfig

I got Asteroid working on the Lemfo Les1 using that (and a code fix for 90 degree orientation).

@stylefish
Copy link
Contributor Author

great! watch is working now! thank you guys. @FlorentRevest do you want me to create a PR for this? i think it would break the other harmony watches that are working now because of the change allan175 suggested?

@allan175
Copy link

The reason I've not done a PR for this fix is partly due to having to get a fresh install to build and it's currently not building.
And partly the fact I don't know how to make the config file dependant on the platform (Les1 vs others).

@stylefish
Copy link
Contributor Author

@allan175 yeah, i think thats the biggest problem... when the conf file could be changed only for inharmony i could create a PR that contains your fix for the rotated touch behavior and the fix for the non-working touchscreen. lets wait for FlorentRevest, maybe he can share his opinion or a solution for this and then you or i can create a PR according to his suggestions :)

@FlorentRevest
Copy link
Member

Thanks a lot for your work and patience guys... :)

Yes, please do send a PR!

In a yocto recipe, you can make changes depend on the platform name using a "_deviceName" suffix to the variable you set. For instance, if you want to apply a kernel patch only for inharmony, you can use this:
SRC_URI_append_inharmony = "screen-rotation.patch"

If your PR only affects inharmony I have got no problem merging it as inharmony has actually never been tested before so you can only improve the situation there... :)

@stylefish
Copy link
Contributor Author

Hey,
sorry for the late reply. i had no spare time left to look at the source again :(
but now i'm ready to send that PR! only thing i dont really get is what to do to override the screen rotation in "defconfig" for inharmony.
i change this line to look like this:
CONFIG_MTK_TOUCHPANEL_PHYSICAL_ROTATION="180"
ok great, works, but now i'm stuck on how to create that patch you mentioned.
where do i put SRC_URI_append_inharmony=... and where do i put in the screen-rotation.patch file? and what to put into it (i'm guessing it is a patch file created by git?).
sorry, but yocto and bitbake are complete strangers for me... :/
i will send the PR without the patch file so you can have a look and then correct it when i know where to put the patch file and the reference :)
thanks :)

@stylefish
Copy link
Contributor Author

stylefish commented Jan 25, 2020

ok update: i THINK i got it working. i built this and flashed it successfully to my watch and am able to control the screen via touch in the correct orientation. i cant really test because battery died on my KW88 and the cable is so loose that it resets all the time... and the button oddly seems not to work... but i'm pretty sure is was with that config... may be my hardware...
@FlorentRevest could you please have a look at the new file "inharmonyconfig" and the SRC_URI_append_inharmony if that looks right? this was kinda trial and error ;)
greetings

FlorentRevest added a commit that referenced this issue Jan 28, 2020
Correct orientation and touch control fix for inharmony on KW88 #5
@FlorentRevest
Copy link
Member

This looks fine, thank you! :D

@stylefish
Copy link
Contributor Author

Hi, thanks, yes i have tested this in all conscience, but as noted my watch died and so i had to test with the magnetic charger attached. to my knowledge it works like the manual change i did before (set rotation to 180 degree). thanks for merging, and thanks for an awesome watch OS :)

@Dubindustrial
Copy link

How can I flash the patch solution that allan175 made for LES1 ? For fixed 90 degree touch

MagneFire pushed a commit to MagneFire/meta-mtk6580-hybris that referenced this issue Oct 22, 2021
MagneFire pushed a commit to MagneFire/meta-mtk6580-hybris that referenced this issue Oct 22, 2021
MagneFire pushed a commit to MagneFire/meta-mtk6580-hybris that referenced this issue Oct 22, 2021
…entation

Correct orientation and touch control fix for inharmony on KW88 AsteroidOS#5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants