• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [WIP][Only Experts] Activate Compass and ambient light sensor :p

ninadchaudhari

What's up !
Guys this is another very experimental project ....
like the A75 root thing [which is success]
this just a plan is drawn over a paper on Air ...

here is how i think :

IF you look in the /system/etc/permissions
you can find the permissions things which sort of give permissions for the Hardware and stuff ...

i just copied the files for Compass and tried in A70 but does not work :p
now I think if we just try the library files we can activate the Compass !
may be from another 2.2 device ???
may be we can try get the libraries from A70 clones or may be like bruit force
try from many 2.2 device :p

I know this seems to be a very difficult task but just i think this is possible

Things that seem impossible may be possible :p

I have the Galaxy S, Galaxy tab, library files [2.2]!!
may be we can add the library files and try if it works ...
 
We can try replacing these( which sam said ) files from Hybrid 4 experimental as its rom based on u9 s320 and it has enabled compass sensor , n if still no success then we come to the same conclusion kernel source...!! i can't try today will be needing my phone urgently for 5-6 days so can't taker risk
 
ok today my a70 hung up and had to pull battery to make it boot and while it was booting, i caught a logcat for curiousity and found heart blasting shocking line in that
so as to confirm i rebooted my a70 again but never got that line again
Please can someone confirm whether this line comes or not?
I think it comes only when phone hangs

This is the line
Code:
E/boot_progress_preload_start (time|2|3)initializing light sensor(1|2)failed to get kernel_gcc_3824: initialization failed:15478(   74): 11994
I don't know what this line tends to say exactly
can karan or playfulgod or sam explain(I m not good in reading logcats :P :D)
 
I found this line too..i posted earlier in ur thread regarding that engineer mode n compass n light sensor...but may be missed lightsensor thing...

02-19 04:59:01.471: I/kernel(347): <6>[ 0.969188] AK8973 compass driver: ---------------MM--------------init
So i think kernel does have compass driver..
 
We all having "akmd2 : Cannot open device" error flooding our logcat.
n looking to above post my view is kernel initializes compass driver n akmd2 also does work but it does not have permission to do so...n just adding permission doesn't working as I also tried that earlier n now varun also having same results.
If u guys look at logcat then there are also some lines which tells how many sensors to use/activate..i will find those lines n post here.

EDIT:
Here it is,may be of use,don't know...

03-08 00:53:25.141 E/Sensors ( 1019): open_input name:7k_handset de->dname:event4 devname:/dev/input/event4 fd:90
03-08 00:53:25.141 E/Sensors ( 1019): open_input name:psensor de->dname:event3 devname:/dev/input/event3 fd:90
03-08 00:53:25.141 E/Sensors ( 1019): open_input name:gsensor de->dname:event2 devname:/dev/input/event2 fd:91
03-08 00:53:25.141 E/Sensors ( 1019): open_input name:surf_keypad de->dname:event1 devname:/dev/input/event1 fd:92
03-08 00:53:25.141 E/Sensors ( 1019): open_input name:Focal touch de->dname:event0 devname:/dev/input/event0 fd:92
03-08 00:53:25.151 E/Sensors ( 1019): sensors_data_data_open sEvents_fd[0]:89 nh->data[0]:91
03-08 00:53:25.151 E/Sensors ( 1019): sensors_data_data_open sEvents_fd[1]:92 nh->data[1]:90
03-08 00:53:25.151 E/Sensors ( 1019): sensors_control_activate active=00000000 sensor=00000002 new_sensors=2 changed=2
03-08 00:53:25.151 E/Sensors ( 1019): enable_disable_gsensor sensors:2 mask 2
03-08 00:53:25.151 E/Sensors ( 1019): enable_disable_psensor sensors:0 mask 32

03-08 00:53:33.711 E/Sensors ( 1367): sensors_list size = 2
03-08 00:53:33.711 E/Sensors ( 1367): sensors_list size = 2


What I realize from this is it activates 2 sensors, Gravity Sensor n Proximity sensor...but it does not lists Compass here even though driver has been initialized before...
 
try to enable touch screen drivers also .
As in engineering mode it says "touch - disabled ".
 
I thought to take a complete different approach ,
When a device is shutdown its OS power down all the sensors b4 going to power off , hence I thought it will surely try to turn off the Compass sensor while the android gets power down

After which I discovered a thing and was shocked as well ,
When I monitored the A70 while shutdown , I found
akmd2 was giving problems ans reported that it is missing ...

Then I had a look at A70 decompiled system and found it was still there and making probs while power down

When I tried to investigate the matter I found , that many places ppl have complaints of akmd2 draining battery and renaming it to something else
causes the compass to stop working .
It was enough for me to get , that it plays a vital role in Magnetometer

and was later confirmed that it does have a role in Compass operation...

Then I had a look at a this : http://androidforums.com/moment-all-things-root/20320-init-rc-recovery-rc-these-worthwhile.html
which is a Samsung Momentum btw ,

In which I noticed initialization of akmd2 while boot ...

When I checked the A70 boot, init.rc I found A70 has references for the same but the difference was it was given to Root rather than system !

After I came to know that even other device have it ...

I replaced the lines of akmd2 initiation with ones from the samsung momentum init.rc and tried to boot , it sure boots but the weired thing i observed was that when my phone lies with no activity it shows many errors for akmd2 device not found

as far as Other devices are concerned,
for HTC ( i checked in Desire) its User is set for COmpass

For Samsung it is for system

for those curious its in /system/bin
and having it called via shell returns error

i tried shifting the user to Compass but all in vain

As far as I can see it ,
There sems to be no Magnetometer in A70 as a initlization of the same replies with no device found... [[ Not least now ]]

Or I think, we need proper library files for the same ..
but the trouble is that every library file is highly device specific and hence we jut least need some hint as from where the Compass sensor comes , its name etc ...

The mistery can be resolved by opening the device may be a teardown ...

I have planed for opening the device but lets' see if any one in my Family opposes it as it has just now come from a screen repair :D

Btw I had typed a more detailed info abt everything I found but My PC hanged just as I clicked the save post button :p
Ask for more things if u want to know ...
 
I was also going through this all akmd2 errors n eating battery issues yesterday.
on shell applying akmd2 should response with orientation info but as expected a70 returned Error(cannot open)..well we all know that..i suspect something is wrong with akmd2.at one place I found that someone posted source for that so one can compile it for himself,he also advised that it can be used for other device,we have to change some lines in some *.c file. but that download link gave 404 error..
 
i think this might help but if doesn't please don't abuse me or so
on extracting ramdisk i found a line in init.goldfish.rc

# disable some daemons the emulator doesn't want
stop dund
stop akmd
i think this might be disabling it

and also a file init.qcom.rc was having initial file configurations so if we include the cpu frequency lines in this file or any other file that might help overclocking
 
i think this might help but if doesn't please don't abuse me or so
on extracting ramdisk i found a line in init.goldfish.rc

# disable some daemons the emulator doesn't want
stop dund
stop akmd
i think this might be disabling it

and also a file init.qcom.rc was having initial file configurations so if we include the cpu frequency lines in this file or any other file that might help overclocking
Well i did not find "stop akmd" ay where ??
also there is nothing in init.qcom.rc for overcolcking..
 
@ninadchaudhari have you extracted the ramdisk or just trying to see it your phone itself


and i m not saying there is something in init.qcom.rc abt overclocking ,what i want to say it that we can add
echo value over there
 
@ninadchaudhari have you extracted the ramdisk or just trying to see it your phone itself


and i m not saying there is something in init.qcom.rc abt overclocking ,what i want to say it that we can add
echo value over there
U mean like this???

Code:
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 737280
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 122880

I don't think it's possible to overclock like this.frequencies should match with the kernel power management file so even if we put these lines in init.qcom.rc we won't be able to overclock as kernel must support it 1st.
 
N regarding compass driver, today I replaced akmd2 binary with G1 akmd binary n restarted.
On logcat it gave error like
AKMD: Can not open compass ----1
AKMD: Can not open compass ----2
AKMD: Can not open compass ----3
3 times like that n then no errors at all.
I didn't get AKMD: device can't be open errors which floods our logcats.
So what i think is it's a problem with akmd binary itself.means binary has no support for the hardware installed on device.so may be some other binary may help or we need to compile one..no idea abt that,just a guess..
 
N regarding compass driver, today I replaced akmd2 binary with G1 akmd binary n restarted.
On logcat it gave error like
AKMD: Can not open compass ----1
AKMD: Can not open compass ----2
AKMD: Can not open compass ----3
3 times like that n then no errors at all.
I didn't get AKMD:Device can't be open errors which floods our logcats.
So what i think is it's a problem with akmd binary itself.means binary has no support for the hardware installed on device.so may be some other binary may help or we need to compile one..no idea abt that,just a guess..
I too suspect it. I am willing to dismantle my handset but am concerned about the warranty, my warranty ends in July, so its gonna take long time.
 
Check the LCD Manufacturer name if possible...
Best of luck :)
Ya i know karandpr wants to know that right??
Will try.opening back side is easy,just done now...but i couldn't open front cover n on opening back there r very few things i can see,none of our importance except vibrator:D if sm1 still getting that problem.
OK so as of now I can't open front side as I m scared too not to break lcd:p
I will call upon my cousin,he knows how to do that all n update later fellas..
 
Ya i know karandpr wants to know that right??
Will try.opening back side is easy,just done now...but i couldn't open front cover n on opening back there r very few things i can see,none of our importance except vibrator:D if sm1 still getting that problem.
OK so as of now I can't open front side as I m scared too not to break lcd:p
I will call upon my cousin,he knows how to do that all n update later fellas..

Don't take un-unnecessary risks :)
No need to open up just to check the LCD Manufacturer.
 
Back
Top Bottom