yashsingh1/xdaforums huggingface dataset:
[Xperia Play Android Development] farenheith:
Yeah, I know.

Dan embed the fix on his ROM since the first version. This is current using the version 1.0. If you want to test the 1.1, take a look on the OP. Recently I updated there with instructions to it and a flashable zip to Dan's MIUI ROM.
[Xperia Play Android Development] markphyton:
Farenheit here are the new ICS Touchpad Drivers orginal .431 from Sony.

Maybe you can fix now more at your work.
[Xperia Play Android Development] farenheith:
Wow, thanks!

I confess that I don't know much about the android structure, but it's looks that it's something to do with the gamepad buttons. Maybe this can solve the gamepad recognition on games like Star Batalion and The king of fighters! I'll do some test as soon as I can
[Xperia Play Android Development] CosmicDan:
Binary KCM's do nothing on ICS. And those KCM's have nothing to do with input drivers. Do your research man :\

Sent from Xperia Play (R800a) with Tapatalk
[Xperia Play Android Development] farenheith:
Oh, you're right....

Now I remember... We already tried that :/

Edit: Also, I saw that you're already included the V 1.1 on your ROM. I'll remove the fix from here, then
[Xperia Play Android Development] criskros10:
For the pacman rom.. how zip I need? CM10?

Enviado desde mi R800i usando Tapatalk 2
[Xperia Play Android Development] farenheith:
I don't know this ROM... but, for experience, the framework of this ROM must be patched following the instructions on the post #2
[Xperia Play Android Development] CosmicDan:
Oh yeah sorry, forgot to tell you :)

EDIT: It's possible that some badly-coded games could use the kcm.bin files to check if it's an Xperia Play, but on the official ICS beta there are no kcm.bin files at all (because binary KCM's are only used on GB). So the real way to see is if those games that have mixed up buttons work on the ICS Beta.
[Xperia Play Android Development] farenheith:
I don't know... I tried that with Galaxy on Fire 2 when we discussed this, but didn't work... maybe some game do.... but it's like do the hard way for something already implemented on the simplest way xD. I'll try again
[Xperia Play Android Development] criskros10:
it's a combination of Paranoid Android, A.O.K.P & CyanogenMod how method I need?
[Xperia Play Android Development] farenheith:
I didn't understand your question very well, but the fix must be implemented on the framework.jar of this ROM, following the instructions of the post #2. It's not hard for the ones that know programming. I tried to put the changes inside the context where it must be, to simplify the understanding of each step of the mod. But there's no other way I can confirm, sorry. At the moment, I'll not implement multiple versions of the fix anymore due to time issues. So, the best thing is the ROM devs put the fix embed on his ROM, as CosmicDan did. This fix is well tested and can be implemented on any ROM. Also, in beta stock based ROMs the dev must pay more attention, because great parte of the fix is already there, just the lines for the always activator behavior and the new changes on the MotionEvent that is not. (I will give some particular instructions for this case later)

Another great thing is if someone interested on port the fix to another ROMs do the changes and provide the version to us, as cj360 did for AOKP sometime ago.

Unfortunatelly, my time is very short and I want to use it to research about improve the fix.
[Xperia Play Android Development] farenheith:
Guys,

I was not following the new threads of the forum, as I said, for time issues. But, after the questions about the CAMP ROM, I took a look, and I saw that is very promising. The first ROM I saw with working camera, that's great and I totally support JB on Xperia Play, so, I'll doing a fix to this ROM.
[Xperia Play Android Development] ~iSamur@i:
sorry farenheith, but are you talking of the CAMP rom by zackconsole or the wedgess's PACman rom? Just to be sure, i don't want to do mistake xD
[Xperia Play Android Development] farenheith:
PACman, my mistake :P.

Sorry... I'm doing too much thing at the same time hahaha
[Xperia Play Android Development] farenheith:
Finished.

Here is the framework.jar this is not a flashable zip. You need to replace the old one in the /system/framework, and set the permissions to 644 (rw-r--r--) and owner (root root) properly.

The commands to the permissions via adb is:

setperm 644 /system/framework/framework.jar

setown root.root /system/framework/framework.jar

I flashed the framework via adb and works too... I tested just with the touchpadactivator the detection and every options works fine.
[Xperia Play Android Development] yekasangredevago:
I remain a doubt this.

I can execute permissions from rootexplorer directly?? or I have to also through ADB command?
[Xperia Play Android Development] farenheith:
root explorer have option to set permissions and owner if you long press the file, but, es file explorer just have options to change the permissions. I had problems with the fix before when I just set the permissions.... maybe is something else, but now I always set permission and owner via adb.
[Xperia Play Android Development] game_guy:
Would it still work if I just included the framework.jar in the ROM's flashable zip?
[Xperia Play Android Development] farenheith:
Yeah, you can, forgot to say that :P.

It's the best option, I guess. Simple and functional
[Xperia Play Android Development] yekasangredevago:
true .. you're a genius. is the easiest way to include the framework .. thanks ..

just a question ..

No need to give permission or anything right?

just flash the zip with the rom with the framework included and ready??
[Xperia Play Android Development] game_guy:
Yup. The ROM updater script should set the permissions for you.
[Xperia Play Android Development] farenheith:
Yeah... the framework will have the right permissions with this method.

This is the recommended way on the OP for JB ROMs, anyway.
[Xperia Play Android Development] farenheith:
I can't download GTA 3, Galaxy on fire 2 and The king of fighters on the PACMan ROM. I think it's for the SDK Version. Probably this apps is not compatible with JB. Funny because GTA 3 is at least playable on JB, but full of lags. But, Galaxy on fire 2 and The king of fighters have gamepad recognition problems on ICS. Maybe this games is using some depreciated method to access the buttons that is abandoned on JB?

Edit: The problem was another... already reported on the ROm thread.
[Xperia Play Android Development] farenheith:
Anyone using touchpad fix V 1.1 tested games with the pointer ID start at 1?
[Xperia Play Android Development] farenheith:
I found a reasonable explanation for the key mapping issue on some games!! Unfortunatelly there's no good news.,.

On android, we have "two keymapping layers": The linux key codes, and the android key codes. The mapping between these two layers is did at the framework. Since android 4.0, the android have a standardization of the drivers, so, all the android drivers need to follow the linux standard. This can improve compability with a diversity of linux drivers, potentially doing drivers be compatible with both, android and desktop linux.

So, is looking like some games are mapping directly the linux key codes, that it's, is not using the android framework mapping, so, all the treatment to make changes on the drivers transparently is just been ignored, and then random problems with the gamepad can happens. This is a theory, I can't confirm it as the games I'm having issues with it are implementing the gamepad via native code.

We can see more info here.

So, unfortunately, if this is the real reason for gamepad issues in games like the King of fighters and Galaxy on Fire 2, I think there's no workaround to it. The only fix is the game devs fix the treatment. But as I can't confirm if it's the real reason, and if it is, their will do nothing, because their don't give support to custom ROMs, then... :/
[Xperia Play Android Development] jimmyvau:
The Gameloft game Wild Blood requires app side activation. The touchpads do not work if Always Activated is set.
[Xperia Play Android Development] farenheith:
Thanks for the info... are you on PACMan ROM, aren't you?

Edit: no... you are on MIUI Australia! thanks!
[Xperia Play Android Development] jimmyvau:
I retract my last statement. Touch pad always activated with pointer ID at 0 is what works. I'm using the latest Australian MIUI
[Xperia Play Android Development] farenheith:
mmmm....

This is a big problem to me.... are you really sure that pointer ID at 1 broke the touchpad on this game?

Edit: Look, the Stock ROM (GB) works with the pointerID starting at 1, so, is expected that every optmized game works well with it. Also, The next step to this fix I'm planning is make the touchpad always start at 1. So, is very important, I need to make sure that any game will not got trouble with it.
[Xperia Play Android Development] jimmyvau:
Just tried it again with pointer ID 1 and it worked. I double checked so I'm sure about this
[Xperia Play Android Development] farenheith:
Thanks.

The switcher to the pointer ID I'll maintain on the activator just in case for some time, but I'll put on the build.prop edit instructions the property "mod.touchpad.startfrom1=1" soon
[Xperia Play Android Development] bhavei:
The ics for locked bootloader has 180+ mb ram, by far the smoothest ics that works on play, based from Neo L. If I. Am to apply this fix. How much ram would the touchpad eat? Think about it...

Ics advance kernel + neo l ics rom + touchpad fix + new adreno driver?! Bonus customized app like xperia s home and xperia t + sony walkman.

That was my idea, but I couldn't start the project, someone should try that.
[Xperia Play Android Development] CosmicDan:
Free RAM does not correlate to a smoother Android experience. And if Neo L firmware is the fastest for you, you're the only one lol. Neo L users complain about the lag in stock all the time, MIUI Australia is faster for them.
[Xperia Play Android Development] jimmyvau:
I just tried out Dungeon Defenders Second Wave on MIUI with the touchpads activated and pointer id at 1. The game is playable and the touchpads work.
[Xperia Play Android Development] farenheith:
That's really good news! Dungeon Defenders Sedond Wave is one of the unsolved games!
[Xperia Play Android Development] wedhusman:
how to implant this on xperia neo l ICS rom? THANK
[Xperia Play Android Development] farenheith:
You can find the instructions to mod the framework at the post #2, but, if the framework is odexed (you'll find framework.odex at /system/framework if it is), then you need to deodex it first. You'll need to search some deoxdex method.

Also, I don't know if you're talking about the pure FTF from Neo, but if yes, then the touchpad driver will not be even present on this ROM, as Neo doesn't have touchpads, so, this fix is not enough to get touchpad working on it.
[Xperia Play Android Development] wedhusman:
Yes, the pure ftf file. Thank
[Xperia Play Android Development] farenheith:
Well, then I advice you to forget about it. This is not a Xperia Play ROM, is just a ROM of other phone with almost the same hardware of Xperia PLAY. On ICS or JB, unfortunately, you'll need a unlocked bootloader to get the touchpad working,
[Xperia Play Android Development] Arbiterandrea:
Thanks :) finally on AOKPLAY 4.0.4 i can play with touchpad

Inviato dal mio Xperia Play

Aokplay

Fxp 126
[Xperia Play Android Development] farenheith:
People,

I need someone to help me to test the OnLive app. I already have a report that the gamepad is not recognizing with the last fix and the touchpad yes, but I need more info!

I can't use this service in my country, so, if anyone can do this tests (on CM9)

First: Try the app without the fix;

Second: Try the app just with the build.prop changes;

Third: Try the app with the full fix, with pointer ID starting at 0;

Finally, try the app with the full fix, with pointer ID starting at 1.

I need to know the behavior about the gamepad and touchpad of the game in each situation.

Thanks for anyone that can do this tests for us!
[Xperia Play Android Development] f3w1n:
I dont have any kind of problems playing king of figthers in miuiaustralia, maybe i forgot some post in the thread, but in the pos 3 or 2 says that dont work well on ics.

A little request, do you think is posible to fix the mod to use the touchpads as a mous (y is inverted), i think we can use that to play some games :)

Ps: Sorry farenheit i cant help you with onlive, now im studying abroad and here onlive is blocked.
[Xperia Play Android Development] farenheith:
Thanks anyway.

Now I'm curious if you'll get troubles in CM9 to play king of fighters using the last fix... Probably will... I need to talk with CosmicDan to find the difference between MIUI australia en CM9 on the key map
[Xperia Play Android Development] CosmicDan:
Dunno man, I use the keymaps from Neo L firmware (strangely it has zeus gamepad maps and synaptics IDC already). I guess you could compare the /system/usr folders for CM9 and MIUI to see what's different. But maybe it is a lib or framework again... who knows LOL.
[Xperia Play Android Development] farenheith:
I'll then, but I think is something on the libs. The framework is from MIUI, so... don't know, Is more likely that something from Sony is the solution xD. But it's a good thing.

I will test Galaxy on fire 2 to see if the gamepad will be recognized
[Xperia Play Android Development] CosmicDan:
Yeah no problem. I'll be digging much further into the Sony framework soon, since I am planning to port MIUI5 (JB) for the Play too based on CJ's SlimBean ROM. The big obstacle there is that MIUI5 is only on the Nexus devices, so it's not using any Sony framework at all.
[Xperia Play Android Development] CosmicDan:
About the touchpad situation on Jellybean.

While editing the ROM source may be a solution, I am convinced that the synaptics_touchpad driver itself needs updating. This is all in the kernel. I have done some initial digging and found one thing of interest.

We can dump all configurable kernel symbols with following command:

cat /proc/kallsyms

..be wary though, it produces a 1MB+ text file.

Within there I searched for the keyword "touch" to find out what functions/values the kernel specifies/assigns (respectively) to the touch/input devices. With this in mind and comparing the touchscreen driver with touchpad driver, it's easy to see that the touchpad driver is extremely... odd. It doesn't use native linux input calls but instead uses it's own, these might be causing a choke in the bus events. With this in mind, I will continue digging. I'll start by enabling debugging on the synaptics driver and put in some echoing for values/responses/calls in there; and compare the various results I get with the same driver on ICS.
[Xperia Play Android Development] farenheith:
Probably yes, the driver need updates.

The problem is the difficult to it, I think. I downloaded the source from FXP to the SEMC msm7x30 kernels If you take a look at the folder...

/freexperia-semc-kernel-msm7x30-ics-322aefe/drivers/input/joystick

you'll find the synaptics_touchpad.c and synaptics_touchpad_firmware.h

At the beginning of the synaptics_touchpad.c, there some comments where you can see that this is a Sony code. Also, in the .h, you'll see a big byte array, complete filled.

This is probably the binary of the touchpad firmware.

If the changes we need to make in the synaptics_touchpad.c, then is possible with some hard work. If the problem is the firmware... well, I think then just Sony can help us
[Xperia Play Android Development] CosmicDan:
I think it is a combination of both now.

Comparing JB to ICS, Jellybean handles touchevents in the core framework (androidfw.so) whereas ICS handles it in the UI thread (libui.so). So I think it is a case of the touchpad saturating core framework, because it is not updated/optimize to share the new "core framework thread" instead of the ui thread. So we have two paths to take - update touchpad driver in the kernel to work on the new core framework InputTransport better without choking system, OR re-implement ICS InputTransport on Jellybean as an alternative mode only for the touchpad.

Both are probably going to be very difficult, LOL.

I am trying to find some official documentation on Android Developer site about updating touch drivers for jellybean support, but can't find anything. I assume it's because the synaptics driver does a lot of custom/undocumented stuff so it usually wouldn't be needed, or because Android only releases such information to OEM's.

I think I'll take a crack at merging in the ICS InputTransport to jellybean source, at least I'll see how I go.

FYI,

Location on Jellybean JB:

frameworks\base\include\androidfw\InputTransport.h (and Input.h)

frameworks\base\libsandroidfw\InputTransport.cpp (and Input.cpp)

Location on ICS:

frameworks\base\include\ui\InputTransport.h (and Input.h)

frameworks\base\libs\ui\InputTransport.cpp (and Input.cpp)

Lot's of differences. InputTransport.cpp in particular seems to be much simplified on ICS compared to JB.
[Xperia Play Android Development] farenheith:
The best path is the rightest one :P.

Optimize the driver is the way. If only edit the available source is enough, then well. The problem is if we need to change too the firmware... This can be a dead end :/

make the ics Inputtransport be implemented just for the touchpad can means a lot, but a lot of structural changes, idk... I'm totally lost in this level LOL
[Xperia Play Android Development] CosmicDan:
Honestly, I have no idea what needs to be updated or changed in the driver. I really have no idea what is wrong with it!

But the code you mentioned before:

// Latency added during resampling. A few milliseconds doesn't hurt much but
// reduces the impact of mispredicted touch positions.
static const nsecs_t RESAMPLE_LATENCY = 5 * NANOS_PER_MS;

// Minimum time difference between consecutive samples before attempting to resample.
static const nsecs_t RESAMPLE_MIN_DELTA = 2 * NANOS_PER_MS;

// Maximum time to predict forward from the last known state, to avoid predicting too
// far into the future. This time is further bounded by 50% of the last time delta.
static const nsecs_t RESAMPLE_MAX_PREDICTION = 8 * NANOS_PER_MS;

This is only in 4.1.1 - 4.1.2 has very different InputTransport code again. So maybe it will be easier to forward-port 4.1.1 Input(Transport) code to 4.1.2, and that might help. I'll be trying that first.
[Xperia Play Android Development] farenheith:
The idea is just change the coeficient, that is, the number in bold: 2 * NANOS_PER_MS;

The NANOS_PER_MS can be maitained as as measure unit, and if we can load this coefs from a file, we can try to calibrate it... but it's just a shot, the only premise I have to think this can influence the touchpad is that, in ICS, we don't have touch input prediction
[Xperia Play Android Development] clivejefferies:
Is it possible to do a fix for this awesome jb rom?

http://xdaforums.com/showthread.php?t=1975851
[Xperia Play Android Development] farenheith:
I saw that cj360 is compiling from source.

I have instructions to make the fix directly from the java source now, and Wedgess already did it for his ROM. This is better, because it avoid the need to edit the framework.jar and potentially allows that the fix goes to the original source (CM9/CM10, if someone, after test this java source fix, commit it). When this happens, the fix will become obsolete and that what I want, so I strongly recommend that cj360 follow the instructions to the java source fix.
[Xperia Play Android Development] CosmicDan:
As soon as I get JB AOSP working I'll be using my own source builds too.

But I don't think CM9/CM10 inclusion would ever happen TBH, because it is device-independent and as you probably know J still hasn't merged pax's CDMA fix which was done some months ago and is not device-independent. Basically, fixes specific for most Xperia 2011 devices are not really bothered with by FreeXperia :(

wedgess has forked device trees from Cyanogenmod to his repo, so maybe he could also fork where these source changes go (if he hasn't done that already?) then we could all update our repo manifests to use his instead.
[Xperia Play Android Development] farenheith:
I see...

But I'm identifying the device to not cause problems with other ones in the java version of the fix. I was hoping that, for this detail, we could merge this changes :/
[Xperia Play Android Development] CosmicDan:
Yeah I know.... but still, pax's zeusc update was never merged either =\ FreeXperia just seem to be a bit picky about what they merge in I guess.

EDIT: Maybe J/FreeXperia just don't have time, and it should be up to us to issue a pull request. Then J will take a look.

But more and more people are using alternate ROM's, so no big deal on CM9/CM10 I guess.... I will talk to cj360 and maybe organize a common jellybean git we can use for our builds 0 including your touchpad fix and (hopefully) my lag fix when I figure it out.

EDIT2: Take a look at this! https://github.com/android/platform...a34bce1337#include/androidfw/InputTransport.h

Those (and some later commits I already found) are the official changes that AOSP made to jellybean since ICS for the InputManager. I have a feeling it won't be too difficult to build Jellybean with ICS InputTransport after all :D Come ooooon repo sync.... lol.
[Xperia Play Android Development] abrahamt24:
v1.1 is causing bootloop on CM9 FXP147

or it's just me having this problem.?
[Xperia Play Android Development] farenheith:
mmmm...

Maybe they changed the framework.

In this case the fix must be updated

Edit: Dude, send me the framework.jar of the ROM, so I don't need to download it right now. (the original one)
[Xperia Play Android Development] abrahamt24:
here ya go
[Xperia Play Android Development] farenheith:
Dude, please, test it to me. Tell me if it will work. If you can, please, use adb to generate a logcat while the phone is booting, if you get a bootloop

here you download the fix

Edit: to generate a logcat, this is the command: adb shell logcat > logcat.txt

This command will generate a file called logcat.txt in the current folder. The best is that you execute the prompt as an adminstrator (if you're on windows) so you can avoid permission problems. Executing this, the prompt will stay without anwer. To finish the logcat dump, just press Ctrl+C
[Xperia Play Android Development] simonrussell77:
Just tried this fix myself as i've switched to cm9 from stock recently and it's working well. I just flashed the new cm9 official nightly (dated 18 11 2012) and it's perfect. No bootloops, just a rebuild of the dalvik cache after flashing your fix ;)

Thanks for your hard work. Now my play is working well.
[Xperia Play Android Development] abrahamt24:
i got a massive lag and it makes my phone reboot every time i touch the touchpad.

i'm downloading Android SDK now, it's 400mb and it takes 2 hours to download :eek:

i'll give you the logcat once i've finished the download ;)
[Xperia Play Android Development] CosmicDan:
What ROM? And logcat the reboot for us.
[Xperia Play Android Development] farenheith:
I think you don't need the whole SDK, just adb. You can use this

Don't forget to set usb debug ON, in the developer options.

@CosmicDan, he's using cm9 FXP147 and I needed to remake the fix because he was getting bootloops with the last one, probably Cyanogen made some serious changes on the framework. But Is very weird he's having lags with the touchpads, because simonrussell77 said that was working fine :/
[Xperia Play Android Development] abrahamt24:
hope this helps :D
[Xperia Play Android Development] farenheith:
I think so :)

Try this new one please and tell me if worked: here
[Xperia Play Android Development] abrahamt24:
it's working perfectly now. thanks!
[Xperia Play Android Development] farenheith:
thank you for the feedback!
[Xperia Play Android Development] ThePlasticBling:
Do we HAVE to flash the touchpad activator app? I would honestly rather flash just a zip, and not have an extra app. Thanks.
[Xperia Play Android Development] farenheith:
Some games need the activator to recognize the touchpad, it's a fact, but no one is forcing you to install nothing