Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
LyonSK
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 7
Join Date: Dec 2008
Default Orientation / magnetic (compass) sensor does not work for ICS and JB on i9100G

Guys, I'm fighting with the compass/orientation sensor issue in ICS + JB for i9100G
I don't have any experience with the kernel dev but I tried to check the source codes. That sensor seems to be AK8975 chip.
When I flash GB 2.3.6. I see the device /dev/akm8975, this is not the case for ICS and JB, even not for the offcial ICS...

When I check source of CM for i9100g there is some other device driver for magnetic sensor:
https://github.com/teamhacksung/GT-I9100G_ClockworkMod-Recovery/tree/gingerbread/kernel/drivers/sensors/compass

CM for i9100 has it:
https://github.com/dorimanx/Dorimanx-SG2-I9100-Kernel/tree/master-3.0.y/drivers/sensor

This is what I see in the logcat for CM10:
I/dalvikvm( 143): System server process 307 has been created
I/Zygote ( 143): Accepting command socket connections
D/dalvikvm( 307): WAIT_FOR_CONCURRENT_GC blocked 0ms
E/BatteryService( 307): batteryPresentPath not found
I/sysproc ( 307): Entered system_init()
I/sysproc ( 307): ServiceManager: 0x51109a40
D/SensorService( 307): nuSensorService starting...
I/MPL-mlsl( 307): MLSLSerialOpen: /dev/mpu
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 03ff
E/AKMD2 ( 307): couldn't find 'event1' input device
E/AKMD2 ( 307): libakm : Magnetometer Initialization Failed.
E/Sensors ( 307): couldn't find 'compass_sensor' input device
E/AKMD2 ( 307): akm_disable_sensor(7)
D/MPLSensor( 307): handle : 0 en: 0
D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0
D/MPLSensor( 307): MLSetMPUSensors: 0
D/MPLSensor( 307): set_power_states > MLDmpStart()
I/ ( 307): mpu3050_resume: Resuming to 0000
D/MPLSensor( 307): set_power_states > MLDmpStop()
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 0000
D/MPLSensor( 307): set_power_states > MLStoreCalibration()
D/MPLSensor( 307): handle : 1 en: 0
D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0
D/MPLSensor( 307): set_power_states > MLDmpStart()
I/ ( 307): mpu3050_resume: Resuming to 0000
D/MPLSensor( 307): set_power_states > MLDmpStop()
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 0000
D/MPLSensor( 307): set_power_states > MLStoreCalibration()
D/MPLSensor( 307): handle : 2 en: 0
D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0
D/MPLSensor( 307): set_power_states > MLDmpStart()
I/ ( 307): mpu3050_resume: Resuming to 0000
D/MPLSensor( 307): set_power_states > MLDmpStop()
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 0000
D/MPLSensor( 307): set_power_states > MLStoreCalibration()
D/MPLSensor( 307): handle : 3 en: 0
D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0
D/MPLSensor( 307): set_power_states > MLDmpStart()
I/ ( 307): mpu3050_resume: Resuming to 0000
D/MPLSensor( 307): set_power_states > MLDmpStop()
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 0000
D/MPLSensor( 307): set_power_states > MLStoreCalibration()
D/MPLSensor( 307): handle : 4 en: 0
D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0
D/MPLSensor( 307): set_power_states > MLDmpStart()
I/ ( 307): mpu3050_resume: Resuming to 0000
D/MPLSensor( 307): set_power_states > MLDmpStop()
I/ ( 307): mpu3050_suspend: suspending sensors to 0000
I/ ( 307): mpu3050_suspend: Will resume next to 0000
D/MPLSensor( 307): set_power_states > MLStoreCalibration()
I/SensorService( 307): MPL rotation vector
I/SensorService( 307): MPL linear accel
I/SensorService( 307): MPL gravity
I/SensorService( 307): MPU3050 Gyroscope sensor
I/SensorService( 307): KXTF9 3-axis Accelerometer
I/SensorService( 307): AK8975 Magnetic field Sensor
I/SensorService( 307): AK8975 Orientation Sensor
I/SensorService( 307): CM3663 Light sensor
I/SensorService( 307): CM3663 Proximity sensor

Strange thing is, that even I don't see any reference in the source codes for the AK8975 I can see this in here:
cm-10-20120731-EXPERIMENTAL-i9100g-CODEWORKX.zip\system\lib\hw\sensors.omap4.so
this:
AK8975 Magnetic field Sensor Asahi Kasei Microdevices AK8975 Orientation Sensor CM3663 Light sensor CAPELLA CM3663 Proximity sensor /dev/input couldn't find '%s' input device Couldn't open %s (%s) AkmSensor: unknown event (type=%d, code=%d) libakm.so AkmSensor: unable to load AKM Library, %s akm_is_sensor_enabled akm_enable_sensor akm_disable_sensor akm_set_delay poll_delay %lld enable Could not change sensor state (%s) compass_sensor


Any ideas?
 
LyonSK
Old
#2  
Junior Member - OP
Thanks Meter 1
Posts: 7
Join Date: Dec 2008
Today the sensors and vibration started to work. I have CM10 + horspower kernel. All I did was reboot from the menu. After another reboot it stoped working.
 
bl4ckdr4g00n
Old
#3  
Member
Thanks Meter 1
Posts: 86
Join Date: Jul 2010
I have seen many other I9100G owners encounter similar problem, but only with ICS or JB ROMs
my phone loses vibration and compass sometimes, but they come back after a few reboots, then disappear again in mystery.
But I'm pretty sure these irritating issues are entirely firmware-related, because they will disappear after flashing back to GB ROMs.
 
sambosat
Old
#4  
Member
Thanks Meter 0
Posts: 73
Join Date: Dec 2009
So is there anyfix for that problem. shall we wait for an update or flash with a coocked rom to fix that problem
 
bl4ckdr4g00n
Old
#5  
Member
Thanks Meter 1
Posts: 86
Join Date: Jul 2010
I have tried almost all ics roms. unfortunately, the problem's still there
guess we have to live with it until samsung finds the solution.

Sent from my HTC One S
 
LyonSK
Old
(Last edited by LyonSK; 8th August 2012 at 11:07 AM.)
#6  
Junior Member - OP
Thanks Meter 1
Posts: 7
Join Date: Dec 2008
I correct what I wrote originaly. in I9100g ROMs the driver for ak8975 is still there but has been moved to different directory. Also it can be found on several places and there are several versions of it:

Locactions in official GB:
drivers\misc\ak8975-reg.h
drivers\misc\akm8975.c
drivers\sensors\mpu3050\compass\ak8975.c

Locations in official ICS:
drivers\misc\ak8975-reg.h
drivers\misc\akm8975.c
drivers\misc\inv_mpu\compass\ak8975.c
drivers\misc\mpu3050\compass\ak8975.c
drivers\staging\iio\magnetometer\ak8975.c

In ICS all of the ak8975.c files contain different code.

File from GB directory drivers\misc\mpu3050\compass\ak8975.c is virtualy the same as the one from ICS.

I wonder if the files with the same name in the ICS don't colide with each other...
 
LyonSK
Old
#7  
Junior Member - OP
Thanks Meter 1
Posts: 7
Join Date: Dec 2008
In the meantime I was doing experiments and when I do the following the vibrations and compass work 2 out of 3 times:

1.) remove battery and wait 5minutes
2.) put back the battery and wait 5 minutes
3.) turn on the phone and wait 5 minutes (without touching the screen)
4.) enter the PIN

After reboot it usualy stops working again...
The Following User Says Thank You to LyonSK For This Useful Post: [ Click to Expand ]
 
sambosat
Old
#8  
Member
Thanks Meter 0
Posts: 73
Join Date: Dec 2009
Quote:
Originally Posted by LyonSK View Post
In the meantime I was doing experiments and when I do the following the vibrations and compass work 2 out of 3 times:

1.) remove battery and wait 5minutes
2.) put back the battery and wait 5 minutes
3.) turn on the phone and wait 5 minutes (without touching the screen)
4.) enter the PIN

After reboot it usualy stops working again...
That worked for me. but that is no good
 
sambosat
Old
#9  
Member
Thanks Meter 0
Posts: 73
Join Date: Dec 2009
Is there a fix for that problem or not. I don't see much people talking about this problem. is it a problem with I9100G or others. is it a problem with samsung official ICS or the cooked ones also have the same problem. This issue is really bothering me but I do not want to go back to ginger bread. any suggestion
 
LyonSK
Old
(Last edited by LyonSK; 10th August 2012 at 11:11 PM.)
#10  
Junior Member - OP
Thanks Meter 1
Posts: 7
Join Date: Dec 2008
Nope, no solution except for the trick with the fidling with the battery. I was trying to compile the kernel on my laptop but I gave up. It is not possible using the 32bit CPU. I hope someone from the developers will check my findings and investigate further.

Oh and it is problem on all ROMs including official from ICS (4.0.3) up.

 
Post Reply+
Tags
ak8975, compass, i9100g
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Guide Your Sheep to Safety with Finger Shepherd

Just a coupe of days ago, we brought you news about a game calledAgent Sheep. In that … more

Nandroid Manager Receives Major Update

Do you find yourself obsessively jumping from ROM to ROM? And do you hate having to restore a full … more

Careers in Android: Recruiter Reveals How Resumes are Chosen – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more

HttpClient Tutorial to Upload and Download with Your App

Developers wanting to interact with the Internet need to choose a package to do the … more