[Q] Capture a programs interactions with the system? - Captivate Q&A, Help & Troubleshooting

If this has been discussed and I have overlooked it in my searches please if you know point me in the right direction. here is an example of what I am trying to do: The sensorcalibutil_yamaha, I want to find out how it is working so I can write a very simple app kind of like the one in the Froyo ROMs but where I can input inverted values for certain axis without "calibrating" them all thus messing up other axis I want to stay the same. Then save those values like this utility does only with my input tweaked values. I have tried logcat but it does not do what I need. is there something I can do in ADB?

dono, there is a file in *deep breath*
/sys/devices/virtual/accelerometer/accelerometer/
called acc_file which is rw-r--wrx (kinda weird). It looks like it contains the current accelerometer info (if you rotate the phone it changes) but I don't have a clue where the information is being read from or what function is putting it in there.
What 'cha trying to do?
Sherpa

Invert only one axis by inputting calibration values manually so as to correct the rotation issue. In the froyo roms there is a gui to do what sensorcalibutil_yamaha does bit it reads the current sensor values and issues an "offsetUpdate" with the current values as assumed Level. But on us variants you are holding the device semi verrical part landscape to get it to sort of stay rotated vertical but doing this also updates the other axes as "level" so rotation is flaky at best with no love in games at all. So if this app reads current values and issues an update we should easly be able to write a simple app that we put our own values into and issue an update. Thus allowing us to invert only a singlw axis and make rotation work perfect.
Sent from my SAMSUNG-SGH-I897 using XDA App

We've tried swapping every file with yamaha or sensor in it to a froyo build with no luck. It looks like the garray and marray values are somewhere deep inside the kernel rather than a handy library file. If your handy with a hex editor or a soldering iron you would be a hero
Sherpa

I saw an episode on revision 3 of a show called APP JUDGEMENT where the host was doing something like that to get a reading of how much his motercycle leaned in corners not sure which episode it was but its at least 4 weeks ago
Good luck hope you succeed

TMC_Sherpa said:
We've tried swapping every file with yamaha or sensor in it to a froyo build with no luck. It looks like the garray and marray values are somewhere deep inside the kernel rather than a handy library file. If your handy with a hex editor or a soldering iron you would be a hero
Sherpa
Click to expand...
Click to collapse
I am quite good with a hex editor and an expert with a soldering iron. anyways no one really cares lol so to clarify (sorry was on my device in a vehicle so I did not feel like typing a lot) No it is not stored in a file anywhere on the system (in temp memory while it reads the values before it updates) the values in this chip are stored outside the system (often in the chips software(actual firmware of the hardware) this would explain why when erasing the system and flashing back to stock leaves your rotation messed up even with a kernel reflash. it is in the kernel where the driver interprets these values (that is why in 2.1 it can be patched like in the reorient kernel) obviously the I9000 default settings are 90deg different on one axis then ours. SO my point remains, the recalibration utility works as described above, it calls commands I believe from perhaps one of the yamaha libs, libms3c_yamaha.so? it seems to do it in this order with a couple of other steps involved: it measures the sensor readings then gets the "offset" (I think this is it calculating the offset based on the current values being assumed level) then it saves those values (temp) then it issues the update. As I said before instead of updated ALL of the values as the new "level" we want to update with manually input values to work with single axes. anyone follow? I am going to give it a go tonight and at this time wish myself luck!
btw: I tried to patch the kernel with a hex editor but could never get it to repack correctly and was mostly bootless. next step is to **** my device for good with some micro-soldering (probably not plausible from the way it looks though)

It was a joke. Sir, step away from the iron.
There is an orientation lock so there is some control over the accelerometer however I'm not sure if you can lock only one axis. If it's a .so you are looking for then it ain't stripped so there should be readable text inside.
I would need to reboot to look further but the only real function in yamaha.c is yamaha_read which does what it says on the tin.
ak8973b.c does a bunch of stuff but I'm not sure why it's even in there as I doubt there are two accelerometers http://www.asahi-kasei.co.jp/akm/en/product/ak8973nbs/ak8973nbs.html but it's included with the build.
Grr, I bookmarked the photobucket but not the link
http://s379.photobucket.com/albums/oo239/vendetta-mr2/Captivate/
*Sigh* because I'm stupid
http://s379.photobucket.com/albums/oo239/vendetta-mr2/Captivate/
If it's a yamaha sensor I don't see it anywhere but then again I don't know which one it is (Thanks Samsung) so I'm not sure what part number to look for.
I think there was a point to all this but I don't remember what it was so quick ask another question, post another comment or just say something witty, I'm sure I'll remember it sooner or later.

hey what ever works for me! besides I can always fall back on the nexus. it's easier than it sounds I'll post what I find out tonight.

BLEH! "permission denied" happen to know if the gui in the froyo build is an apk?

TouchWiz is proprietary Samsung. Eugene373 has managed to remove/work around parts of it in his Frankin-Twiz but I have not messed around with that ROM so I don't know what bits are still in there.

Well that was a big ****ing fail! oh well. Gotta go back to work tomorrow so I guess that's it for me for now. I would say maybe next time but Froyo will be released by then I hope..... I guess I will spend the rest of the evening making sure I have a modem that works in froyo jpk

Ok, I gave it one last go and I got it to do portrait correctly BUT now landscape is upside down....... but it rotates nicely.....

TMC_Sherpa said:
There is an orientation lock so there is some control over the accelerometer however I'm not sure if you can lock only one axis. If it's a .so you are looking for then it ain't stripped so there should be readable text inside.
Click to expand...
Click to collapse
I rather doubt that orientation lock has anything to do with how the accelerometer values are interpreted. It probably just forces the UI to disregard changes in orientation.
Sent from my SAMSUNG-SGH-I897 using XDA App

Related

Autorotate screen via camera project...

so I downloaded the latest diamond album to my kaiser to try it out and I like it but I can't rotate the picture the same way I could with the htcalbum... So I looked at the help file and saw that to rotate the picture all I had to do was turn the phone.. WOAH.. but didn't work... obv. I've been doing some research and it seems possible that we could trigger the screen rotation by turning the phone. It uses the camera to figure out your position.. Now I'm not nearly good enough at this stuff to figure it out on my own, but I did find a little game that is supposed to move the snake based on the movement of the camera, this might be a good place to start, but I couldn't even get the game working.. it's called "CC snake" (attached below) Looking for some ideas, maybe ripping out the controls from the game is a place to start?
http://www.clutch-productions.com/ccsnake.cab
I can confirm that this program runs on my old SDA (wm5 smartphone)... still get an error when trying it on my tilt
Dunno if this is relevant or not but a short while ago, i saw a website where someone had used the camera on a Nokia mobile (i think the phone was a 6600) to create a wireless optical mouse. You had the screen in the palm of your hand and the two hardware buttons were left click and right click. I believe the data was sent over bluetooth. It probably uses a similar technique to work out the direction of travel as you would use to work out orientation.
I haven't been able to find the original website but i did find this
www.comp.lancs.ac.uk/~sheridaj/publications/2005/PERMIDPointingDevices.pdf
which seems to be a paper about using a mobile phone camera as a pointing device. I haven't read it through as i'm at work but it could be useful?
I seem to remember the original site having code samples. If i find it, ill post the link.
(Tried to upload the pdf but the file is too big, sorry )
Edit: I believe i found some more info
here are some more links:
http://www.pyrofersprojects.com/blog/?page_id=41 - This guy reckons he's done it but he's not giving out the code
http://www.youtube.com/watch?v=yT1h_ITR0G0 - The video i found, the related videos section looks like it might have some answers.
Please stop me if this isn't helpful!!
video looks bullocks...
slovoflud said:
video looks bullocks...
Click to expand...
Click to collapse
yeah, it would have been more convincing if he showed the phone actually moving the cursor although the comments link to slashdot (I didn't read the article tho)
this seems to be interesting, too
http://www.gesturetekmobile.com/
http://youtube.com/watch?v=v0srY37kkMw
you can control via motion - that's unquestionable. The problem with the 'mouse' concept is that the cam is right up against the table, so there's no light and hence no contrast, so, you can't lock.
if it is true though - i's cool, but in my mind, pointless. why not use a Mouse instead?
slovoflud said:
http://youtube.com/watch?v=v0srY37kkMw
you can control via motion - that's unquestionable. The problem with the 'mouse' concept is that the cam is right up against the table, so there's no light and hence no contrast, so, you can't lock.
if it is true though - i's cool, but in my mind, pointless. why not use a Mouse instead?
Click to expand...
Click to collapse
according to the guy's site, its for replacing a travel mouse or if you need a spare! pretty cool imo but i agree about the light source. Theres something not right about that video, did you check the others?
Shub-Niggurath said:
according to the guy's site, its for replacing a travel mouse or if you need a spare! pretty cool imo but i agree about the light source. Theres something not right about that video, did you check the others?
Click to expand...
Click to collapse
ok, here's what he says.
"Things didnt go entirely smoothly of course. The first thing everybody is probably saying is, but the camera only shows black when its flat on the mousepad! You are of course right, Light is needed. My temporary solution is to hold the phone about .6cm above the pad, letting light in the side. My camera picks up enough to see at this distance."
don't see him do that in the video, and the window which he moves on the screen stops for a couple of seconds right before the camera points at the phone. that's why i said it's bullocks. i'm no programmer, we've done a couple of games for eyeToy, so i know you need light and contrast. (that's obvious) notice in the link i posted the guys were wearing contrasting, flat t-shirts. (Blue t-shirt/yellow block etc) not sure that Monster of a camera on that Nokia can handle patternless black surface (mousepad from the video, even at 6cm).
EDIT : Ok - just noticed he sais .6cm , not 6 .
so, half a cm... .. i don't know...
anyway - i'm open minded... might as well be true.
so has anyone been able to get the game ccsnake to work on their kaiser? might be a place to start.
what about using a glow in the dark material as a mouse pad ?

Tilt Sensor Not-Quite-SDK

I contacted HTC and asked them if they had a tilt sensor SDK, or had plans to release one, and they basically said "no". So, I decided to see what I could come up with to get tilt response integrated into my little pet-project, and to my surprise, managed to figure out how to get some basic data out of the existing tilt sensor DLL on the Diamond.
If you'd like, you can see my "hello world"-level app using the tilt sensor here on my blog. I've included the source so others can play with the few tidbits I've figured out. The app itself is pretty boring, it'll really only be of interest to developers looking to integrate tilt into their app, and even then, it's still a boring app =)
If accessing the tilt sensor is well known, feel free to ignore me.
Well done, thats great!
You should also probably look at this and talk to CharlyV, he might be able to add some info.
http://forum.xda-developers.com/showthread.php?t=403939
That's great news !
Now developers might use such information to release usefull applications and funny games !
Yes, I was wondering, for my car I use the G-tech for acceleration-measurement.
Is this sensor sensitive / good enough to also do those kind of things?
Also, navigation programs can be a lot more precise by knowing when accelerating, cornering or braking.
Riel said:
Yes, I was wondering, for my car I use the G-tech for acceleration-measurement.
Is this sensor sensitive / good enough to also do those kind of things?
Click to expand...
Click to collapse
Good question: I might try to write some sort of logging program and see what kind of data I can get out of a car trip. That's a bit off for now.
Also, I made a minor update the project, I determined a few more of the unknown values that the API returns.
perhaps you or some other guys are capable to work with some tools mentioned in this post??
http://forum.xda-developers.com/showpost.php?p=2373447&postcount=56
Is there any chance to develop a calibration tool for this sensor?? Mine drifts to lower-left and thats annoying because Opera always means, I rotate my phone :-(
Thank you
I updated the project to include a sample of how to use the event driven notification of different orientations that Opera uses (instead of polling the sensor constantly to determine the current orientation).
I'll have to do some digging to see if there's any way to calibrate the sensor. It'd be nice (mine is a bit off too), but I don't see anything immediatly obvious.
Perfect news!
I hope there are devs, who will make apps or games for this. My idea of a new game is "Black Circle".
(Side in German bug game in English, dont worry)
http://spiele.isnichwahr.de/r432-spin-the-black-circle.html
What do you tink about it?
I wrote a managed wrapper based on Scott's work:
http://blog.enterprisemobile.com/2008/07/using-htc-diamonds-sensor-sdk-from-managed-code/
I think it would be possible to calibrate the sensor by replacing the HTCSensorSDK.dll with one that acts as a pass through to the real thing. Then it could "massage" the returned values with calibration adjustments.
Teeter -> HTCSensorSDK.dll (one we roll that tweaks values) -> RealHTCSensorSDK.dll (the real DLL)
I don't think that the DLL is replaceable unless the device is flashed with a new ROM.
Thoughts?

Establish standard for G-Sensor calibration

Here is an idea: a lot of people are unhappy about the fact that their G-Sensor is out of alignment, and that this may negatively affect apps which may be developed in the future (or which are already under developemnt) and which rely on the sensor for something critical. Though my device does not suffer from this, I can fully understand them!
However, today the only app which uses the sensor is Teeter, for which - frankly - this mis-alignment is not a huge issue! The reason I say this is that this app would fall outside of what I propose below...
So, here is my idea: why don't we set up a simple standard for the G-Sensor calibration, to be stored in the registry in a dedicated set of keys, and develop a quick and simple application to calibrate it and store the values in there (much like was done in BubbleLevel)?
As long as all developers here agree to use these values and stick to the standard... voila! We can all have a calibrated G-Sensor, which any future program will know how to read correctly (by correcting the values it gets with the offsets stored in the Registry to get a perfect reading).
What do you people think (especially all you developers out there)? Anyone care to volunteer a registry location and some key names?
That would be really great
that's exactly what we need...
Instead of using HTCSensorSDK.dll we could create a HTCCalibratedSensorSDK.dll (for example )
Exactly same interface, but calibrated... The developers only would have to change their dll names...
I did the day before a such dll for testing purposes, and its really simple (I even successed in 'calibrating' teeter when overwriting the original one..).
I think this is the thing we have to do...
Other inputs?
Sven
g-sensor not working
after i installed gsen my g-sensor dont work! when i try to play teeter the ball is stuck up and only moves left to right. also it opens my ktcalbum upside down. can the touchflo be reinstalled maybe? any idea?
svenso said:
that's exactly what we need...
Instead of using HTCSensorSDK.dll we could create a HTCCalibratedSensorSDK.dll (for example )
Exactly same interface, but calibrated... The developers only would have to change their dll names...
I did the day before a such dll for testing purposes, and its really simple (I even successed in 'calibrating' teeter when overwriting the original one..).
I think this is the thing we have to do...
Other inputs?
Sven
Click to expand...
Click to collapse
This sounds live a VERY good idea. Do I understand you correctly, that you actually have a basic version of the DLL already done???

Apache! Track Ball! Landscape View! (questions)

Any chance there's a way to run Apache Home Server on my CDMA Hero?
Not looking for anyone who wants to convince me not to, I would just like to know if it's possible/doable.
Also, rather than making a seperate topic,
Is there any way we can:
1) Make a pointer for the track ball? Even, at the very least, while using the browser? I mean, really... why has this not been done yet?
2) Make it so our Home Screens turn when the Accelerometer changes to wide view. When sliding the keyboard out on the Droid and (I believe G1) the viewing automatically changes to landscape. I would love this feature as well. Is this doable, possible?
Thanks in advance, any advice given is appreciated!
bump...
>.>
if you compile apache and all the libs and whatever it depends on for android then it should be possible. afaik there is a webserver for android out there, any reason why it needs to be apache? i think it is way to complex for android, a small lightweight webserver should be no problem in theory.
a trackball pointer might be possible, but not trivial. personally i don't see the reason, when using the trackball in the browser the selected link is highlighted green, what do you need a pointer for?
again, theoretically doable is also the rotated homescreen. you "just" need to redesign sense ui for landscape view. which might be really hard, as it is more than just a small app, and it is closed source (because it is part of htc's modifications, not part of the original android). tbh, don't wait for it to happen unless htc does it.
and last but not least: no offense, but give your posts a few hours, not everything is answered directly.
kendong2 said:
if you compile apache and all the libs and whatever it depends on for android then it should be possible. afaik there is a webserver for android out there, any reason why it needs to be apache? i think it is way to complex for android, a small lightweight webserver should be no problem in theory.
Click to expand...
Click to collapse
It doesn't need to be Apache, I'm just more familiar with that particular server software. If there are other options I would be glad to explore them. There are a few things I would like to test that I think would be kind of cool depending on the type of webserver I can run.
a trackball pointer might be possible, but not trivial. personally i don't see the reason, when using the trackball in the browser the selected link is highlighted green, what do you need a pointer for?
Click to expand...
Click to collapse
A track ball would help out in a lot of ways. If open to the OS it would let me select programs, etc. while wearing gloves. It would open up the option of navigating without having to actually use the touch screen in case the scenario presents itself (again, gloves).
If just the browser it could help with games and those types of things. One important thing I have noticed is that I can't scroll within a frame on the browser. If I had a pointer I could, at the least, be able to click and drag the inner frame down without moving the main browsing page. This is somewhat vital to me as my College's Blackboard System is completely based on these types of web pages.
again, theoretically doable is also the rotated homescreen. you "just" need to redesign sense ui for landscape view. which might be really hard, as it is more than just a small app, and it is closed source (because it is part of htc's modifications, not part of the original android). tbh, don't wait for it to happen unless htc does it.
Click to expand...
Click to collapse
That's a shame. The one problem I have is the amount of rotating I have to do. I would prefer to have the home screens locked in landscape rather than how they are now. It's just a little ridiculous to be watching a video on the phone and texting someone... but every time you want to reply/text you have to rotate the phone. It just seems tedious and I'm a man of efficiency if I can help it.
Maybe I can convince HTC.
and last but not least: no offense, but give your posts a few hours, not everything is answered directly.
Click to expand...
Click to collapse
Sorry about that. XDA is very popular and I assumed my post had already become lossed in the fray. I posted on my lunch break and bumped one hour before having to go home so I had hoped I would get one response before then.
Thanks!
And anymore information would be appreciated. Not just from you but anyone else who has any information.
fatkitty420 said:
2) Make it so our Home Screens turn when the Accelerometer changes to wide view. When sliding the keyboard out on the Droid and (I believe G1) the viewing automatically changes to landscape. I would love this feature as well. Is this doable, possible?
Click to expand...
Click to collapse
I believe this is being done in the 2.1 Sense that HTC have promised us...sometime.
But imo its really ugly, nothing seems to be the right proportions (I'm a designer, so it kinda bugged me)
fatkitty420 said:
A track ball would help out in a lot of ways. If open to the OS it would let me select programs, etc. while wearing gloves. It would open up the option of navigating without having to actually use the touch screen in case the scenario presents itself (again, gloves).
Click to expand...
Click to collapse
that can be solved, press menu on homescreen, from there on you can use the trackball to navigate to all programs and then navigate through the menu.
i got myself some gloves from north face, which have a conducting fabric on the tips of thumb and index finger, so i can use the touchscreen natively with them. works great, actually got them before i had the hero because they are cool anyway
for the rest: i see your point now, but can't help. and tbh i don't think htc will take too much interest in your concerns... but try anyway, at least they should know about it!
For the web server you might want to try PAW server for Android. Although it's still in beta, it has a lot of built-in goodies like call log, send SMS and so on.
And you can serve your own static or dynamic (BeanShell) pages.

[Q] REQ: GPS sampling frequency increase

You may be thinking: "oh, not again that GPS crap", but no, I'm not complaining about the GPS as it is working flawlessly for me.
As I have noticed the sampling frequency of the GPS data points is 1Hz i.e. one sample every second which is not the ideal if we want to track accurately our activities specially in the corners and in not so linear routes.
Here you have an example (iPhone), 3G vs 4, the iPhone4 has a higher sampling rate and clearly better results.
So, I want to request the developers to try to change the sampling frequency from 1Hz to 2Hz. I've read somewhere that the integrated chip is 2Hz capable but disabled at driver level.
I am not sure if 2Hz are really needed, at least if you are not in a car. I am using Oruxmaps for recording tracks, there i see a huge difference when setting minimal time between gps points to 0s (Always on) and minimal distance between gps points to a lower value.
I want to see the difference after sampling changes to 2Hz
Yeah, come on, give it a try!!!
This sounds interesting. Wish i could assist in making it happen. Unfortunately Im not that clever.
Sent From My GT-Iphone-killer almost.
Well I thought I would look into this, I've never edited a driver or any thing linux in my life, but i thought "how hard can it be"?
Well I still dont know lol.
I downloaded the jm9 files from this thread.
http://forum.xda-developers.com/showthread.php?t=831725
And looking at the files the only one I can play with is the jupiter.xml file.
Now looking it seems pretty straight forward, i dont know what half of the things being enabled and disabled mean, but we can play i suppose.
One thing does concern me tho, looking at the xml file it seems to use a couple of differant servers for some kind of supl data. I know we can edit the supl entries in the gps.conf file, but maybe the jupiter file overrides that? Im not clever enough to find out unfortunately.
Anyway to cut a long story short the servers it uses are:
http://www.spirent-lcs.com/
bcmls2.glpals.com
bcmlbsqa1.glpals.com
Neither of which seem to work when using a normal web browser.
There is also some references in the xml file to frequency plan, but im not sure i really understand what these mean.
Maybe someone with better knowledge than me could take a look and see what they think.
Or maybe im barking up completely the wrong tree, in which forgive me.
I've uploaded another copy of the jm9 drivers file in case anyone wants to take a look also.
Also noticed that a chap on modaco forums has tried changing some elements, in case it is of any help...
http://android.modaco.com/content/s...xml-etc-gps-conf-and-gps-fixing/#entry1336782

Categories

Resources