yashsingh1/xdaforums huggingface dataset:
[EVO 4G Android Development] madsquabbles:
wow, never oc'ed a lcd panel before. would it be any worse (or equally damaging) than oc'ing a processor.

great job guys!
[EVO 4G Android Development] EtherealRemnant:
I want to see tearing. I'm curious to see how far the frame limit can go. I don't mind vsync breakage.

Obviously, the screen's refresh rate isn't 60hz or we would already see tearing... Its being forced to run at 80 on the second fix.
[EVO 4G Android Development] Cicatrize:
Wow, I just got a 4.5 stdev on one of the fps2d runs. lol. Just thought I'd share. That's awesome compared to the 20 I was getting with the first fix.
[EVO 4G Android Development] Estimated Prophet:
Why's that? A 60Hz with vsync should be able to produce 60 FPS fine and even higher rates with vsync off, but then you get the tearing.
[EVO 4G Android Development] codeman05:
Amazing work so far guys.

The 2nd Rom worked fine on DC3.2 w/ 0002 nova

Right at 40fps.

best part...no grounding issue anymore!!! Just tried it on a dozen surfaces that used to give me issues.

I love you guys :)
[EVO 4G Android Development] Cicatrize:
No grounding issues? Hmm, that is definitely interesting. ffolkes, did you set any other parameters back to their default values for the interface?
[EVO 4G Android Development] timgt:
Yeah, this 2nd fix is amazing. I got 3.86 stdev and actually got it on camera. I will try to upload it to youtube or something

EDIT: Here you go, camera kinda sucked http://www.youtube.com/watch?v=LkA_2VijNk0
[EVO 4G Android Development] Varo210:
I'm thinking that the FTE setting in the Nova screens is going to prevent that from happening. I'm not a dev, but I did try and read through the specs on the Nova screen, and if I'm not mistaken, they intentionally keep that from happening, and I'm currious if that's what is having our performance too. I am refering to the spec differences between high speed mode and normal mode. Like I said, not a programmer, so just thought I would throw this out there.
[EVO 4G Android Development] ffolkes:
it's all default (unset) except for T2 in the second kernel i posted.
[EVO 4G Android Development] Cicatrize:
Wow that's a thin ****in bell curve lol
[EVO 4G Android Development] amdchip:
Though through this temporary "dirty hack" it has been discovered that 80hz potential has been unlocked on the nova panel. Once/if this half fps cut is removed are we not looking at a possible 60-80fps phone?
[EVO 4G Android Development] madsquabbles:
that's basically what i was saying. the poster was asking about seeing frames higher than 60fps with source.

i didn't know they were forcing the the screen to run at 80Hz.
[EVO 4G Android Development] AssassinsLament:
Yes, it proves that it's 99% not a hardware limit, but an imposed software limit by HTC.
[EVO 4G Android Development] Cicatrize:
Pinch to zoom is much smoother in browser...
[EVO 4G Android Development] itzjonjon69:
this worked for my 002, thanks a ton ffolkes!
[EVO 4G Android Development] sciocchettilord:
can this be used with froyo port?
[EVO 4G Android Development] wildgillis:
If you bother to read a few pages back you will see that it is very unstable
[EVO 4G Android Development] madunix:
i have 0002 hardware with stock kernel, fresh .3 installed with aliosious(sry for spelling it wrong) theme, not using htc sense. i put the .zip on my sdcard n flashed... but now i'm getting a bootloop on the second boot screen... any suggestions?
[EVO 4G Android Development] amidsin:
Test results

Hardware: 003, nova

Rooted: Rooted using toast's 2-part method.

Recovery: Clockwork

ROM: DC 3.2

FPS patch - T2 from post #581.

Install method - wipe cache, install kernel, reboot. fps2d after first start - 29. Turn off and turn on the screen, fps2D - 40 with ~10 dev, second test 40 with ~5.5 dev. Gears - 41.

Everything appear to be working stable and smooth. Moving between home screen seems to a little smoother.

Keeping it a main configuration. Thanks so much for it.
[EVO 4G Android Development] Cicatrize:
ffolkes, I've done some calculation for the T2. Try this:

{0xb101, 0x00}, //T2

{0xb102, 0xAA}, //T2

Let me know how it goes. I can't compile at work.
[EVO 4G Android Development] dpilcher:
Thanks to all the hard work:

003 Nova

DC3.2 w/Aloysius/Snow

DCCONFG set to performance

Radio 1.39.00.05.31

Flashed MacBook Pro #112 Kernal

AVG=55 STDEV=7.51

Everything is stable and looking forward to the code and camera since I use it for FRING-SKYPE video calling. Everybody on here is just amazing!
[EVO 4G Android Development] Cicatrize:
The more I look at this, the value of 0xAA looks VERY promising for my calculation. It should, in theory, provide almost exactly 60fps based on the default value and the one you're using.
[EVO 4G Android Development] AssassinsLament:
Anything under 230 is out of sync.
[EVO 4G Android Development] Cicatrize:
Let's just try it.
[EVO 4G Android Development] sweteg:
edit: deleted
[EVO 4G Android Development] ffolkes:
hey, sorry for not getting back to your pm's. i keep getting sidetracked. this garbles the display. :/
[EVO 4G Android Development] AssassinsLament:
We have. That's why we know it's out of sync. :D
[EVO 4G Android Development] Cicatrize:
Did you try 0xAA, or just another value under 230?
[EVO 4G Android Development] vinscuzzy:
Is anyone else having issues charging the battery? My phone wouldn't charge, rebooted, still wouldnt charge. Pulled the battery, which enabled charging, but the battery indicator doesn't move. It has the little lighting bolt, but the level doesn't move, appears only to be visual. The battery is charging though. Anyone else?
[EVO 4G Android Development] ffolkes:
i tried specifically this. (and 235).
[EVO 4G Android Development] akrod2as:
I can confirm 1st fix didn't work, 2nd fix did. Avg 41fps in fps2d 4.89 dev

0002
[EVO 4G Android Development] phobia:
confirmed, 2nd fix works.. fps2d avg fps = 40

Hardware Version 002

haven't tried this yet, I am in my lab right now but will get to my desk in a while and check.
[EVO 4G Android Development] Tikerz:
I just plugged mine and the charging light comes on for a sec and goes away. I don't think it's charging for me at all.
[EVO 4G Android Development] EtherealRemnant:
My battery charges just fine... though it discharges just as quickly... I'm about to stick my battery into my TP2 and charge it there and see if it breaks through the dead cells on this battery...
[EVO 4G Android Development] Cicatrize:
I'm not having any charging issues with this kernel.
[EVO 4G Android Development] halorin:
You guys are awesome the T2 kernel worked for me.

To clarify, I have a 0003 with a Nova screen. Running Fresh 0.3 with the T2 Kernel.
[EVO 4G Android Development] tommy96814:
can this be flashed on android 2.2 or just 2.1?
[EVO 4G Android Development] Cicatrize:
I wouldn't flash it on 2.2. People are reporting issues.
[EVO 4G Android Development] Tikerz:
I tried rebooting and still cannot charge my phone.
[EVO 4G Android Development] gman8966:
T2 kernel worked for me over Damage 3.1.2.

002 Nova.

fps2d and gears for android I get 40fps avg

Makes a huge difference, can only imagine when this is ironed out perfectly how nice this will be.
[EVO 4G Android Development] :
Problems with T2 on Froyo. Force closes on start(then you can still get past it, but buggy), I tried playing with the power button trick, but no go.
[EVO 4G Android Development] EtherealRemnant:
Even more amazing - run your finger all around, making the gears spin like crazy - it will never drop below 40.
[EVO 4G Android Development] madunix:
is it mandatory to flash this kernel in order for the uncap patch to work? bc i flashed it with stock kernel n ended up in a bootloop
[EVO 4G Android Development] toastcfh:
ATTENTION

ok... thread is going way off topic and its becoming all about a boot.img. this thread is for development on kernel source. the boot.img was just for testing and not meant to fill up the thread with how to, can i, and im getting this. we all have come to realize that the fix works. there is no need to post benchmarks and confirming it working. i think we all seen it works like 4 pages back. so lets move forward and stay on topic. again this thread is for development. posting things that do not contribute to development only bury the things that. posting how many fps ur getting and ur benchmark scores is not contributing to anything but another person matching ur post and burying important information. so lets all do the right thing and get back on topic, so i dont have to go on a post deleting rampage. i know development is exciting and im excited to. but lets not divert the focus of the discussion. thanx
[EVO 4G Android Development] :
Eye rape

Black text works too, maybe pink. But I am not contributing so I will mute.
[EVO 4G Android Development] amdchip:
As noted above 60/2=30

And if I'm understanding the above information correctly MDDI_HOST_REV_RATE_DIV 0x0004 is probably to save power consumption?

what if we try:

#ifndef CONFIG_ARCH_QSD8X50

#define MDDI_HOST_REV_RATE_DIV 0x0000

#else

#define MDDI_HOST_REV_RATE_DIV 0x0002

#endif

I know someone already tried 0x0001 and this didn't work

I'm not a dev at all so please be kind ;)
[EVO 4G Android Development] Cicatrize:
Everyone knows you can't divide by zero.
[EVO 4G Android Development] amdchip:
I was hoping this would cause it to not divide.

-------------------------------------

Sent via the XDA Tapatalk App
[EVO 4G Android Development] ccicchitelli:
That's actually not a bad idea to try. Depending on how it's programmed it may handle the error and not make the calculation...
[EVO 4G Android Development] EtherealRemnant:
I would think it would cause it not to compile at all...

What happens if you just remove that code?
[EVO 4G Android Development] Estimated Prophet:
That code is just defining a constant. You'd need to figure out everywhere that constant was used and modify accordingly.
[EVO 4G Android Development] EtherealRemnant:
Well that's what I was hinting at. I'm not a coder but I can hack a kernel... Trial and error really. I just really can't stand disassembly.

If you use fastboot to push the temporary image, if the phone fails to boot, it reverts to its previous kernel, right? If it does, I may just grab the source tonight and start messing around...
[EVO 4G Android Development] luisrcastillo:
Correct. If you do "fastboot boot <img name>" it will just boot temporarily. Once you reboot it will go back to what you had
[EVO 4G Android Development] muncheroo:
According to this equation,

T2 needs to be set to 170 to hit 120Hz
[EVO 4G Android Development] EtherealRemnant:
Awesome. Now I need to read up on how to get an Android kernel compiled. Seems like people have had problems building this one. Yay for weekend projects lol.

I imagine if we can remove all references to that lock from the source, it will go to some default on the chip - ie., no lock but I can't be sure of this until I tinker.
[EVO 4G Android Development] halorin:
The T2 fix caused my phone to run warm and cause some reboots. I want to say my battery life was taking some serious damage, too. Going to run stock, but this is a great proof of concept.
[EVO 4G Android Development] Cicatrize:
Exactly why I posted the 0xAA (170) code earlier, but the problem is that 170 does not work very well. Screen gets ****ed.

I still ran FPS2D on the 0xAA for T2 anyway just to see (you can see it running still...kinda) and it was staying at 40fps anyway. We'll figure it out. At least we know it's not hardware and HTC lied to us.
[EVO 4G Android Development] amdchip:
Could the constant defined by "#define MDDI_HOST_REV_RATE_DIV 0x0002" be replaced with a doubled value in each instance it is found to be present in the kernel then the code removed? Is that what your planning to do?

Edit: the value is probably stored somewhere then requested by the code, maybe, hell I don't know what I'm even talking about, ill shut up now and let you amazing devs sort it out. Glad to see the thread re-railed though :)

-------------------------------------

Sent via the XDA Tapatalk App
[EVO 4G Android Development] muncheroo:
that's for sure. my theory is they didn't forsee major differences between using 2 different panel makers and something must have happened with one of them. and due to laziness or time constraints, they decided to take a shortcut and cap at 30fps to get rid of whatever problem they ran into. **** you htc. **** you.
[EVO 4G Android Development] Cicatrize:
Guys, I guarantee the MDDI_HOST_REV_RATE_DIV route is a dead end. I can pretty much guarantee that anything that's a defined constant in a header file for drivers will be a dead end, because they aren't usually modified. Also, remember, this is an Incredible kernel. If it doesn't have anything to do with the board files or the files modified by Toast, then the answer is not there.
[EVO 4G Android Development] Geniusdog254:
While that is partway true, it isn't entirely so. Most of the source there is applicable to many devices. Now if you go changing anything in board-incrediblec.c & whatnot, then of course it won't change anything. Just throwing that out there :)
[EVO 4G Android Development] Cicatrize:
In this particular case, it's almost entirely so, because component wise, the Incredible is the closest Android relative to the Evo. Yes, we may be able to find work-arounds, but as a developer, I hate work-arounds. I want to kill the source of the problem. lol
[EVO 4G Android Development] EliWay:
Have you guys noticed that the patch (tried #1 only) seems to get the phone really hot and drain the battery really fast?

Really does seem like there's something working really hard to cap it again and that's causing the phone to overwork.
[EVO 4G Android Development] EtherealRemnant:
I haven't experienced this with patch 2. Patch 1 doesn't work on my phone.
[EVO 4G Android Development] Jykinturah:
I really don't want to turn this into a "patch does this blah blah" thread, but I wish to note that I used patch #1, and my battery life and phone temperature are normal.

Isolated case I believe.

Devs, do your thing.
[EVO 4G Android Development] codeman05:
FWIW, video playback seems to FC on first viewing with this kernel (on 0002 nova DC3.2 and OMJ 1.3 roms, clean installs each).

IE: watching a MP4 via the

stock video player

...or watching

flash video

in skyfire browser.

On the second load, the video plays, but is rather jerky. Reverting to a stock kernel corrects the issue.

*slingplayer works though fine oddly enough*

Results were duplicated on a co-workers 0002 nova.

Sorry to interrupt. Keep up the good work :)
[EVO 4G Android Development] Kshawn:
Is there anything I can possibly do to contribute? I would really like to participate and not just leech.
[EVO 4G Android Development] Geniusdog254:
Dig through source and find/fix the 30fps cap :p

All kidding aside, if you have any C knowledge at all (or really any programming knowledge) download the source and set up a build environment. Just look through the source & see if you can find anything that may be important.
[EVO 4G Android Development] jmxp69:
Ya'll are amazing.

v002 Nova. Fresh 0.3 novfpsboot (v1) before and after. Glad to see the hardware is capable and looking forward to the clean hack.

Thanks guys for your hard work.
[EVO 4G Android Development] jmxp69:
+1

+100
[EVO 4G Android Development] phobia:
don't know if this helps but I am using Fresh 0.3 on a 002 Nova, with this kernel (TP2) and video playback in sling player works without problems.
[EVO 4G Android Development] jxs1984:
smoother, touchscreen is more responsive and grounding issue is gone. phone seems to be a little bit warmer than usual.

pretty neat! :D
[EVO 4G Android Development] Estimated Prophet:
Everybody, please quit posting your experiences. It's not news and it's only cluttering up the thread. If you have something related to the code feel free to post, but otherwise please lurk patiently for now.

Alright, so I may have had a few drinks, but I still think I might be on to something. Unfortunately, I'm away from the house, so I can't compile anything. If anybody wants to try this, please do and let me know the results.

Okay, lets begin.

Alright, I was doing some research on PWM. It's used for a lot of different things and it could just be used for modulating the backlight in our LCD, but it's also sometimes used to modulate the power consumption and/or frame rate. Sorry, but I haven't done enough research to have a simple formula for determining the FPS based on PWM and whatever other variables :P Anyway, lets take a look at the novatek initialization sequence.

{0x6a01, 0x00},
{0x6a02, 0x03},

The first line is setting the internal frequency source for generating the PWM signal. Setting it to 0, as shown, results in an internal frequency source of 5.5MHz. Setting it to 1 would bump it up to 11Mhz. Notice something?

The second line is setting the actual PWM frequency. What the frequency ends up being depends on what we set for the internal frequency source. The above code results in a PWM frequency of 21.48 KHz. If we set 0x6a01 to 1 the PWM frequency will be 42.97 KHz.

Alright, I put my phone down for a minute and forgot where I was going with this. Anyway, if somebody could try setting 0x6a01 to 1, I would appreciate it. I'll do it when I get home later if nobody else has. Oh, and you'd probably want to try this with toasts kernel, and not the versions that have been modified to increase the frame rate on the novatek panels.

Edit: If anybody wants to try to work with me on this, it'd be easiest for me to communicate through GTalk (viva.sativa) instead of the forum right now. I can try to help explain how PWM affects FPS and the other possible frequency settings and their results if anybody wants.
[EVO 4G Android Development] glokksomniac:
Can someone try turning off the Frame Tearing Effect? From the documentation it seems to be some kind of VSYNC. Not saying it should be left off, but turning it off would help to get a more accurate FPS, especially when modifying other timings like T2 or VPA.

replace:

{0x3500, 0x00}, // SET_TEAR_ON TEW=0, TEP=0

with:

{0x3400, 0x00}, // SET_TEAR_OFF

in the init sequence.
[EVO 4G Android Development] Cicatrize:
I'll try both of these. Give me a minute.

Just a prediction, the PWM stuff for CABC probably won't do anything though.
[EVO 4G Android Development] Cicatrize:
Both of those screw up the screen.
[EVO 4G Android Development] Estimated Prophet:
I had a feeling it might just be for saving power on the backlighting, but thought it was worth a shot. In my research I found that it can also be used to modulate the activation of pixels/creation of frames.

Edit: I checked the data sheet and it is just being used for the backlight.
[EVO 4G Android Development] Estimated Prophet:
I just realized that you'd want to set 0x6a01 to 0x80, not 0x01. I doubt it'll help, but if you want to humor me and give it a try it'd make me feel better :P
[EVO 4G Android Development] Cicatrize:
The maximum value is 0x1F (31)
[EVO 4G Android Development] Geniusdog254:
Hex makes my brain hurt :confused:
[EVO 4G Android Development] Estimated Prophet:
Yeah, for the PWM_DUTY_OFFSET, but that's only 5 of the bits. PWMSET sets both PWMF and PWM_DUTY_OFFSET. The first five bits set the offset and the eighth bit sets the pwmf. It looks like this:

Bit | 8 | 7 | 6 | 5 4 3 2 1 |
----------------------------------
Val | PWMF | 0 | 0 | PWM_DUTY_OFFSET |

So to set PWMF to 1 and PWM_DUTY_OFFSET to 0 the byte would be 10000000, which would be 0x80.
[EVO 4G Android Development] Cicatrize:
Oh, right, my bad, didn't look at the entire thing.

Anyway, I'm abandoning all init code hacking because capping is going on before the panel init, so I'm tired of spending hours on this when it won't solve the root of the problem.

The touch sensor is tied in with the driver as well, and it also caps at 30Hz, but with this init "hack" done today, it caps at 40Hz. There's still a cap going on, and I'm going to find this ****. :p
[EVO 4G Android Development] Estimated Prophet:
Alright, I've got an idea. If it's happening before the init, whatever is being set isn't going to be included in the init sequence. So, if we went through all the commands in the data sheet and found out which ones weren't being used in the init sequence, it should help us narrow down what settings is causing the cap. We could then add some code to write out the values and then compare those to what the datasheet says are the default values and see if there are any differences. Of course, this is assuming that it is just some setting being set ahead of time and not some other HTC code.
[EVO 4G Android Development] Cicatrize:
I've been working on this for hours. Gonna head to bed.

But what I think is happening is I think HTC is capping the entire MDDI bus including I2c. I just can't figure it out. I'll work on this tomorrow. Good night
[EVO 4G Android Development] geyes30:
Hi guys,

I have some additional information that may or may not be useful for us.

I used a 1200fps camera to look at the LCD, and it takes approximately 20 frames to refresh the screen, but then the screen just stays unchanged for another 20 frames. This works out to approximately 30fps, though the drawing rate seems to be 60Hz. I am using stock kernel, by the way, and I am not sure if normal LCDs also spend some time dwelling at the newly drawn frame.
[EVO 4G Android Development] muncheroo:
Whoa! excellent work. Can I borrow that camera to analyze my golf swing? :D

So this explains why when we take T2 < 240, it starts to tear and mess up because the max refresh the lcd can handle is 80hz.

Would also be very interesting to see what's happening with the first patch method and also what's going on with the epson screen.
[EVO 4G Android Development] geyes30:
Ok sorry I posted that while I was sleepy, so let me rephrase myself:

The camera shot at 1200fps. So each frame represents 1/1200 seconds. Now the total refresh cycle appears to be 40frames, i.e. 40/1200 seconds, which works out nicely to 30 Hz (a little too nice, but I checked it several times, and did it frame by frame). The actual changing took 20 camera frames, or 1/60 seconds, which means that the refresh rate capability of the LCD is 60Hz. Then the screen just sat there for another 1/60th of a second.

Another thing I noticed is that the backlight did not seem to flicker. I do not know how they cycled the backlight, but since the LCD uses CABC I had assumed that I would be able to at least see some flickering. That said, they might have cycled different bulbs, so that could explain the appearance of continuous lighting.
[EVO 4G Android Development] Cicatrize:
Nice info, thanks! I think it was assured we had 60Hz already, but this is real proof.

About the CABC, I haven't read too much into it yet, but from what I've read, the controller is able to get rid of 50/60Hz flicker. Not sure how.
[EVO 4G Android Development] Varo210:
Anyone tried changing this?

#define TYPE_CLIENT_CAPS 66

I was wondering what it would do if we changed that to 33?

Just a thought, might not have anything to do with things. I know squat about C programing.
[EVO 4G Android Development] crpercodani:
Sorry if this has been asked already but will this kernel work with 2.2 ROM's and will it break anything else besides camera? Thanks much.
[EVO 4G Android Development] Geniusdog254:
If you're sorry, how about you search?

Yes, it works with 2.2, but it's ridiculously buggy. And no, AFAIK camera is the only thing it breaks, except if you're on an Epson panel, then you may see some visual tearing.
[EVO 4G Android Development] crpercodani:
I deserved that.

Thanks for the info though.
[EVO 4G Android Development] EtherealRemnant:
It seems to break the light sensor as well and the battery drain is definitely higher than the stock kernel. My phone hit 103 degrees with moderate usage too.
[EVO 4G Android Development] apollooff320:
I had the FPS running and hurried and turned the screen of right when I started to run the test. I come back at see my average FPS at 81. Wish it was running like that with the screen on.
[EVO 4G Android Development] kpkimmel:
Ran fix 2 all day..104 degree max temp...only 6 1/2 hours of use with no gps or WiFi ...just some stats