Author Topic: [Coding] Sensors Daemon  (Read 12767 times)

Offline OuNao

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 14
  • Posts: 331
  • Reputation: +516/-0
    • View Profile
[Coding] Sensors Daemon
« on: March 07, 2012, 06:41:06 PM »
Hi!
I'm trying to code a new sensor daemon. Maybe we can get lower wakeups and battery usage...
This is my first try You are not allowed to view links. Register or Login
This app can get accel and mag data to calculate orientation data!!!
The next work is send those data to event device (ecs_compass)... :)

Files: sources now on github You are not allowed to view links. Register or Login
V3.4: Using Low Pass Filter to avoid compass dancing issue.
Binary: You are not allowed to view links. Register or Login
V3.3: Corrected a bug on calibration file. Included a hack to stabilize the compass on high pitch.
Source: You are not allowed to view links. Register or Login
Binary: You are not allowed to view links. Register or Login
V3.2: Corrected pitch range to the android standard
Source: You are not allowed to view links. Register or Login
Binary: You are not allowed to view links. Register or Login
V3.1: Now saving hard and soft iron calibration data
Source: You are not allowed to view links. Register or Login
Binary: You are not allowed to view links. Register or Login
V3: Better behavior on high pitch (phone on vertical position). Now the calibration data is saved, reporting calibrated magnetic data and corrected magnetic z axis (Google Sky Map fix).
Source: You are not allowed to view links. Register or Login
Binary: You are not allowed to view links. Register or Login
V2: corrected yaw scale (no more negative values). Changed poll delay for 50ms default. For me, still good with no lag and top 500 wakeups (less then original memsicd...). The compass needle still dancing, but less. Still usable.
app: You are not allowed to view links. Register or Login
source: You are not allowed to view links. Register or Login
V1
This app can replace memsicd: You are not allowed to view links. Register or Login
Source: You are not allowed to view links. Register or Login

Credits to:
Mark Pedley at Freescale Semiconductor, Inc. Author of eCompass software used as base (99% ;)) to my code.

MADTeam Forum

[Coding] Sensors Daemon
« on: March 07, 2012, 06:41:06 PM »

Offline prabhum794

  • Madteam Developer
  • Hero Member
  • ******
  • Thank You
  • -Given: 6
  • -Receive: 3
  • Posts: 589
  • Reputation: +121/-45
  • MADTeam Rocks !!
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #1 on: March 07, 2012, 11:18:42 PM »
That's really great .. super cool B-)

MADTeam Forum

Re: [Coding] Sensors Daemon
« Reply #1 on: March 07, 2012, 11:18:42 PM »

Offline V6ser

  • Global Moderator
  • Madteam Developer
  • Hero Member
  • ******
  • Thank You
  • -Given: 14
  • -Receive: 71
  • Posts: 880
  • Reputation: +855/-16
  • If I helped you hit THANKS, or not...
    • View Profile
    • Madteam
Re: [Coding] Sensors Daemon
« Reply #2 on: March 08, 2012, 01:14:49 AM »
Great,

Can you code something for reduce even more the brightness?

Thanks :) :)
« Last Edit: March 08, 2012, 05:25:25 AM by rafd08 »
NO HELP BY PM!!

Offline DashBlacK

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 91
  • Posts: 1040
  • Reputation: +1042/-0
    • View Profile
    • MadTeam
Re: [Coding] Sensors Daemon
« Reply #3 on: March 08, 2012, 02:40:41 AM »
You are not allowed to view links. Register or Login
Great,

Can you code something for reduce even more the brightness?

Thanks :) :)

First of all, Galaxy 5 doesn't have a light sensor.

Second of all, light sensor has nothing to do with brightness, it just checks how bright it is and reports it to the Android System from which the Android System handles at what brightness of external light the screen brightness should be set to.

Third of all, facepalm.
« Last Edit: March 08, 2012, 05:25:44 AM by rafd08 »

Offline V6ser

  • Global Moderator
  • Madteam Developer
  • Hero Member
  • ******
  • Thank You
  • -Given: 14
  • -Receive: 71
  • Posts: 880
  • Reputation: +855/-16
  • If I helped you hit THANKS, or not...
    • View Profile
    • Madteam
Re: [Coding] Sensors Daemon
« Reply #4 on: March 08, 2012, 05:24:39 AM »
You are not allowed to view links. Register or Login
First of all, Galaxy 5 doesn't have a light sensor.

Second of all, light sensor has nothing to do with brightness, it just checks how bright it is and reports it to the Android System from which the Android System handles at what brightness of external light the screen brightness should be set to.

Third of all, facepalm.

My bad

I'm retarded  :)

But anyway "checks how bright it is and reports it to the Android System from which the Android System handles at what brightness of external light"
« Last Edit: March 08, 2012, 05:42:11 AM by rafd08 »
NO HELP BY PM!!

Offline stef

  • Full Member
  • ***
  • Thank You
  • -Given: 28
  • -Receive: 5
  • Posts: 224
  • Reputation: +119/-4
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #5 on: March 08, 2012, 06:36:02 AM »
You are not allowed to view links. Register or Login
Hi!
I'm trying to code a new sensor daemon. Maybe we can get lower wakeups and battery usage...
This is my first try You are not allowed to view links. Register or Login
This app can get accel and mag data to calculate orientation data!!!
The next work is send those data to event device (ecs_compass)... :)
Hi OuNao,
Is that ready to install in the G5 ?

Offline OuNao

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 14
  • Posts: 331
  • Reputation: +516/-0
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #6 on: March 09, 2012, 02:10:45 PM »
You are not allowed to view links. Register or Login
Hi OuNao,
Is that ready to install in the G5 ?
No! :(

But now it is! ;)
This app can replace memsicd: You are not allowed to view links. Register or Login
Source: You are not allowed to view links. Register or Login

Install: overwrite the memsicd on /system/bin/ with the new daemon. Make a backup before... ;)

For testers:
With a sensor app running (like speedx) you can open a terminal and type:
1. su
2. killall memsicd     // I supose that memsicd is the new daemon...
3. memsicd <delay_ms>  // delay_ms is the delay in miliseconds - default is 25...

Offline xfox26

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 27
  • Posts: 164
  • Reputation: +340/-0
  • Battle Angel
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #7 on: March 09, 2012, 06:48:53 PM »
You are not allowed to view links. Register or Login
No! :(

But now it is! ;)
This app can replace memsicd: You are not allowed to view links. Register or Login
Source: You are not allowed to view links. Register or Login

Install: overwrite the memsicd on /system/bin/ with the new daemon. Make a backup before... ;)

For testers:
With a sensor app running (like speedx) you can open a terminal and type:
1. su
2. killall memsicd     // I supose that memsicd is the new daemon...
3. memsicd <delay_ms>  // delay_ms is the delay in miliseconds - default is 25...

Very nice!!
Lots faster than standard memsicd, we just need to do some filtering, because the movement is too jerky (or not?)
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login


Offline DSM_

  • Saiyan Moderatorâ„¢
  • Madteam Developer
  • Hero Member
  • ******
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 935
  • Reputation: +1068/-9
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #8 on: March 10, 2012, 01:35:19 AM »
OMG! Accelerometer is super fast now. Far better than stock ;D
Super Fast, Super Smooth.

But after installing this Compass start Twitching, can you please fix this.

Also after I execute the command 'memsicd <delay_ms>' Terminal Emulator stucks there after the line, can't do anything until restart it.. nevermind
Can be fixed? :)

Thanks for your efforts, a BIG thanks

Sent from my GT-I5500 using Tapatalk
« Last Edit: March 10, 2012, 01:39:10 AM by DSM_ »
        
ROM: [4.2.1] CyanogenMod 10.1 Jelly Bean [psyke83]
Kernel: 2.6.37.6
Recovery: [6.0.1.2] ClockworkMod Recovery

You are not allowed to view links. Register or Login | You are not allowed to view links. Register or Login

Offline OuNao

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 14
  • Posts: 331
  • Reputation: +516/-0
    • View Profile
Re: Re: [Coding] Sensors Daemon
« Reply #9 on: March 10, 2012, 04:28:32 AM »
You are not allowed to view links. Register or Login
OMG! Accelerometer is super fast now. Far better than stock ;D
Super Fast, Super Smooth.

But after installing this Compass start Twitching, can you please fix this.

Also after I execute the command 'memsicd *' Terminal Emulator stucks there after the line, can't do anything until restart it.. nevermind
Can be fixed? :)

Thanks for your efforts, a BIG thanks

Sent from my GT-I5500 using Tapatalk
Compass uses a calibration algorithm. You need to do some large movements with the phone to calibrate...
What is "memsicd *"?

Sent from my GT-I5500 using Tapatalk

Offline DSM_

  • Saiyan Moderatorâ„¢
  • Madteam Developer
  • Hero Member
  • ******
  • Thank You
  • -Given: 0
  • -Receive: 61
  • Posts: 935
  • Reputation: +1068/-9
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #10 on: March 10, 2012, 05:33:18 AM »
You are not allowed to view links. Register or Login
Compass uses a calibration algorithm. You need to do some large movements with the phone to calibrate...
What is "memsicd *"?

Sent from my GT-I5500 using Tapatalk

I meant the command needle gives accurate directions but the Compass needle starts dancing... after installing your memsicd... yeah i calibrated it but still same.
i think the refresh rate is high??
the command of terminal emulator - memsicd <delay_ms> (* was any character)
        
ROM: [4.2.1] CyanogenMod 10.1 Jelly Bean [psyke83]
Kernel: 2.6.37.6
Recovery: [6.0.1.2] ClockworkMod Recovery

You are not allowed to view links. Register or Login | You are not allowed to view links. Register or Login

Offline stef

  • Full Member
  • ***
  • Thank You
  • -Given: 28
  • -Receive: 5
  • Posts: 224
  • Reputation: +119/-4
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #11 on: March 10, 2012, 06:39:04 AM »
You are not allowed to view links. Register or Login
No! :(

But now it is! ;)
This app can replace memsicd: You are not allowed to view links. Register or Login
Source: You are not allowed to view links. Register or Login

Install: overwrite the memsicd on /system/bin/ with the new daemon. Make a backup before... ;)

For testers:
With a sensor app running (like speedx) you can open a terminal and type:
1. su
2. killall memsicd     // I supose that memsicd is the new daemon...
3. memsicd <delay_ms>  // delay_ms is the delay in miliseconds - default is 25...
Great!
If 25 is default what happens at 20 or at 30 ?
What would be the maximum range?

Offline Delta25

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 168
  • Reputation: +34/-0
  • junior member??? im +v on irc :S
    • View Profile
Re: Re: [Coding] Sensors Daemon
« Reply #12 on: March 10, 2012, 08:01:57 AM »
You are not allowed to view links. Register or Login
Great!
If 25 is default what happens at 20 or at 30 ?
What would be the maximum range?
your phone would probably explode :(

Enviado desde mi GT-I5500 usando Tapatalk
im from argentina and 14 years old, i speak english and spanish, hello :D

claro GT-I5500L
Clockworkmod the lastest
Cyanogenmod 7 the lastest test build
baseband I5500LUYJPE

Offline stef

  • Full Member
  • ***
  • Thank You
  • -Given: 28
  • -Receive: 5
  • Posts: 224
  • Reputation: +119/-4
    • View Profile
Re: [Coding] Sensors Daemon
« Reply #13 on: March 10, 2012, 08:38:23 AM »
You are not allowed to view links. Register or Login
your phone would probably explode :(

Enviado desde mi GT-I5500 usando Tapatalk
Just like your knowledge did, right?

Offline OuNao

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 14
  • Posts: 331
  • Reputation: +516/-0
    • View Profile
Re: Re: [Coding] Sensors Daemon
« Reply #14 on: March 10, 2012, 09:51:27 AM »
You are not allowed to view links. Register or Login
Great!
If 25 is default what happens at 20 or at 30 ?
What would be the maximum range?
A higher value make the sensor laggy. A lower value can overload the framework with events, more driver read and, maybe, more battery usage...

Sent from my GT-I5500 using Tapatalk

 

SimplePortal 2.3.5 © 2008-2012, SimplePortal