yashsingh1/xdaforums huggingface dataset:
[Xperia Play Android Development] farenheith:
I bought this app some time ago... I can decompile it and take a look. If their are using hte same method the FPSe did to access the touchpad, then it's possible...

Well, I didn't know that this app only work in ICS :/. In this case, probably their are using the same method, I'll take a look

Edit: Dude, I don't think so... this app doesn't looks like it's using the same method of the FPSe... probably their are using NDK. In this case, it must work on Gb, but it's seems that the problem is the SDK version.

I mean, here the problem is other one: probably their are using some new android feature, (nothing specific to Xperia play) that is not present on GB, so their release the app just to newer SDK versions. In this case, there's nothing we can do :/. The only way is the developers of the app rewrite the entire app to use just GB features
[Xperia Play Android Development] chery2k:
Sorry it took so long to reply back heres a update of King of fighers on marks ics rom. It turns out I got the same results as I did in Cm9. Dan is correct some games are incompatible on ics. But damn the game was running smooth on ics at least on par in gb. Damn you sony lol.
[Xperia Play Android Development] farenheith:
Yeah, it's make harder to solve the problem... but again... what happens when you presss the back button? XD
[Xperia Play Android Development] chery2k:
Nothing happens during gameplay.
[Xperia Play Android Development] farenheith:
Thanks :P

It's really strange why the buttons is not properly mapped then... If the circle button and back button have different treatment, then the game is recognizing the device, so... why the heck the buttons is not recognizing?

I mean... there differences between GB and ICS, but we have differences on the Key mapping? I tested the Galaxy on fire on the Mark ROMs, too, and the gamepad still have problems... god, why? I really want to know that. buttons are the simplest interface ever and I can't accept well why we're having troubles with that.

There some difference on the key codes on ICS?

There some feature on Sony GB to make a different way to treat the gamepads?

Those games are doing some check, like, if SDK is greater than 13, than don't treat the buttons like an Xperia Play?

I can understand the difficult on treat the touchpads, a different and specific input device, but the buttons... doesn't make sense at all...
[Xperia Play Android Development] CosmicDan:
Maybe it's something like, the games are trying to access the hardware directly rather than going through a HAL/driver abstraction. Reminiscent of MS-DOS videogames back in the day.

EDIT: Try updating the kcm file. /system/usr/keychars/keypad-zeus.kcm is wrong, it needs to be changed. I reported this in CM9 thread ages ago but it still hasn't been fixed. See my post here.

EDIT2: Actually, I think keypad-game-zeus.kcm should also be updated. In my MIUI kitchen, I've just changed both files to this:

type SPECIAL_FUNCTION

key BUTTON_SELECT {
base: none
alt: none
}

key BUTTON_START {
base: none
}

key DPAD_CENTER {
base: none
}

key BACK {
base: none
alt: none
}

key BUTTON_X {
base: none
}

key BUTTON_Y {
base: none
}

Please try this and tell me if it fixes or breaks any games.
[Xperia Play Android Development] farenheith:
Wow, this is something that really can explain the problem.

I'll do it right now, thanks for the tip!
[Xperia Play Android Development] farenheith:
Well... the map problem is not solved on the Galaxy on fire 2 :/. The king of fighters I didn't bought so I can't test... do you have /system/usr/keychars folders from the stock GB?

Actually, the /system/usr

I'll get one and compare some files to see if I find some difference
[Xperia Play Android Development] CosmicDan:
Stock GB uses kcm.bin files which are no longer used in Honeycomb and newer. But yeah, maybe the game is hard-coded to look at them. Or, the game is trying to find some method that is only on GB (to read the kcm.bin files)?

Here is the full usr folder from stock GB zipped up. I've noticed that the kcm.bin files are 0KB on ICS, but on GB they are ~1KB of binary data (they are like the above .kcm file I posted, only "compiled"). http://www.mediafire.com/?m2esabmgc1q8j1k
[Xperia Play Android Development] farenheith:
Thanks... I tried but didn't work.

I also look for zeus and keypad in the game files and I didn't found nothing...

Do you know what is the icu\icudt44l.dat?

This file have a different size of the current one... is it something about the input?
[Xperia Play Android Development] CosmicDan:
Ive wanted to know the same thing for a long time lol. Its pretty big. Delete it and see what happens :D

Sent from Xperia Play (R800a) with Tapatalk
[Xperia Play Android Development] farenheith:
FC :P

the file is named different... the gb one is icudt44l.dat, the ics one is icudt46l.dat. I tried to let the gb file with the original name, didn't work. Tried put the new name, FC

The permissions is the same of before, so... the old one is incompatible with ICS.

Here the error

I/AudioHardwareMSM7X30( (132): : ******* name[13] = [tty_headset_mono_rx] *********
I/AudioHardwareMSM7X30( (132): : ******* name[14] = [tty_headset_mono_tx] *********
E/ICU ( (130): : Couldn't initialize ICU (u_init): U_FILE_ACCESS_ERROR (/system/usr/icu/icudt46l.dat)
E/libcore ( (130): : Failed to initialize the core libraries; aborting...
I/AudioHardwareMSM7X30( (132): : ******* name[15] = [speaker_mono_rx] *********

I did a binary search on the file... I found in unicode the name of a lot of countries and one occurrence for the word KeyMap.

Also, I found this page

Well... Looks like this file doesn't have anything to do with the gamepad after all :P

I had enough of this for now... I sent a mail to the developers of the The King of fighters android explaining what we are doing here, asking how their are accessing the gamepads and saying the game is working smotth on ICS, if their are blocking the good behavior of the game in some way, there's no need to it. I hope their answer me :P.

Sometime ago I was unable to buy the lara croft game, and I change the fingerprint on the build.prop to the stock gb one, and then I could buy. After that, I sent a mail to square enix reporting what I did and saying the game was running well on ICS, their answered me and, a few days later I could download the game again (after change the ROM) without change anything on the build.prop, so... I hope something like that happens with those new guys too
[Xperia Play Android Development] CosmicDan:
Wow, that's quite impressive that they changed it so quickly. Mostly us hackers are ignored :P Good on them though, makes sense - one tiny change = more people would buy it :P
[Xperia Play Android Development] bamsbamx:
Yo guys! Maybe we are Lucky!

Do you remember that I emailed Sony about touchpads?? http://xdaforums.com/showpost.php?p=32408313&postcount=240

So, they finally answered me so, they are showing some interest on us!!! :)
[Xperia Play Android Development] f3w1n:
Thats really nice.

Btw, why that flood of calls of the touchpads affect only on jb?

- f3w1n -
[Xperia Play Android Development] farenheith:
That's what I want to know... I really don't know how the touchpad is internally accessed by the system, but I think is something like that (I THINK):

1) Touchpad drivers

|

|

2) Input device manager (some guy that works directly with the driver and send messages to the system

|

|

3) Framework event listener (The guys that receives the system messages and forward it to the right treatment)

|

|

4) Input device listener (The beginning of the input device treatment (here can be key, touchscreen, touchpad, external gamepad etc...)

|

|

5) Input device delivery (Here the input device is forwarded to the specific treatment based on the type of the input)

|

|

6) Event dispatcher (Finally, here the specific input device event is dispatched and the current app treat it)

If this is really the general structure, them the problem with the touchpads, I think, is in the step 2 or 3. I'm pretty sure the driver is the same of ICS, but maybe the input treatment on the JB is worst than the ICS, maybe they put some synchronization of concurrent threads, what can cause a code safer but slower, and we can feel that just in the touchpads.

I mean... maybe the driver of the touchpad is configured to send most events as possible, so, putting a exclusion threshold there can solve the problem. But, also, is true that the density of the touchpad is greater than the screen. I mean, this device have almost the same resolution of the screen, but is 4 times lesser. So, in theory, if you move your finger 1 cm on the screen and 100 events is dispatched, then, if you move your finger 1 cm on the touchpad, 400 events will be dispatched.
[Xperia Play Android Development] f3w1n:
Whats the point of that?

- f3w1n -
[Xperia Play Android Development] farenheith:
The point is: the screen and the touchpad have almost the same type of input. Why the screen doesn't lag too? Maybe, is because the screen generate less events than the touchpad, and the number of treatments made is less.

But... I just remember something.... I'm not really sure... but I think I read in somewhere that the touchscreen input was optimized on JB... so... If my memory is not picking me a trick... then maybe the screen had so problem like that and someone solved it...
[Xperia Play Android Development] f3w1n:
So, if we input in the touchscren that 4cm (or whatever) of touching in the same time that we do 1cm in the touchpad the games should be laggy?

Ps: sorry for make lots of qustions but im really interested in how that works.

- f3w1n -
[Xperia Play Android Development] farenheith:
No... I got your point, but the input have the distance swyped, the velocity of the swype and the capture capacity of the device per second...

Well, maybe your right :P. But as the FPSe developer said that the touchpad was generating a flood of events, I just was thinking on a possible explanation
[Xperia Play Android Development] farenheith:
Guys!

I need to ask you something: anyone bought 9mm or Nova 2?

Since some updates ago we need a new test on this games, to know if their're working now.
[Xperia Play Android Development] MilkyJoePD:
Touchpad fix: "if touchpad.listen.event = touch.the.screen then touch.that.bit
[Xperia Play Android Development] farenheith:
?

Sorry, I did not understand what you're saying... xD
[Xperia Play Android Development] CosmicDan:
Lol... I think he was being silly :P
[Xperia Play Android Development] Lordomn:
I flashed the aokp zip without changing build prop...because most games that I have already have working gamepad/touchpad.

Now what I did notice is that with zip mc3 force closes but without zip I could play but didn't recognize touchpad.

Amazing spiderman played without touchpad only gamepad but after I flashed zip it fc once only 1st time I entered game then touchpad worked fine.

Now here is where i get lost myself. Asphalt 7 didn't even allow me to use touchpad/gamepad before zip only touchscreen & accelerometer. After zip I was able to use all but left touchpad. I couldn't use the buttons in a7 menu only during race.

I just figured I'd give some feedback about the few games I have had an issue with & which games I can now play.
[Xperia Play Android Development] farenheith:
Did you use the aokp ICS or JB?

If you used the JB one, please, send me a logcat for the MC3. About Asphalt 7, it's normal to any games allow just screen input during the menu. But,in this game, you just could use the right touchpad and the buttons, I understood right?
[Xperia Play Android Development] chery2k:
If your using ics aokp it is based on fxp sources. You need to edit your buildprop for the game to recognize your using a xperia play. Build prop also allows the touchpad and gamepad for certain games that check the build prop If you dont want to edit your build prop i suggest you change rom to fxp and flash the touchpad fix posted on this thread to see what happens. Otherwise your going nowhere.
[Xperia Play Android Development] MilkyJoePD:
I can explain: alcohol.
[Xperia Play Android Development] farenheith:
Hahahahhahaha... this make sense to me! xD
[Xperia Play Android Development] Lordomn:
I used the aokp ics fix. But if I change build prop mc3 just force closes every time I try to go in. No change to other games. Believe me I've gotten frustrated over it. Not sure how I can help it tho. As for a7 yes only left touchpad doesn't work after fix. Before I got no response from gamepad or touchpad.
[Xperia Play Android Development] chery2k:
Did you try cm9 or mark ics unofficial rom and tried playing your games? At the end you still need your build prop. I uploaded my build prop does your look the same? Its in this thread. And flashed the coresponding fixes soon afterwards? Some games are incompatible with jb and ics.
[Xperia Play Android Development] thi3um:
Running cm9 fxp 141 roman and kernel

9mm ok, a bit laggy but fully playable

Mc3 FC

Dead trigger and nova3 fast and smooth as on gb stock, it's magic

Max payne ok but left touchpad act as right touchpad, i mean view not move.

Nice job man it's really amazing to see the progress you've done.

Thank's
[Xperia Play Android Development] farenheith:
Thanks.

In Max Payne I experienced this same touchpad behavior, but I do believe it's of the game,because the fix doesn't change the event information.

About the lag on 9mm, try to flash the new adreno drivers, maybe you'll get a better performance.

Finally, send me a logcat so I can take a look on the reason

Edit: on the reason of the FC on MC3 :P
[Xperia Play Android Development] f3w1n:
Yeah in max payne the touchpads (both) work to move the view camera, thats the same in gb

- f3w1n -
[Xperia Play Android Development] Lordomn:
Try redownloading data for mc3...it might work. I had same issue with mc3. Cleared data the downloaded again now it's working.

R800x-unlocked/ Aokp-m6/ 4.0.4
[Xperia Play Android Development] farenheith:
I heard that Jellybean have a improvement on the touchscreen latency, to make the device more responsive.

As it's a AOSP feature, I think the changes is in the framework. I wonder if it's possible to do the same to generic devices,

like the touchpads and external gamepads... and I wonder where we can ask this xD
[Xperia Play Android Development] CosmicDan:
BTW, touchpads work in Cyberlords Arcology :)
[Xperia Play Android Development] solomon4400:
@farenheith

is it possible to update AOKP-ICS Version 0.4 to version 0.6? or 1.0? fpse is not reading touchpads but other games/emus work. thanks in advance.
[Xperia Play Android Development] farenheith:
Yeah, it is. The problem is I need to flash the AOKP-ICS to test it, but I can't do it right now...
[Xperia Play Android Development] solomon4400:
I'm gonna be on AOKP-ICS for a while now so I can test when ever you ready bro
[Xperia Play Android Development] farenheith:
Okay then... can you send me just the framework.jar?
[Xperia Play Android Development] CosmicDan:
Cool sig image! :D
[Xperia Play Android Development] farenheith:
There it is, solomon!

Give me some feedback if it's working so I can put on OP. Don't forget the build.prop edition and the touchpadactivator :)
[Xperia Play Android Development] solomon4400:
well the zip for aokp-ics broke my data so what i did was just flash a touchpad fix by wedgess(always kept that in my closet) with respect to build.prop. but i will try with his build.prop, if dont work then i will replace it with my already edited build.prop and test again. thanks again farenheith

ya man got it from another user but the sig doesnt even begin to describe how amazing your port is!;)
[Xperia Play Android Development] farenheith:
I know this zip. The problem with zips that replace the build.prop is that you overwrite the build.prop XD

This zip I get from wedgess was based on a older version of the AOSKPICS one, and some property related with the data was different, so... when I was using AOKP-ICS, a long time ago, after I flash the zip, when I do a factory reset, I lost my data :/. I also tried to use setprop and sed via CWM flashabe zip to try to modify, not replace, the build.prop, but I couldn,t, That's why I don't create flashable zips to the build.prop, just give the instructions to modify it
[Xperia Play Android Development] solomon4400:
well great news my friend it works! however i didnt edited the build.prop as i was already wedgess build.prop which i flashed after i did edited the build.prop as you guided after my first boot on aokp-ics which i dont think broke my data because i edited the build.prop before i flashed the rom. data didnt break untill i flash aokp-ics ver.0.4. then i flashed wedgess fix and got data back and touchpads worked except for fpse. this was yesterday. so this morning i downloaded your updated framework.jar you posted for me and replaced aokp original framework.jar with yours, rebooted, activated the touchpads as "always on" and still touchpads did not work. so i deactivated the touchpads "always on", opened up fpse and bang it worked. so from my tests i think that for aokp-ics you need wedgess touchpad fix and the updated framework.jar and that's it.

thanks a lot bro here's wedgess zip

edit: ooops sorry didnt see your request for my original framework.jar a page back untill now. sorry if i put you through a little extra work. lol
[Xperia Play Android Development] farenheith:
mmm.. but the framework.jar don't have nothing to do with the data... unless... this zip contains a build.prop inside

Eidt: cj360 have R800x, so I thought maybe they put an build.prop inside the zip, but no. I really don't know what broke your data, but I know is not the framework.jar :P, it can be something on the build.prop you had before the wedgess one. Also... this build.prop of the wedgess will have problems with some games, because of these properties:

device must be R800i_0000-0000 (you can change the zeroes for the a number behind the battery, if you want to be the correctest :P) and ro.build.product must be R800i. Some games does not look to the ro.product.model, but to these properties. Also, the correct ro.product.brand is SEMC, but I don't know if some game look to t, so...
[Xperia Play Android Development] jimmyvau:
I can verify that the framwork.jar posted above works in the latest AOKP on an R800x. I edited my build.prop per the instructions, replaced framework.jar, fixed permissions on reboot and everything is working great. I could be imagining things but games seem to run a little faster on AOKP than they did on CM9.1.
[Xperia Play Android Development] farenheith:
It's a possibility.

The AOKP RO have their own tweaks, maybe some of those can improve the game experience
[Xperia Play Android Development] solomon4400:
on aokp ics the games run more smooth than any other ics rom i've tried. it's it's like magic bro real smooth. on a fresh install i really really wanted to test your fix so as soon as it was set i installed dead trigger, fpse, nova3, virtual tennis, n64oid just to test and not to mention i forgot to overclock so frequencies were only at 134mhz min and 1024mhz max. these games ran buttery smooth with not one lag. on top of that fresh install i had 235mb free ram.
[Xperia Play Android Development] farenheith:
Well,

I made the flashable zip to AOKP ICS and put it in the op. thanks Solomon to test it!
[Xperia Play Android Development] solomon4400:
Dont thank me thank yourself for the break through you, cosmicdan, xdarkmario, and markpython you guys brought our play to life! Me...... Im just an innocent user lol
[Xperia Play Android Development] bamsbamx:
Well, finally SONY is helping us with touchpad!!!!!!!!! They have replied me to the email is sent them..i dont know if this can help us, as i have noidea about touchpad..... this is what the replied me:
[Xperia Play Android Development] farenheith:
Wow, yeah it helps.

Some part of this we already figure out, and looks like the dev know that. Probably they took a look on the thread. But the more important is the tips about the touchpad on JB... I'll study this tips right now to see if I can do something about it. Thank you, thanks Sony and thanks Tobias!

And it's true, the touchpad doesn't works well with JB (Now I know it for the new pipeline) even when we don't activate the touchpad return calling setProcessPositionEvent or by the always activated hack... I think I need the java source of the framework.jar because probably look into this will be very more difficult than before. It's open source too, isn't it? Anyone knows where I can get it?

Edit: Also... something doesn't fits.... The FPSe developer said on his forum that the touchpad on ICS was generating a "flood of events" and the FPS fall a bit for that. Well, it's fit with what the Sony Devs said (touchpad have issues since SDK 12) but on ICS I really didn't feel the same lag that happens on JB when I use the touchpad... so... something changed between ICS and JB. If I could make the touchpads works on JB with the same performance of ICS then I'll be already happy :P

Edit2: Nevermind, I already found where to download the source :P. Here

Edit3: :/.... The onGenericMotionListener is an interface, made by the end programmer use it... it's not looks like something of inside use. Also... the instance of this interface is used in the dispatchGenericMotionInternal, and the fix change the code before this event be called and, If the touchpad is activated, then this interface is never used.

The lag on SDK 16 (JB) is happening before that...
[Xperia Play Android Development] farenheith:
Anyone here on some JB ROM right now?

Edit: Guys, I found where the event "enter" on the framework code.

// Called from native code.
@SuppressWarnings("unused")
private void dispatchInputEvent(int seq, InputEvent event) {
mSeqMap.put(event.getSequenceNumber(), seq);
onInputEvent(event);
}

This method is from the InputEventReceiver class... as the comment is saying, this method is called via native code, and is the first method where the touchpadevent (and any input event) is processed on the framework.jar.

I did this change on the method (actually on the smali, but is equivalent to this):

// Called from native code.
@SuppressWarnings("unused")
private void dispatchInputEvent(int seq, InputEvent event) {
mSeqMap.put(event.getSequenceNumber(), seq);
if (event.getSource() == InputDevice.SOURCE_TOUCHPAD)
finishInputEvent(event, false);
else
onInputEvent(event);
}

This change just cancel all touchpad events as soon it begins to be processed by the framework. So, in theory, the lag must go away, right?

No... Even with this change when I touch the touchpad, it cause lags (tested with FPSe). . So, the JB lag problem is not on the framework.jar!

The method dispatchInputEvent is called from a C++ routine that we can found inside the framework source code here:

core/jni/android_view_InputEventReceiver.cpp

THIS FILE DOES NOT EXIST ON THE ICS FRAMEWORK SOURCE CODE. So... the new input events handler structure is not favorable to the touchpads. Why some games doesn't have lag problems? Probably because the touchpad treatment is done via NDK, and those routines is not used (PROBABLY).

At least now I know that the lag problem is not directly on the framework (what is worst to me... if it is on the framework, at leaast I could try to fix it, now I have too much to study if I want to try something).
[Xperia Play Android Development] jimmyvau:
I just noticed on the front page that there isn't a definitive answer as to whether MC3 works or not. I just installed it and played through the first level without a single problem. CM9.1 FXP 142 with V1.0 of the fix and touchpad activator 1.1.

EDIT: Oh yeah, I just wanted to mention that in my build.prop I am able to use R800x in place of R800i without any loss of functionality.
[Xperia Play Android Development] farenheith:
Thanks! I was waiting for a confirmation :)
[Xperia Play Android Development] RoboticBuddy:
Can someone please mirror the CM9 zip and the Touchpad activator to a Dropbox link? Mediafire is blocked on my ISP.

R800i. 'Nuff said.
[Xperia Play Android Development] farenheith:
I put the CM9 zip attached on the first post.