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

Touch Input not working on TWRP 3.1.1 for Mediatek MT6753 Device. #1

Closed
iykex opened this issue Sep 15, 2017 · 50 comments
Closed

Touch Input not working on TWRP 3.1.1 for Mediatek MT6753 Device. #1

iykex opened this issue Sep 15, 2017 · 50 comments

Comments

@iykex
Copy link

iykex commented Sep 15, 2017

Hello TeamWIn, first of all i will say congratulations for making Android awesome with TWRP Touch Recovery.
Team, anytime i compile TWRP for y device, Touch Input does not work.
I am asking fir there are some things missing or i have to edit in other to the touch to work.
Thank You.

@jcadduono
Copy link

check to make sure its not just inverted or backwards by playing around on the screen, as that can be fixed in ur boardconfig with twrp flags
if its not getting touch at all, try flashing twrp to the boot partition instead and see if touch works
often times devices have touch disabled if booting recovery partition
in that case you have some options...

  1. with kernel source, stop touch from being disabled by editing wherever in kernel the partition boot check is
  2. without kernel source, use hex edits to make the touch disabler do nothing (good luck, some people have accomplished this)
  3. find another MT6753 device and hope its kernel with working touch works magically on your device too

@iykex
Copy link
Author

iykex commented Sep 20, 2017

Thanks for the reply.
I have tried several times the number "option 3" but still same error.
I don't have my kernel source so "option 1" can't be accomplished .
I am yet to try the "option 2" and the report to you back.

But can you assist me with the flags here :
_**

"check to make sure its not just inverted or backwards by playing around on the screen, as that can be fixed in ur boardconfig with twrp flags"
**_

Thank you.

@iykex
Copy link
Author

iykex commented Sep 20, 2017

If i may ask, is there any file to modify in TWRP source to make touch work ?

@CaptainThrowback
Copy link
Contributor

Not if the kernel is the issue.

@mahadi78
Copy link

Hi,

Thanks team win recovery builder team for their tremendous invention that make Android use better to us.

Lets start to.describe my issue:

I am facing the same issues as described above for my mtk6580 based chipser having kernel version 3.18.19 marshmallow based rom.Touch Input not working on TWRP 3.1.1
I don't have any kernel.source. Can you help me please to make twrp input touchable..

@paradoxnafi
Copy link

I have the same problem.
My device Mt6580 kernel 3.18.19+. Kernel source is not available.
TWRP touch screen doesn't work. However I can flash rom with flashify. But can't fix in case of brick.
However I have a working filz touch recovery anf touch works here. But as we know, most of the rom are written in TWRP script.
Please help us Team Win....

@ghost
Copy link

ghost commented Oct 1, 2017

Ok, I have have been absent, but all is about to change, thx for your patients :)

@iykex
Copy link
Author

iykex commented Oct 13, 2017

@lj50036 any clue about how to solve the about error/issue ?
thanks

@omer198023
Copy link

Tank

@parthibx24
Copy link

@CaptainThrowback i saw some devices with MT6580 chipset that touch working on philz recovery but its not working on twrp..(sorry i dont a device with this bug...so i cant give a log)

@nutzaza55255
Copy link

Hi

1 similar comment
@nutzaza55255
Copy link

Hi

@LosTigeros
Copy link

Just want to tell that jemmini from xda forum had fixed this problem on one phone.
https://forum.xda-developers.com/general/device-reviews-and-information/umi-apollo-coming-defined-fans-t3276280/post66369781#post66369781

@iykex
Copy link
Author

iykex commented Nov 12, 2017

@LosTigeros want to know the process of how he fixed it, you sharing or he sharing it would be very good and that will help a lot.

@LosTigeros
Copy link

If I knew it then I would write it here.
But I don't know how'd he fixed the issue.

Maybe someone should write to him?

@iykex
Copy link
Author

iykex commented Nov 13, 2017

  • Maybe this post can be useful.

See here →↓

@LosTigeros
Copy link

Yes it is very useful. I'll check that soon.

@LosTigeros
Copy link

LosTigeros commented Nov 15, 2017

IT WORKS!
So I writed a tutorial for You what I have done.

I've rooted my phone, connected to the terminal via adb, got root access and typed:

echo 0 > /proc/sys/kernel/kptr_restrict
cat /proc/kallsyms | grep tpd_i2c_probe

It returned me the address of where touch screen driver? starts in the kernel.
For me it was: ffffffc000356a4c t tpd_i2c_probe

Next i dumped kallsyms from the phone with:

cat /proc/kallsyms >/sdcard/symbols.txt

and them pulled that file to my PC.

Next I've downloaded Carliv Image Kitchen and got mine TWRP recovery image.
First I unpacked recovery.img image with Carliv Image Kitchen. Then i looked for recovery.img-kernel file and analysed it using HEX Editor.

My kernel file contains some data at the end so I copied them because as i expected I needed them later.
data

I removed these random data from the file and i could normally decompress the file using 7-Zip.
kernel_file

Now I could normally open that file in IDA Pro so I did that.
I've opened IDA Pro and dragged decompressed kernel into IDA window.
I choosed ARM Little-endian [ARM] processor type and clicked OK and Yes
processor_type

In next window I had to set proper ROM start address and Loading address so I did that.
My kernel is 64 bit so value which i had to type in was 0xFFFFFFC000080000 (for 32 bit the value is 0xC0008000) and clicked OK and Yes.
open_kernel

Next I've got a message about that IDA can not identify the entry point automatically as there is no standard of binaries so I clicked OK.

Next I downloaded kallsyms_loader.idc (I had to change extension from .idc.c to .idc).

I've opened this file and commented out (added // to the beggining of the lines) these lines because they were throwing error for me:

static trim(str) {
    return rtrim( ltrim(str) );
}

Next I've pressed File -> Script file... and selected that kallsyms_loader.idc file.
Next I had to select that symbols.txt file which I've pulled from the phone.

Now I had to wait as the script finish its job and then wait for the IDA to parse all these functions so kernel was more readable now.

Now I went to Options -> General and changed Number of opcode bytes (non-graph) to 6 and clicked OK.

Next I've went to the address which phone returned for me (ffffffc000356a4c) and I finded out what I needed to change. So I clicked Edit -> Patch program -> Change bytes... and I replaced statement and return with NOP (NOP for 64bit ARM its 1F 20 03 D5 and for 32bit ARM its 00 F0 20 E3).

patch

Next I've saved my changes to the kernel by Edit -> Patch program -> Apply patches to input file.

I have to repack the recovery now so...

I've compressed the kernel image using 7-Zip.
compressed_kernel

Next I removed other kernel files and renamed my kernel file to recovery.img-kernel (yes I removed the extension).
renamed

Next I had to paste these values which I copied at the beginning from the original kernel to the end of our modified kernel because my phone doesn't wanted to boot up.
appended

Then I just repacked and flashed my recovery.img image.

Touch screen now works perfectly for me in recovery!

Now if it works for me, then it should work for You!
But remember that this instruction was writed for gt91xx touch driver.
Enjoy!

@iykex
Copy link
Author

iykex commented Nov 15, 2017

@LosTigeros the is awesome, ain't it ? ! cool.
thanks for testing and reporting that it works.

@LosTigeros
Copy link

LosTigeros commented Nov 15, 2017

Yes, that's awesome that we resolved the problem but sad too that someone have added that to the driver:

if (RECOVERY_MODE == get_boot_mode())
    return 0;

@iykex
Copy link
Author

iykex commented Nov 15, 2017

Yea, but in all, its all good that the issue/problem which has been worrying most MTK users can be resolved with the above experiment.
**

MTK will be better someday

**

@kengraWin
Copy link

goos

@jeronelailo
Copy link

@LosTigeros my recovery does not boot after doing your tutorial T_T
My Device is MT6580

@LosTigeros
Copy link

@jeronelailo at first you should read that we're talking here about MT6753 based devices with gt91xx touch driver.

@jashanerm
Copy link

Sir what Do you mean by that

and I replaced statement and return with NOP (NOP for 64bit ARM its 1F 20 03 D5 and for 32bit ARM its 00 F0 20 E3).

Im new at this, im a noob And i really dont know what you mean by replaced the statement..

@axxaax113
Copy link

@LosTigeros Thank you for guidance.
I have read through and feel somewhat confusing a few positions. Hope you can help yourself complete with, sincerely thank you
Here is my twrp file: https://drive.google.com/open?id=14PqOnYkdPDpuCWeUDw-x0YxOPhoQGFXv
Or you can share yourself please file again: kallsyms_loader.idc
I do not understand "removed these random data from the file and i could normally decompress the file using 7-Zip" Can you guide yourself in more detail?

I'm not a foreigner so I have to "google translate" you understand

@LosTigeros
Copy link

@jashanerm just look at the screenshot

@axxaax113 to get the kallsyms_loader.idc file you have to click on the filename in instruction post. It'll open pastebin with code for you.

I do not understand "removed these random data from the file and i could normally decompress the file using 7-Zip" Can you guide yourself in more detail?

When I've opened recovery.img-kernel in the HEX Editor then I saw that on the end of this file there is some important data which you cannot extract because they are not a gzip file, they are appended to the file after the compression. So I've removed them using HEX Editor (I've copied them to the Notepad++ because at the end, after compression you have to append them again to the kernel) and then I could decompress the kernel.

@axxaax113
Copy link

@LosTigeros Thanks for answering. May you help me fix this always? These are the things I think are enough for you to fix yourself. If you need anything more then I will upload. thank you very much.
https://drive.google.com/file/d/1iCZUBKzMvweU1SBylBPT4WznoYs8_0F5/view?usp=drivesdk
https://drive.google.com/file/d/1wQJi6NTcs-Md45g-J758iKlF5E3omM6v/view?usp=drivesdk

@LosTigeros
Copy link

LosTigeros commented Dec 4, 2017

@axxaax113
At first -> I dont have access to these files.
At second -> I need to know what phone, cpu, is system 32/64 bit and touch screen driver you have.
At third -> I would need the result of cat /proc/kallsyms | grep tpd_i2c_probe, entire kallsyms in text file and your recovery.

I may look into your kernel but i dont promise i'll make it working for you.

@axxaax113
Copy link

https://1drv.ms/u/s!Ak8AoddZPqa2bBaoDZRs_1gEwkI
Please fix touch twrp

@axxaax113
Copy link

into IDA like this, what file editor do you have? guided with
https://photos.app.goo.gl/hNY3GUcNRtp462gf1

@axxaax113
Copy link

@LosTigeros
Copy link

LosTigeros commented Dec 5, 2017

I need to know what touch screen driver you have.

I writed instruction for gt91xx touch driver. You have other touch driver so these instructions wouldn't work for you.

I need to analyze source code of touch driver to check where it rejects loading driver.

@Naimur9800
Copy link

@LosTigeros bro i have extract mtk6753 recovery with carliv image kitchen and got kernel/zimage but i couldn"t extract zimage into 3 parts like you did with 7zip T_T

@LosTigeros
Copy link

@Naimur9800 it should be 1 file.
I just show there 3 files to show you difference in size of original, removed data at the end and decompressed kernel.

@axxaax113
Copy link

I do not understand the problem you. I do not use touch driver at all. I follow your steps but are having difficulty at IDA, I do not know which one to choose to set to NOP. I take a screenshot, please look at and guide me, thanks a lot

@axxaax113
Copy link

@LosTigeros my touch driver ffffffc000909da0

@Naimur9800
Copy link

@LosTigeros bro I want you to grant/accept my request that please make a video tutorial,so that we can fix that without any Hasitaion and It will be also very much helpful to us (for noob actually 😂 ) pls pls pls

@LosTigeros
Copy link

I don't have enough time to make one. You should be happy that i made this tutorial for everyone.

@Naimur9800
Copy link

@LosTigeros ,ofcourse bro we are very curious and happy that you have successfully tested and give us tutorial of how you fix it but some like me never can understood those worked like u did 🤔☢ so pls do if you can

@axxaax113
Copy link

Plese help me @LosTigeros. NOP line ??? You can see picture

@Waterboy1602
Copy link

I'm having the same problem you've described and fixed, but I don't find the hex statements I need to remove. Could you maybe help me with that. I have a Elephone S3 (MT6753) with a gt9xx touch driver.
I added a screenshot of my IDA screen. I just need to find the right statements.

ida

@LosTigeros
Copy link

@Waterboy1602 just try and you'll find
I suggest you to try to NOP these:
image

@Clrkz
Copy link

Clrkz commented Dec 17, 2017

Finally! It Works!
Thankyou @LosTigeros ! My Touch Driver is gt1xxx
I Tried to NOPs the BL and CMP with #2 which is the RECOVERY_BOOT(2)
idafck

@iykex
Copy link
Author

iykex commented Dec 17, 2017

finally it worked for u

@kengraWin
Copy link

good

@jeronelailo
Copy link

@LosTigeros can you try that on mine?

http://upfile.mobi/C0YpuG6BUmy

MT6580 - GT9XX Driver

@lalitjoshi06
Copy link

I port twrp for infinix zero 5 mtk6757cd. But i don,t know the touchscreen driver.
It is working if i boot it in boot partition with fastboot boot recovery.img.
But after flashing touch not works.
Pls guide me to fix the issue.

@ghost
Copy link

ghost commented Dec 20, 2017

What has this become ?
Last time I check this is a minimal manifest project ?
I am fully unware why all this offtopic shit is being posted here ?
I can just shut it down, maybe that is the best idea.

@ghost ghost closed this as completed Dec 20, 2017
@minimal-manifest-twrp minimal-manifest-twrp locked as off-topic and limited conversation to collaborators Dec 20, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests