[XPOSED] VirtualSensor - Emulate a gyroscope from the accelerometer and compass - Xposed Framework Modules

Introduction
VirtualSensor is a module built on Xposed that creates several sensors on devices which do not have them. It does sensor fusion using the values from the accelerometer and the compass which are the two main requirements for this module.
There are currently 5 sensors emulated :
TYPE_ROTATION_VECTOR
TYPE_GYROSCOPE
TYPE_GEOMAGNETIC_ROTATION_VECTOR
TYPE_GRAVITY
TYPE_LINEAR_ACCELERATION
Being the most useful sensor for many applications, the gyroscope is the main sensor this project is about.
This module is born as an answer to personal frustration from not being able to use some applications after updating from my older Moto G (i.e. Photo Sphere) and later also as an answer to this thread.
Changelog
Code:
v1.5.1 - 02/08/2017:
This minor version fixes the module for Nougat devices.
See the changelog of v1.5.1 for the more information on what has changed for the major version 1.5.
v1.5 - 02/08/2017:
Finally a new release after (quite) a while. This release should fix the majority of bugs encountered on current and previous versions of Android.
With the precious help of people on Github, the cardboard hook has been (hopefully) improved.
The overall stability and reliability should be better now.
This release will stay marked as beta until relevant and good feedback is received, to please head over to Github if you can and report issues if any (or add to the exising issues to check wether they still exist)
v1.41 - 01/08/2016:
* Fixed the module, previous version broke it because of proguard minify, do not use version v1.4
v1.4 - 31/07/2016: /!\ This version is broken, avoid it /!\
* Added a check for already existing native sensors so that they don't get overridden by the module
* Now checks the values of the accelerometer and magnetic sensor against their accuracy. This means that the output values contain less noise without loosing too much precision
* Added a simple GUI to quickly get informations about the module. This part also calculates the values the gyroscope should return and compares them against the one the module actually returns
* Some hooks are now made on higher-level API (public available functions for apps), which means that specific device code should no longer break them
* Fixed a recurrent exception (ConcurrentModificationException)
v1.32 - 29/07/2016:
* Fix the mRequiredPermssion field no available on SDK < 20
Hotfix #2 for v1.3
v1.31 - 29/07/2016:
* Fixes the issue with SDK <= 18 where mStringType doesn't exist in the Sensor class
Hotfix for v1.3
v1.3 - 29/07/2016:
* Sensors are now added in a proper way. They should no longer accidentally override existing sensors / cause compatibility issues
* All gyroscope axes are fully functional !
* If it didn't work before for you on JellyBean-Lollipop, try now, it might (fixed the check for initialisation of SystemSensorManager)
* Started to work on a new filter system for the gyroscope mainly
v1.21 - 25/07/2016:
Hotfix for v1.2 to avoid crashes on JB devices.
v1.2 - 26/07/2016:
* Fixed compatibility with SDK18-22 (Android JellyBean 4.3 - Android Lolipop 5.1)
* Added a little more log
* Calculation for the gyroscope is now based on the calculated gravity sensor data, which (should) makes it work as intended in any orientation
* The virtual sensors now have a little more information in the created Sensor class, just to make sure this isn't an issue
v1.11 - 25/07/2016:
Hotfix for v1.1, fixes an exception raised in some cases when trying to get the accelerometer's min delay.
v1.1 - 25/07/2016:
* Added support for all SDK versions from SDK16 to SDK23+, this means all android versions starting from Jelly Bean should be supported
* Added a lot of new sensors : TYPE_ROTATION_VECTOR, TYPE_GEOMAGNETIC_ROTATION_VECTOR, TYPE_GRAVITY and TYPE_LINEAR_ACCELERATION
* Still no support for Pokémon GO though, working on it
* Some exceptions fixed
* Code refactored a lot
v1.0 - 23/07/2016:
Initial release.
Known issues
Right now, the Z-axis is not emulated as it always returned wrong values (Investigating this right now) Fixed
Some applications use the NDK instead of the SDK to access the sensors, the workaround is to hook them seperately, but that isn't done yet
There is some jitter even though the values are smoothed using a lowpass filter and averaged out
Disclaimer
Code:
Though it is unlikely this could happen given the modifications it does, the responsibility is yours for whatever happens after installing and using this module.
Download
Github : https://github.com/Frazew/VirtualSensor/releases/
Xposed Repository : http://repo.xposed.info/module/fr.frazew.virtualgyroscope
Contributing
There is a Github project for this module so please do not hesitate to contribute to it. I'll be glad to share knowledge and code. Please know that I'm not (yet? ) a professional coder and that errors are quite likely to happen.
XDA:DevDB Information
VirtualSensor, Xposed for all devices (see above for details)
Contributors
Frazew
Source Code: https://github.com/Frazew/VirtualSensor
Xposed Package Name: fr.frazew.virtualgyroscope
Version Information
Status: Testing
Current Stable Version: v1.5.1
Stable Release Date: 2017-08-02
Created 2016-07-23
Last Updated 2017-08-02

Reserved

I supposed you tested this with Pokemon GO, as is the reason of so many requests for a virtual gyroscope so I'll suppose is still nor working due my specific device.
Motorola Moto X Play, running CyanogenMod 13.
Thanks for your work!

Thanks for chance to get normal VR experience
Works great with Lenovo Vibe P1 (this device has a jittering problem with its own pseudo-gyro). Tested with Youtube 360 videos. Works great for watching up/down and rotate. As well as you said z-axis is not working at all, so it's impossible to move point of view to the left/right. Can help you with testing on my device, if you want. I have Lenovo Vibe P1 with Android 6.0, TWRP and Root.
P.S. Is there any way to turn on z-axis for testing, for example by using your project at github. I'm not sure if I will understand there something, I was coding before only at C#, but I can try.

OliverG96 said:
I supposed you tested this with Pokemon GO, as is the reason of so many requests for a virtual gyroscope so I'll suppose is still nor working due my specific device.
Motorola Moto X Play, running CyanogenMod 13.
Thanks for your work!
Click to expand...
Click to collapse
I did not test it with Pokémon GO, however I think the hook will have to be made in the app itself. I'll look into it right now
EDIT: Pokémon GO uses the TYPE_ROTATION_VECTOR sensor. This sensor requires data from the gyroscope. I'm working right now on emulating it.

Saratsin said:
Works great with Lenovo Vibe P1 (this device has a jittering problem with its own pseudo-gyro). Tested with Youtube 360 videos. Works great for watching up/down and rotate. As well as you said z-axis is not working at all, so it's impossible to move point of view to the left/right. Can help you with testing on my device, if you want. I have Lenovo Vibe P1 with Android 6.0, TWRP and Root.
P.S. Is there any way to turn on z-axis for testing, for example by using your project at github. I'm not sure if I will understand there something, I was coding before only at C#, but I can try.
Click to expand...
Click to collapse
Glad to see that it works ! I could make another build with the Z axis activated but I really need to look a bit more into it. The problem with it is that it seemed to return higher values than the other axes. This generally broke the calibration many apps do and though the z-axis worked, they would then ignore the small variations of the other axes.
In case you want to build it yourself, it's quite easy, just remove the multiplication by zero here : https://github.com/Frazew/VirtualSensor/blob/master/app/src/main/java/fr/frazew/virtualgyroscope/XposedMod.java#L156

Can't install it on Jelly bean 4.2.2 :/

first a big THANKS!!!!!
I downloaded sensors tests app.before the module,gyroscope test wasn't there!after the module,voilla!!gyroscope test was there!I openned it and tested side by side with my xperia Z3 tablet.But values was muuuch different...It's ok,we all hope for possible future module updates!again THANK YOU!!!

Dant3s said:
Can't install it on Jelly bean 4.2.2 :/
Click to expand...
Click to collapse
Right now the minimum SDK version is KitKat, that's just because the sensor methods are different on Jelly Bean and I haven't worked on it.
Now that there are people who can actually test it on Jelly Bean I'll make an update to add support for it

Frazew said:
Right now the minimum SDK version is KitKat, that's just because the sensor methods are different on Jelly Bean and I haven't worked on it.
Now that there are people who can actually test it on Jelly Bean I'll make an update to add support for it
Click to expand...
Click to collapse
Glad to hear that, thanks

have see this thread : Help module to simulate Gyroscope with Accelerometer and Compass by nicolobos77

Hey, since we've doubled same purpose module I decided to use yours since its clear that you have much more experience than me and your code is much more elegant. (I never used Xposed before)
I built and ran it on my phone, and noticed exception thrown in logs (made pull request with fix at github), this wasnt big deal, but it seems like even though math is correct, sensor behaves wierd. Output is delayed by ~1 sec. There is also wierd "bounce effect" after rotating at ~20degree/sec and stopping velocity goes to ~-20 degree for a moment and drops back to 0.
Also depending on delay set up by application when registering listener some of apps only seem to get any output other than 0 if I like swing phone very hard. So my guess is that you might have more sensitive sensors in your phone and smoothing methods you applied are overkill for mine. I'll look into it closer later today, or tomorrow and see if changing parameters helps.

Thanks you for your work. One question, my phone has this, link to the image: imgur.com/a/lD7Sg Accelerometer it's fine but compass and orientation sensor are the same thing?. I cant find an app that can show me if I have compass sensor. Thanks you again and sorry for my bad english :/
And can you make a guide like "How to Install or what do you need in order to" or something like that? Please?

Maveroik said:
Thanks you for your work. One question, my phone has this, link to the image: imgur.com/a/lD7Sg Accelerometer it's fine but compass and orientation sensor are the same thing?. I cant find an app that can show me if I have compass sensor. Thanks you again and sorry for my bad english :/
And can you make a guide like "How to Install or what do you need in order to" or something like that? Please?
Click to expand...
Click to collapse
Compass means Magnetic Sensor, so yes, you do have one.
Frazew said:
EDIT: Pokémon GO uses the TYPE_ROTATION_VECTOR sensor. This sensor requires data from the gyroscope. I'm working right now on emulating it.
Click to expand...
Click to collapse
I did some reverse engineering on that matter, Pogo uses whole bunch of sensors: TYPE_GRAVITY, TYPE_GYROSCOPE, TYPE_ACCELEROMETER, TYPE_MAGNETIC_FIELD, TYPE_ROTATION_VECTOR and TYPE_LINEAR_ACCELERATION.
Actually I believe that TYPE_ROTATION_VECTOR can be simulated by copying TYPE_GEOMAGNETIC_ROTATION_VECTOR values.

Mourdraug said:
Hey, since we've doubled same purpose module I decided to use yours since its clear that you have much more experience than me and your code is much more elegant. (I never used Xposed before)
I built and ran it on my phone, and noticed exception thrown in logs (made pull request with fix at github), this wasnt big deal, but it seems like even though math is correct, sensor behaves wierd. Output is delayed by ~1 sec. There is also wierd "bounce effect" after rotating at ~20degree/sec and stopping velocity goes to ~-20 degree for a moment and drops back to 0.
Also depending on delay set up by application when registering listener some of apps only seem to get any output other than 0 if I like swing phone very hard. So my guess is that you might have more sensitive sensors in your phone and smoothing methods you applied are overkill for mine. I'll look into it closer later today, or tomorrow and see if changing parameters helps.
Click to expand...
Click to collapse
Thanks for your, I didn't see this exception when I tested it, but now that you bring it up, it seems obvious.
As for the delay you are talking about, the explanation I have for this is that I filter the output using a mean filter that uses the 10 previous values. This has the advantage of reducing the jitter a lot but it also has the huge disadvantage of adding a lot of delay. I will change this as there are better ways to filter the output than using the mean of the previous values. Like I said, I only tested it with my phone and did not take into account the sensitivity of the sensors. This is actually a good idea and I'll have to change that. Feel free to tweak what you want and make pull requests, that's the best way this module can evolve.

Mourdraug said:
I did some reverse engineering on that matter, Pogo uses whole bunch of sensors: TYPE_GRAVITY, TYPE_GYROSCOPE, TYPE_ACCELEROMETER, TYPE_MAGNETIC_FIELD, TYPE_ROTATION_VECTOR and TYPE_LINEAR_ACCELERATION.
Actually I believe that TYPE_ROTATION_VECTOR can be simulated by copying TYPE_GEOMAGNETIC_ROTATION_VECTOR values.
Click to expand...
Click to collapse
I reverse engineered it too and saw these sensors too. The thing is: TYPE_GRAVITY is a virtual sensor created from the accelerometer so no need to simulate it. TYPE_MAGNETIC_FIELD is the compass and TYPE_LINEAR_ACCELERATION is also a virtual sensor created from the accelerometer so no need to simulate it either. I have right now working code to make the TYPE_ROTATION_VECTOR work. I didn't see the TYPE_GEOMAGNETIC_ROTATION_VECTOR so I did the math directly from the rotation matrix values. I guess I'll change to use its values since it's already there, thanks for your help
EDIT: Actually the TYPE_GRAVITY is not a virtual sensor. My bad, I'll see what I can do to simulate it.
EDIT2: Actually TYPE_LINEAR_ACCELERATION is not always present either, I'll simulate it too. I should verify a bit more before posting stuff.

I would donate some cash if you could get the AR function to work in PoGo! That would be awesome!

wktra said:
I would donate some cash if you could get the AR function to work in PoGo! That would be awesome!
Click to expand...
Click to collapse
No need for cash but I'm currently working on it. I implemented a whole new lot of sensors but sadly PoGo doesn't work with them just yet. I'm investigating this and will make an update once it's ready (I play PoGo too so I'd like to see it work too).

Hi , I just registered to thank you a lot for the effort you're doing.
It doesn's seems to work on my LG G3 S, however thank you a lot and hope someone can help you making it through !
Keep the good work.

Dont work on youtube or pokemon Go in motorola moto g 2015(xt1541). Also i installed Cpu Z and it show the virtual gyro sensor ... I dont know why dont work on 360 video on youtube.(sorry for bad english)

Related

[ROM][Early pre-alpha] AOSP ICS 4.0.4_r2.1 for DS5.

PREFACE: This ROM is not intended for everyday use and posted mainly for experienced users and streak-oriented developerss to evaluate it and collaborate on bug resolution and further development. If you expect it to fit any particular purpose - answer is: "No, not yet."
People who really helped to make this possible:
985hPaKicK - author of original cm9 overlay files and pricey patches for DSC kernel.
Sergei Lyubshin (n0p) - team lead of DSC Phoenix kernel, which is used (in it's ICS-que incarnation) to power up this ROM.
Marc Alexander (marc1706) - original kgsl3.8 backport is taken from his kernel HD2 ics and used to provide support for ICS adreno drivers. Also, Marc's advices on changes in hw init procedures related to new kgsl were priceless. Marc, you're da man!
TeamICS - for excellent guides on installing android build environment.
Team Evervolv and CyanogenMod teams - for their hardware overlays.
Currently working:
Boot
Adeno drivers used to provide hwaccel (for real now, surfaceflinger no longer eats 100% of cpu all the time)
GSM subsystem - rild is partially working (no sim pin prompt)
Bluetooth - seem to work. Phone is able to pair to BT headset and output sound thru it (OP's Nokia's BH-103 - tested)
Wifi - partially. Signal strenght not being displayed at statusbar
Touchscreen - working.
Charging - works partially. Phone charges, reports battery percentage, but not voltages.
Sound output - works (No headset icon in statusbar is normal for stock sources.)
Data usage collecting.
UMS
Known not to work:
Everything that's not listed as working.
Other bugs observed by OP (to be extended with ROM users' feedback):
No mobile data reported by several users. OP is unable to reproduce it, so it's being investigated in "blind" mode at the moment. Currently known rild refuses to establish datacall because it thinks that user has no data subscription. EDIT: there's report that removing PIN makes things to work. Not perfect, yes, but worth a try. Report your results, please.
Scanning for available cellular networks is broken.
Extremely high load average (sometimes, seem to be caused by installed applications)
Development related links:
Kernel source: https://github.com/kibuuka/dsc-team-kernel-project/tree/ics - fork of DSC Phoenix kernel that's being used in this ROM. ics branch will be pulled back to main DSC kernel project source tree after n0p's return from vacation.
Device overlay based on hPa's code, changed to build against AOSP source tree instead of CM9's.
Download links: ROM itself - Updated Jul. 14th 13:53MST (changes: see post #2)
Alternative build - OBSOLETE Updated Jun. 28th 05:16MST. Temoporary solution for webkit rendering glitches.
gapps: update-Gapps-ICS-20710.zip See TheManii's post for details Mirror
root: Superuser.zip recommended way to gain a root on this ROM (By TheManii) Mirror
Screenshots: posted earlier in General forum *click*
Installation precautions: Usual ones. ROM is pre-alpha, so nandroid backup is your natural choice in this case . Factory reset from recovery menu is suggested (dalvik cache deletion is optional but recommended for first boot - caches will be rebuilt anyway).
Updating from previous builds of this ROM:
Flash new version
Flash gapps
Flash Superuser.zip (if applicable)
Last words: Feel free to provide additional details and feedback as you test it out. This project is amied to provide a stable base for future streak development. Once we have stable AOSP with full hw support - we have nice shortcut for porting anything that's not AOSP.
P.S. OP is not really experienced in ROM hacking and modding - all tips related to optimisation are greatly welcomed - for everyone's benefit
Reseved
Changelog (New records are displayed first):
Jul. 14 (built and uploaded for internal testing Jul. 13)
kernel: hPa's "force speaker on" patch.
system: Multiple internal changes in camera-related stuff (just for ther record. camera is still unfunctional)
build.prop: mobiledata.interfaces=ppp0. ro.telephony.ril.v3=datacall,signalstrength,facilitylock,icccardstatus,skipbrokendatacall
Jul. 11
kernel: reverted io scheduler back to cfq.
kernel: default cpu governor: smartass2.
kernel: screen rotation patch from updated Phoenix branch. Credits to hPa and n0p. hw.sw.rotation=180 is obsolete now.
system: *finally* there's working (for OP, please do extensive testing and report back) usb mass storage. Cm9's vold and LegacyUsbSupport (along with messing with rest of source) did a trick.
system: removed BasicSmsReceiver.apk from being built and installed. Double sms notifications should be gone.
Jul. 02
kernel: enabled iptables support (needed for mobile quota setting).
kernel: new cpu governors added. feel free to play with them and share your experience.
kernel: added new io schedulers. new default is sio (matter of change).
system: mobile quota setup is functional as of now.
system: built with BOARD_AAPT_PREF_CONFIG := hdpi mdpi. 160dpi users - please check if dialer problem is still present.
interface: added two previously unincluded LWPs.
Jun. 30
Resolved FCs in kgsl shown in 0630 posted earlier. Please re-download. Filename should read as dell_streak-ota-eng.den.063012-2.zip
kernel - Added support for quota2. Mobile data limits will work in next release (still need to figure if iptables binary is needed for this to function)
OpenGL-disabled build is put on hold and won't be updated since we have figured most of opengl-related problems now.
Fixed webkit rendering issues. (Gmail renders pages correctly but seem to "hide" message content on scroll. Anyone aware of gmail app bugtracker presence? Share a link, please UPDATE: not present at clean install. Please check if dalvik cache fleanup fixes it for you. If not - try factory reset) Please note browser is built with OpenGL rendering disabled by default for OP's testing purposes. This will be changed in next build.
Multimedia libs being built from sources now.
Working video in YouTube as result
Lots of Qualcomm-related patches in OpenGL-subsystem (selected parts of frameworks/base taken from mikegapinski's PolishBlood repo (Great job, Mike), lots of patches are from CAF, source was additionally patched (proper ro.sf.hwrotation=180 support, gradient fix, some more) to work correctly on DS5)
Removed some unfunctional components from being built. Factory reset recommended for full removal if updating from previous builds of this ROM.
Flipped thumbnails in recent apps issue - fixed. Re-enabling...
kernel: re-enabled per-process pages in kgsl (default setup).
kernel: default io governor set to ondemand.
Jun. 28
0627 rebuilt with new flags. no changes in code. hdpi resources are included and used by default.
added debug.egl.swapinterval=0 to build.prop
Added Superuser.apk (non-functional at the moment. Use Superuser.zip from TheManii's thread for now)
Jun. 27
Partial fix for mobile data. Searching for available networks known to fail. EDIT:SIM PIN request - still no love. Please test everything you can and report back.
Data usage logging is working now. Necessary patches applied to kernel source.
Surfaceflinger has dithering enabled by default. Smooth gradients ftw.
Added missing LWPs (requested by TheManii)
Added alternative build (it's being built with USE_OPENGL_RENDERER set to false). It has no webkit rendering bug at cost of lesser interface attractiveness.
Tethering options re-enabled. Check which are worked for you and report back, please.
Jun. 23
Disabled per-process page tables in KGSL driver (for now, matter of reversal on test results)
Surfaceflinger problem resolved. Interface is pretty smooth now
Enabled PF_KEY support in kernel (in resolution of pkoning's bug report)
Jun. 21
new kernel build - ipv6 is enabled - without this google services fail to operate properly
added missing apps (Messaging, Camera (broken) and several others) to build set
added some findings to build.prop, removed libGLES_android.so - overall interface performance is slightly improved, yet we're sure we're running with hwaccel now
Jun. 19
sound is partially working now (speaker and BT headsets. wired headsets/headphones not working yet)
if i not mistaken... there is ICS apps rip/port for messaging... i think i have seen that on market...
No screenshots?
john9 said:
No screenshots?
Click to expand...
Click to collapse
i believe OP already included it on the first post...
This is the Great Start !!!
john9 said:
No screenshots?
Click to expand...
Click to collapse
I think these are the screenshots
http://forum.xda-developers.com/showpost.php?p=27537842&postcount=46
What a great start!
I just tried it for a while. It feels awesome to have gotten this far. The ROM is quite laggy as the OP has already mentioned but I was able to get around. I was unable to make a call got an error about sim card not being there. I didn't have any 3G connectivity either. And didn't have any Wi-Fi to try since I am office right now. Since I did this in a hurry I forgot to factory reset but didn't get any FCs. I am upgrading from CM 7.2. None of the google apps seem to work besides youtube but all other apps started without any issues. Looks very good though it's almost like I can smell ICS now.
I have a spare Streak so am happy to reserve it for testing. Let me know if I can do anything specific.
I can confirm that wifi works.
I have tried setting up my Google account but get "Unfortunately, Exchange Services has stopped"
Browser works after a fashion but is not usable.
I can dial outgoing call and the receiving phone rings but no sound. Likewise for incoming calls, my Streak rings but I can't hear the caller and the caller can't hear me.
I seem to have trouble setting up an APN.
Sorry if all of this is already known. I still can't believe that I am looking at Android 4.04 on my Streak.
omg!
I am so looking forward to this!
Mega-Kudos to everyone involved!
yes, this is a good start for DS5 android 4.0 .
good start!
waiting for your further work,
thanks a lot.
I use this mms.apk (from Evervolv ICS rom), push it to system app and change permission. Sms can send and receive (but it take about 1 minute to send sms). http://db.tt/DTuQO5sS
Maybe this could help, could you check this build prop patch made by @lithid and @the_plattypus to fix the red box screen.
http://db.tt/zAJ04F8a
The build prop is for evo4g sense 4.0 rom.
The camera libs by @rapmv78
http://db.tt/CiZxdJT2
How I wish I have my streak with me.
Sent from my MT27i using xda premium
nom051205 said:
I use this mms.apk (from Evervolv ICS rom), push it to system app and change permission. Sms can send and receive (but it take about 1 minute to send sms). http://db.tt/DTuQO5sS
Maybe this could help, could you check this build prop patch made by @lithid and @the_plattypus to fix the red box screen.
http://db.tt/zAJ04F8a
The build prop is for evo4g sense 4.0 rom.
The camera libs by @rapmv78
http://db.tt/CiZxdJT2
Click to expand...
Click to collapse
Yep, will look further, thanks a lot. Right now i'm trying to figure what causes gralloc to get this mad (almost sure that buffer status errors are the main reason of phone sluggishness).
Oh and btw, could you please post logcat taken while sending sms?
Oh! Yes, Yes, Yes ... =P
Will flash it wright-a-way and give some feedback
Great news ! "You've made my dreams come true" =D
Hope it'll be great and powerfull change for our DS5's =]
---
Ok, so: - WiFi - worsk
My menu LEDs are always on, even after screen time out.
Camera (from lock screen) makes device reset. [there is no camera app i think]
Can't Add any APNs
Sound want work at all
Can make incoming/outgoing call (but with no sound in my earphone/mic)
Web browser cant display pages correcly
Screen brightness want work
Gallery(phonee) want access my SD
Phone correctly downloaded time data from operator.
I would offer every possible assistance in developing the project =P
Great JOB! ...going back to DSC1.1 - ...till now.
kibuuka said:
Yep, will look further, thanks a lot. Right now i'm trying to figure what causes gralloc to get this mad (almost sure that buffer status errors are the main reason of phone sluggishness).
Oh and btw, could you please post logcat taken while sending sms?
Click to expand...
Click to collapse
Kibuuka would you take a look at CM9 for Acer Liquid?
It is almost same as DS 5.
Maybe you can use the necessary libs from that ROM to solve the issues.
Sms send and received work perfect now (maybe last time hv bad network), opera mobile browser work perfect, superuser not work well, can use root explorer but cannot use other root apps.
This is really a good start, I believe we will hv stable version soon.
Sent from my PC36100 using Tapatalk 2
I am getting some offset errors during install, tried some times downloading but still same
Sent from my Dell Streak using Tapatalk
abauer said:
I am getting some offset errors during install, tried some times downloading but still same
Sent from my Dell Streak using Tapatalk
Click to expand...
Click to collapse
These messages are not error ones. Please read this.
Sound output is working now (tested with internal speaker and BT headphones. Wired will be tested tomorrow, don't any of these around at the moment ) EDIT:New download link is live now.

[App Request] Gyroscope Emulator/Virtual Gyroscope

I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Hi, I'm also looking for some app that fakes gyro sensor as I have the same problem. In theory a dev could interpret those algorithms from that Github repo and make an emulator, unfortunately this is out of my knowledge.
So I hope someone could help us poor ungyroscoped people.
Yeah, it's big problem with most phones to use VR apps/games that require gyroscope. I have the same problem.
Google should think about gyro pseudo emulation with accelerometers in their Cardboard API or at least implement there something like this lib: https://code.google.com/p/openintents/wiki/SensorSimulator
so anyone could use different phone (with gyro) as remote gyro for phone in cardboard glasses or write gyro emulators much more easily (as this lib can open TCP port for remote sensors data).
Technically, yes, it should be possible, using Xposed.
I am working on a module that eliminate the jitter in unreliable phone's gyroscopes. It does so by hooking to the function that distpaches the various sensors' data to every apps that require them, and it fakes the values before these data get sent.
Since you can easily access any sensor's data, you can do any sensor fusion you want by using the accelerometer and magnetometer, or even just the touch screen, and then fake the gyroscope's values.
If you are interested, here is the Xposed module I'm working on, which shows how to hook to the gyroscope and fake the values:
On github: lrq3000/JitteryGyroFixForCardboard
And to implement sensor fusion, you can either use the new virtual sensors of Android 4, or code it yourself, there's a very good open source app that shows it all here:
On github: KEOpenSource/GyroscopeExplorer
Hey thank you for that info! I'll be taking a look at that as soon as I can, although I'm not an avid dev I hope we can get something for our phones.
shafiaszad said:
I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Click to expand...
Click to collapse
Yes, same problem here. The facts, med-low or med or med-high device not attached by gyro, except xiaomi. Some people on quorra debated, they have idea to make an app which can do headtracking with camera by detecting pixel shift. Yes i like that idea and the idea sounds possible, but it out of my knowledge. Can anyone make app like that? Or maybe we can ask google to make the app?
Thanks
What about emulating gyro using accelerometer and compass? In the Google Play is app for phones without gyroscope, (we are in space: LINK) so it is possible
I would love to see something like this too. This dev has several VR apps and the head tracking all works perfectly on my Moto G 3rd gen which has no Gyro, so I know it is possible. I've played House of Terror and the head tracking works extremely well and pretty smooth too, I wonder what their method is, I assume compass + accelerometer. https://play.google.com/store/apps/developer?id=Lakento
shafiaszad said:
I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Click to expand...
Click to collapse
Same problem. I also have a k3 note and it has a virtual gyro. i think there must be something that uses accelateometer and magnetometer to detect direction and angle.(and i think this is possible)
Guys try vr player from play store then goto settings and there would be orientation detector set it to accelerometer +compass and you are donw
Same Problem
lrq3000 said:
Technically, yes, it should be possible, using Xposed.
I am working on a module that eliminate the jitter in unreliable phone's gyroscopes. It does so by hooking to the function that distpaches the various sensors' data to every apps that require them, and it fakes the values before these data get sent.
Since you can easily access any sensor's data, you can do any sensor fusion you want by using the accelerometer and magnetometer, or even just the touch screen, and then fake the gyroscope's values.
If you are interested, here is the Xposed module I'm working on, which shows how to hook to the gyroscope and fake the values:
On github: lrq3000/JitteryGyroFixForCardboard
And to implement sensor fusion, you can either use the new virtual sensors of Android 4, or code it yourself, there's a very good open source app that shows it all here:
On github: KEOpenSource/GyroscopeExplorer
Click to expand...
Click to collapse
I bought a vr case and have the same problem my galaxy sm a510m (A5 2016) doesnt have gyro! When i saw that i couldnt believe it.... it opens with my fingerprint for the love of crist!!! :crying:
Any solutions?
I have a moto g 3 and can't experience Pokemon go neither vr visor from one plus
Sent from my MotoG3 using XDA-Developers mobile app
Is there still hope?
If there is no way (for whatever reason) to emulate a gyro...is there a method to add a gyroscope sensor to an android?
Sent from a Samsung Galaxy J7 user
Same here, i too need an APP that simulate the gyro functions.
Hope that someone could implement that using compass and accelerometer!
Thanks
Some app like this would be so cool...
I was a bit dissapointed after buying the Moto X Play and noticing it doesn't have gyroscope so no Augmented Reality on Pokemon GO.
Im so sad, i had a moto g2 and bought motog3 1 month ago, this thing doesnt have a gyroscope while motog2 had one. Is there no solution for this? I mean, with something like a virtual gyroscope
pokulan said:
What about emulating gyro using accelerometer and compass? In the Google Play is app for phones without gyroscope, (we are in space: LINK) so it is possible
Click to expand...
Click to collapse
I've tested with my Moto G 3rd and works well. I hope somebody develop some hook in Xposed to work with accelerometer and compass...
or lests just hope the pokemon go app support accelerometer + compass it in the future.
I feel where you all are coming from. I agree there needs to be an app, an xposed module, or something to get this functionality. I'm gonna try and figure this out, there's a post on stackoverflow about this. A guy was talking about how in order to do it you'd need to recreate files similar to the ones that poll the actual hardware. He's basically saying you need to create some sort of mock gyroscope polling code right above the hardware level. I don't think that's the best approach, we gotta go top down not bottom up on this. I don't know much about the inner workings of android but I know this, looking at how to grab sensor data just using a plain app uses the classes sensor and sensor manager. As far as i can tell these are fed with information by the sensor event listener. That is fed by the object sensor event. It states right on the documentation "This class represents a Sensor event and holds information such as the sensor's type, the time-stamp, accuracy and of course the sensor's data." Its a generic sensor class which means we could possibly give it a fake gyroscope right?
Now, back to the sensor event listener, on the documentation it says "The application doesn't own the event object passed as a parameter and therefore cannot hold on to it. The object may be part of an internal pool and may be reused by the framework.". That means sensor event listener is literally just the messenger and should take whatever it finds as long as its valid. It seems like it will take whatever is passed to it correctly if we can make an event that it hears.
Now, amazingly on the sensor event page shows some fantastic stuff. Sensor event class is literally a 4 field class and I believe gets its values from that "hardware polling code" that sits above the hardware level. (the code that other guy was talking about.). If we can just make up some sensor events that mimic a gyroscope using accelerometer + compass and hope that the sensor event listener is configured to pick it up (I don't see why not) then I think this could be a possible solution. With all that being said, I'm just a beginner when it comes to android. I'm a college kid with a background in c and java just trying to piece the puzzle pieces together and play some pokemon lol.
Edit: So I may have been way off the mark, I'm not sure anymore. I found this though, a way to use actual custom sensors with android http : // riansanderson.blogspot . com/2012/03/integrating-sensors-into-android . html . Sorry for the spaces, I can't post links. After more java delving it seems it is not possible to create your own spoofed sensor or sensor event if your code is not in the same package as android.hardware.Sensor or SensorEvent
Edit2: So I guess unless you can get code to run in that android.hardware package, you'd have to do something like that link above and make like a fake driver for fake hardware.. I suppose if you could modify android.hardware.sensor to just make a gyroscope sensor and take the values from the accelerometer and modify those on the fly.
Try this solution
hello all from Egypt
this tutorial isn't mine or my invention you can say it's information sharing
I am Waleed and i have Huawei honor 4x which has no gyroscope at all, but i found some solution to this problem which is:
1- you must have ROOT (without root you can't do anything at all)
2- install root explorer if it isn't installed in your mobile and be sure to allow root permission to it
3- download the attached xml file which activate soft gyroscope in your mobile and place this file in your SD card
4- open root explorer and copy the xml file you downloaded and go to this path "/system/etc/permissions" and paste the file there and be sure the file exists in this place
5- reboot the phone then install any app from Google play to check the gyroscope i suggest sensor box
6- I hope this information is valuable and useful for you
thanks

[XPOSED][MOD][LP+] Sensible Android Auto:Xposed

Simple module to make Android Auto less restrictive. History on this module can be found here and an article about the in-motion tap limits here. This module should remove the "speed bump" notification (Browsing locked for safety) and allow you to scroll through lists (playlists, song lists, etc) without hindrance.
There's also a reddit thread/request which has more specifics about what this module is trying to accomplish.
Features:
Should work for all aftermarket AA-capable headunits (might require a hard-wired bypass module depending on model)
Should also work for most OEM AA headunits that are built into newer vehicles
Should also work for standalone AA running on a phone and not connected to a headunit
Here comes the really large and obnoxious disclaimer.......
This module can alter the built-in safety features that Google has implemented in Android Auto. By downloading and installing, you agree that YOU, and only YOU, are solely responsible for any negative repercussions that may result. This can include injury to yourself and/or others, property damage, or loss of life. Under no circumstances is the author of this module responsible for its use!
...not that a simple disclaimer on a forum post would go far if anything were to happen, but I felt the need to put it out there. Please use YOUR best judgement when it comes to operating a vehicle and futzing with your Android Auto headunit.
Development and testing was done on a Nexus 5x running Android Auto v1.6.240040 (2719917-release) and a Pioneer AVH-4200NEX w/ micro bypass. This should work on any Lollipop and newer rom, assuming Android Auto works on it.
Downloads
See attached files on this post.
You can also grab it from the Xposed Repo
XDA:DevDB Information
Sensible Android Auto:Xposed , Xposed for all devices (see above for details)
Contributors
agentdr8
Source Code: Gitlab
Xposed Package Name: com.dr8.xposed.saax
Version Information
Status: Stable
Current Stable Version: 6.3.611314
Stable Release Date: 2021-04-12
Created 2016-06-04
Last Updated 2021-04-12
Reserved
In case it isn't already clear, this APK is a module designed to be used with the Xposed Framework. It will do absolutely nothing on its own.
Changelog
v6.3.611314 - Updated for Android Auto 6.3.611314
v6.1.610544 - Updated for Android Auto 6.1.610544
v5.8.604354 - Updated for Android Auto 5.8.604354
v5.7.603964 - Updated for Android Auto 5.7.603964
v5.7.603954 - Updated for Android Auto 5.7.603954
v5.6.603444 - Updated for Android Auto 5.6.603444
v5.6.603434 - Updated for Android Auto 5.6.603434
v5.5.602944 - Updated for Android Auto 5.5.602944
v5.5.602934 - Updated for Android Auto 5.5.602934
v5.4.502264 - Updated for Android Auto 5.4.502264
v5.3.501644 - Updated for Android Auto 5.3.501644
v5.3.501634a - Updated for Android Auto 5.3.501634 (fixed negative value)
v5.2.501054 - Updated for Android Auto 5.2.501054
v5.1.500644 - Updated for Android Auto 5.1.500644
v5.0.500214 - Updated for Android Auto 5.0.500214
v4.9.594934 - Updated for Android Auto 4.9.594934
v4.8.594324 - Updated for Android Auto 4.8.594324
v4.7.593824 - Updated for Android Auto 4.7.593824
v4.7.593814 - Updated for Android Auto 4.7.593814
v4.6.593334 - Updated for Android Auto 4.6.593334
v4.6.593324 - Updated for Android Auto 4.6.593324 and 4.6.59xxxx (for 32-bit)
v4.5.592854 - Updated for Android Auto 4.5.592854 and 4.5.592xxx (for 32-bit)
v4.4.592344 - Updated for Android Auto 4.4.592343 and 4.4.592344
v4.3.591854 - Updated for Android Auto 4.3.591843 and 4.3.591854
v4.2.591444 - Updated for Android Auto 4.2.591444 - Versioning has now been changed to mimic the AA versions so that it is clear which version of SAAX works with which version of AA
v1.9.3.2 - Updated for Android Auto 4.2.591xxx
v1.9.2 - Updated for Android Auto 4.2.591xxx
v1.9.1 - Updated for Android Auto 4.1.590xxx
v1.9.0 - Updated for Android Auto 4.0.590xxx
v1.8.9 - Updated for Android Auto 3.9.585xxx
v1.8.8 - Updated for Android Auto 3.8.584xxx
v1.8.7 - Updated for Android Auto 3.7.584xxx
v1.8.6 - Cleaned up debug logging and bumped version
v1.8.5c - With @xs1337's help, added overrides to CarSensorEvent classes which should help those with OEM headunits
v1.8.5a - Fixed typo in method name which was throwing exceptions
v1.8.4 - Updated for Android Auto 3.6.583xxx
v1.8.3 - Updated for Android Auto 3.5.583xxx
v1.8.2 - Added another overridden method to try and bypass warnings, cleaned up comments
v1.8.1 - Added more overridden methods to try and bypass warnings
v1.8.0 - Updated for Android Auto 3.4.582xxx
v1.7.8 - Updated for Android Auto 2.9.574xxx -- missed a method name change
v1.7.7 - Updated for Android Auto 2.9.574xxx
v1.7.6 - Updated for Android Auto 2.8.57451x
v1.7.5a - Missed a method name change
v1.7.5 - Updated for Android Auto 2.7.57395x
v1.7.4 - Updated for Android Auto 2.6.57340x -- added additional options to hopefully override vehicle sensors
v1.7.3 - Updated for Android Auto 2.5.72860x
v1.7.2 - Updated for Android Auto 2.4.72280x
v1.7.1 - Add additional parameter override to get rid of "Paused for your safety" messages
v1.7 - Updated to support the latest Android Auto (2.3.716603-release)
v1.6 - Updated to support the latest Android Auto (2.2.710803-release)
v1.4a - Updated to support latest Android Auto (2.0.642303-release)
v1.3 - Added preference for how many pages are shown in list views
v1.2 - Unreleased, but work done to address built-in vehicle sensors
v1.1 - Updated method hook to include an additional setting, and properly calculate meters/sec from MPH. Also fix initial TypeError crash upon first launch
v1.0 - Initial release
What does this mod do?
"Make Android Auto less restrictive" is very vague, and the history thread is disorganized. Can you add a feature list?
Livingod said:
What does this mod do?
"Make Android Auto less restrictive" is very vague, and the history thread is disorganized. Can you add a feature list?
Click to expand...
Click to collapse
Sorry about that. I've added a few lines about what it does to the OP.
Hi great work so far! Where can I download it?
ahaan said:
Hi great work so far! Where can I download it?
Click to expand...
Click to collapse
In Xposed [emoji12]
☆☆☆ ☆☆☆
amazing, exactly what I have been looking for.
Installed on a Sprint Galaxy S5 with blisspop rom. Will give it a run tomorrow and report back. I just set the number of taps to 999.
ahaan said:
Hi great work so far! Where can I download it?
Click to expand...
Click to collapse
That's odd. When I edit the first post, I can see that the APK is attached. But it isn't showing up. It's probably something to do with the DevDB project.
I've added it to the Downloads tab up top though. And I'll put the xposed repo link on the OP.
Works great! thank you for this. This is highly needed and worked with out a hitch for me on a quick test of spotify (was on a quick drive and was unable to test everything)
agentdr8 said:
That's odd. When I edit the first post, I can see that the APK is attached. But it isn't showing up. It's probably something to do with the DevDB project.
I've added it to the Downloads tab up top though. And I'll put the xposed repo link on the OP.
Click to expand...
Click to collapse
Looks great now, downloaded and tested successfully with the Head unit hack using self mode! Great experience
update on my test, works great on my Sprint Galaxy S5 with blisspop 6.0 rom with the pioneer 4100nex. The first time I tried, AA seemed to have froze when I tapped Spotify, removed the usb and replugged it back in, but the module didnt seem to work, it only allowed 6 taps. On my 2nd drive, it worked great scrolling through my entire playlist when I was in movement
Thank you!! Works great on my Droid Turbo with CM13, Pioneer 4200 NEX.
First time I started AA it froze and crashed with "cannot connect to AA at the moment, when safe please disconnect and check your phone." All I did was disconnect and plug it back in, and it's been great ever since.
ranova said:
The first time I tried, AA seemed to have froze when I tapped Spotify, removed the usb and replugged it back in
Click to expand...
Click to collapse
Jeffy! said:
First time I started AA it froze and crashed with "cannot connect to AA at the moment, when safe please disconnect and check your phone." All I did was disconnect and plug it back in, and it's been great ever since.
Click to expand...
Click to collapse
Interesting. If it continues to happen, please enable debug in the settings and provide the Xposed Installer logs + logcat so I can account for this behavior.
agentdr8 said:
Interesting. If it continues to happen, please enable debug in the settings and provide the Xposed Installer logs + logcat so I can account for this behavior.
Click to expand...
Click to collapse
I've used it about 10 times since then, running errands and whatnot. It's been working perfectly for me, no glitches!
agentdr8 said:
Interesting. If it continues to happen, please enable debug in the settings and provide the Xposed Installer logs + logcat so I can account for this behavior.
Click to expand...
Click to collapse
Jeffy! said:
I've used it about 10 times since then, running errands and whatnot. It's been working perfectly for me, no glitches!
Click to expand...
Click to collapse
yup, only happened to me the first time after installing the module. Its been working ever since. Thanks again!
This is fantastic! Great job. Let's hope you will be able to add more features in the future or that other developers will join you. I love Android Auto but the current restrictions (on which apps can be used for example) are just plain stupid. I understand that there are people who would abuse Android Auto to type entire messages while driving if it was possible but that is not the responsibility of Google. At least, it wouldn't be the responsibility of Google in Europe. It's a totally different story in the US of course
Updated the module today. I figured out that the values for "unlimited browsing speed" and "max speed parking card" were in meters per second (float), so the default of 0.5F is roughly 1.1 MPH. I've made an adjustment so the preference slider accurately represents MPH at which it will no longer allow for unlimited browsing.
Of course if you have the tap limit set to max, then it won't matter. But a sensible tap limit, combined with a sensible max unlimited browsing speed is now achievable.
I also addressed the crash at initial launch.
Hi agentdr8,
Great Module! Congratulations!
One suggestion: Please, can you add the option of "Execute action in the CAR screen"? The idea is: add one entry in this "unused" menu for trigger a Broadcast Intent; this intent then will be captured and processed by another App (like Tasker, AutomateIt, Llama, etc.)
Here some guide about "Broadcast Intent": http://inchoo.net/dev-talk/android-development/broadcast-receiver-from-activity/
For the "Car Screen" see: http://arstechnica.com/cars/2015/07...icle-diagnostic-app-expanded-car-integration/
I hope you agree! :fingers-crossed:
manos78 said:
Hi agentdr8,
Great Module! Congratulations!
One suggestion: Please, can you add the option of "Execute action in the CAR screen"? The idea is: add one entry in this "unused" menu for trigger a Broadcast Intent; this intent then will be captured and processed by another App (like Tasker, AutomateIt, Llama, etc.)
Here some guide about "Broadcast Intent": http://inchoo.net/dev-talk/android-development/broadcast-receiver-from-activity/
For the "Car Screen" see: http://arstechnica.com/cars/2015/07...icle-diagnostic-app-expanded-car-integration/
I hope you agree! :fingers-crossed:
Click to expand...
Click to collapse
I'll see what can be done about adding some things to that screen. I'm not positive, but I believe most apps won't be able to display any activities on that screen unless they have specific Android Auto layouts. But firing off a configurable intent should be possible.
Stay tuned....
EDIT: Upon further investigation, it seems that this isn't doable right now. Those entries under the "Car" screen are services that have to be defined in the manifest. AFAIK, you can't inject service entries (and their associated metadata tags) into an app via Xposed. I think at some point, Google may open up that restriction for OEMs, and allow them to just apply a specific xml description tag to indicate that a particular app can be shown/used in that screen.
I can try and see if I can hook the layout inflation of those entries, and modify their titles there. I can also try and override what they currently launch (right now, just demo screens).
agentdr8 said:
EDIT: Upon further investigation, it seems that this isn't doable right now. Those entries under the "Car" screen are services that have to be defined in the manifest. AFAIK, you can't inject service entries (and their associated metadata tags) into an app via Xposed. I think at some point, Google may open up that restriction for OEMs, and allow them to just apply a specific xml description tag to indicate that a particular app can be shown/used in that screen.
I can try and see if I can hook the layout inflation of those entries, and modify their titles there. I can also try and override what they currently launch (right now, just demo screens).
Click to expand...
Click to collapse
Hi agentdr8,
Thank you for your efforts! Good work! :good:
In reference to the limitations: Then I suggest to just hook the button for selecting the CAR screen. I feel this can be possible, and we use this event to trigger some intent. Please, think that sending one intent is by far more simple that printing on the screen. So, perhaps the first goal can be hook the AA UI for sending events to other Apps. You agree?

Help changing the maximum sample rate for an accelerometer in the kernel.

Just as a warning, I have very little idea about what I am doing, so keep that in mind
Basically, I am trying to increase the sample rate of an accelerometer, and figured the best way to do this was to create a custom kernel.
To give specifics: I am doing this on a Moto 360 v1, however, I'm not sure how important this is, as I'm sure the general solution will be pretty translatable.
The githhub repo for my kernel source is here: Mrcl1450/android_kernel_motorola_minnow
Any help to go about doing this is greatly appreciated.
Hey,
I've spent the last three weeks writing sensor drivers, and Sensor HAL for an OEM, so I'll try to provide some insight into how the sensor framework works, and what the sensor frequency is limited by.
First of all, there's three components to the sensor system.
1) The sensor itself
2) The Linux kernel
3) The Sensor HAL
Only point 1 and 2 affects the limits of the sensor frequency, and Android is informed about the limit via the Sensor HAL. If you run:
Code:
adb shell dumpsys sensorservice
You'll see what the current limits of the sensors are. You'll also get information about what type of sensors is on the watch.
Sensor - MPU6051
Now, since I don't have the device, I took a check at iFixit and according to the teardown ( https://www.ifixit.com/Teardown/Motorola+Moto+360+Teardown/28891 ) the Moto 360 v1 uses a MPU6051. You're in luck, since it's the MPU6500 I've been writing drivers for all week. So I know a thing or two about this chip series
Now we know the chip (MPU6051). The 6051 is PROBABLY just a 6050, but with a partly customized Digital Motion Processor binary for step detection (pedometer). So we check the datasheet for the 6050 (since 6051 isn't public): https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf
Since it's a MPU chip, you also need the register map: https://www.researchgate.net/file.P...2ca&assetKey=AS:[email protected]
According to section 6.2 (Accelerometer Specifications) the output datarate is 1000Hz, and the low pass filtered output datarate is 260Hz. So, that is your limit. No matter what...you won't get higher than 1000Hz. So, now we know limit #1 (1000Hz).
Kernel
Then the next is the kernel. The kernel will ask the MPU for data at programmable intervals. E.g. every 10ms. This is limited AND controlled by the CONFIG_HZ parameter. My guess is that your kernel will run at CONFIG_HZ=128 (since it's an OMAP device). If you're polling one piece of data, every kernel scheduled tick, then that's 128Hz of data. So, that is your kernel limit....except....
The MPU series has an on-board FIFO, so it can store results for you. This 1024 byte FIFO can store up to 170 results (Section 4.18 in the register map states that one accelerometer measurement uses 6 registers => 6 bytes), and with this you can unlock the full 1000Hz of data.
But Blystad....what do I do with all this information?
Right....
1) find the current limits (dumpsys sensorservice)
2) ensure that you can build a version of the 6050 HAL for your device
3) start some accelerometer test, and find the current frequency limit of your accelerometer.
4) Try to increase the minDelay in the Sensor HAL (this results in a higher max frequency reported to Android)
Also, be aware, I only have experience with normal Android OS, not Android Wear, so I don't know if Google introduced any limits on Android Wears sensors.
blystad said:
Hey,
I've spent the last three weeks writing sensor drivers, and Sensor HAL for an OEM, so I'll try to provide some insight into how the sensor framework works, and what the sensor frequency is limited by.
...
.
Click to expand...
Click to collapse
Awesome, thanks man, I just skimmed through this and it seems extremely helpful!
I'll try working on this ASAP!
kevinnout said:
Awesome, thanks man, I just skimmed through this and it seems extremely helpful!
I'll try working on this ASAP!
Click to expand...
Click to collapse
Hi, kevinnout,
I am currently working on moto 360 2nd gen kernel - and getting stuck :'( , I'm curious to know if you've successfully created a kernel for overclocking the accelerometer. I'm very happy if you can tell me what to do if you have done that.

[ROM] AOSP for idol3 & idol347 with (close-to) mainline kernel

Alpha release of modern Linux kernel and AOSP Android, with easy addition of other msm8916 & msm8939 devices !
Special thanks to Stephan for all the work and help with kernel support, Caleb for the AOSPM setup and Roman for GloDroid and modem support.
Support for calls, SMS, GPU, touchscreen, sound, Wi-Fi, Bluetooth, charger, root (su command available).
Disable SIM PIN code before using it with those builds.
Not supported :
because lack of kernel support :
cameras : some variants may have imx214 sensor, which would be the easiest to get going.
Other sensors need a mainline driver, and probably painful reverse-engineering.
Also need a camera HAL (a minimal one could work to support torch LED)
low-power / suspend : need work on cpuidle and AVS/CPR
high-performance : need work on cpufreq, interconnects
video encode/decode accel : should work on idol347, needs to be extended and enabled on idol3
because lack of HAL :
mobile data : WIP
GPS : need a HAL, maybe https://github.com/zxcwhale/android9_gnss_hal_driver
or develop support through ModemManager
Known problems :
Audio : only speaker output, no earpiece mode : to be investigated
LED indicator not used by the system for notifications or charging status
graphical glitches, like some widgets are highlighted when they shouldn't be
sometimes doesn't boot correctly, reboot/shutdown and retry...
« There's an internal problem with your device » message is expected
due to unusual kernel version and of no real consequence.
It's unclear why it didn't happen with first build. Will see about removing it...
Prerequisites :
Backup your device, make sure you can restore it
Flash lk2nd 0.14.0+ (get lk2nd-msm8916.img) to the boot partition
if you already have lk2nd installed, update it with fastboot flash lk2nd lk2nd-msm8916.img
otherwise, use https://github.com/bkerler/edl (already has programmers), or emmcdl, or Alcatel Flasher
Install :
device off, go to lk2nd menu by pressing Power + Volume down buttons
fastboot flash boot boot.img
fastboot flash cache vendor.img
fastboot flash userdata userdata.img
fastboot flash system system.img
select START using Vol+ or Vol- buttons if needed, then press Power
Downloads : see the latest release post
Kernel source : https://github.com/vknecht/msm8916-mainline-linux/tree/aosp/v6.2-msm8916
Devicetree : https://github.com/vknecht/android_device_generic_msm8916
Local manifest : https://github.com/vknecht/aospm-android_local_manifests/blob/msm8916/aospm.xml
That's great. A bit disappointed that modem (call, sms...) doesn't work on android though :/
Nice job! I tested it and a small issue is write speed to internal storage is slow (<1MB/s). It might be that the forced encryption is enabled in the ROM and the old Snapdragon 615 processor is unable to handle the encryption fast enough. The encryption also disables the existing TWRP builds from accessing internal storage, so it's preferred to have the device unencrypted.
- Tested again and it's probably an issue with my router when I copied APKs from my NAS using Mixplorer. The internal copy-paste is fast enough.
Some other issues:
- Moonlight streaming software doesn't work because there's no hardware video codec.
- No night light / blue light filter
- No accelerometer, cannot auto-rotate
Hopefully some of them are easy to fix and it can become much better than Android 7.1!
Hey fantastic work!
The first few boots were a bit messy, but I think it was just some initial startup issues - it caused some flickering, there was some spotty Wifi issues (had to "forget" and reconnect). After a few more boots it got progressively more stable.
WiFi, bluetooth, 2D acceleration, and battery all seem to be working great! Haven't tested data and calls, as no sim.
I tried playing some videos via VLC, the Video was smooth but the audio was pretty choppy. The native video player was much better with both video and audio, so I think HW acceleration is working(?)
Some issues in getting it to wake up from sleep, and when I accidentally invoked the camera, I got a blue screen that was hard to get out of.
Hitting the power button twice or holding the power button and then hitting it twice seems to be the main way to get back to the home screen and restore the display.
I tried to get the camera to work, and eventually installed LibreCamera (the only camera app that didn't say it was incompatible with the device), but nope there is no camera to use.
Thank you for the feedback, I edited OP with some details about what needs to be done to fix some items.
Will have to look into AOSP settings if there's support for night/blue light support.
Also will have to check again to add eg. Orange Fox recovery...
What about Honor 5X?is have msm8939 too.
vknecht said:
Not supported :
Click to expand...
Click to collapse
Thank you for your work. Is there going to be a beta release without restrictions?
I haven't tried it yet, will this fit the 6045K?
banzeo said:
That's great. A bit disappointed that modem (call, sms...) doesn't work on android though :/
Click to expand...
Click to collapse
Rejoyce, for GloDroid's mm-radio HAL works for simple SMS and calls
Still a bit buggy but it's being worked on. No support for mobile data yet, tho...
satelliteseeker said:
- Moonlight streaming software doesn't work because there's no hardware video codec.
- No night light / blue light filter
- No accelerometer, cannot auto-rotate
Click to expand...
Click to collapse
Guess you have an idol3, since it has no venus support ? idol347 has it, would be interesting to know if Moonlight works on it. Waiting on Linaro (the company mainlining msm8939 SoC) which has venus fixes...
Night light is there after enabling config_nightDisplayAvailable, so it will be in next build.
Sensors are working too thanks to iio-sensors-hal.
mtek89 said:
I tried playing some videos via VLC, the Video was smooth but the audio was pretty choppy. The native video player was much better with both video and audio, so I think HW acceleration is working(?)
[...]
I tried to get the camera to work, and eventually installed LibreCamera (the only camera app that didn't say it was incompatible with the device), but nope there is no camera to use.
Click to expand...
Click to collapse
Camera won't work until cam sensors and related subsystems are supported, which is not a short-term task...
Will see what can be done about video playing, but remember that not all apps use venus, and performance is crippled by the fact that, at the moment, CPUs are capped to 1 GHz on idol347 and iirc 800 MHz on idol3...
Boom_Hacker said:
What about Honor 5X?is have msm8939 too.
Click to expand...
Click to collapse
The kiwi DTB has been added to the prebuilt kernel so it should be easier to experiment.
Sound should be working by the time of next release (it's a bit special since modem is not working on this device).
Please continue your effort to get your panel working in postmarketOS, so it will be supported in this aosp build.
pasha.mcr said:
Thank you for your work. Is there going to be a beta release without restrictions?
I haven't tried it yet, will this fit the 6045K?
Click to expand...
Click to collapse
Sure, tho not all "restrictions" can be addressed, at least in the short term...
It fits on 6045K (I only have this variant), would be interesting to know if all space is available on 16 Gb variants.
Hopefully there will be a release by the end of the month, but would like to tackle the screen-off-then-on issue and this might take time...
Edit 2023-03-01 : please be patient, I'll take a week more or so to polish things a bit ; but things are coming nicely (have a fix for screen for example)
Alpha 2 release with display fix, basic sensors & basic modem support.
Also updated to Linux 6.2 and AOSP android-13.0.0_r35 branch (security patch March 5 2023).
Only basic SMS (no MMS, no emoticons, etc.) and calls (no mobile data yet).
SIM PIN must be disabled beforehand (ie. before using it with this build).
Some sensors are not reliable (ambient light, magnetometer/compass, ...).
But auto-rotate works and proximity sensor too, although not used by eg. Dialer app, not sure why...
Known problems :
[EDIT] Bluetooth service broken in this build, investigation in progress...
Audio : only speaker output, no earpiece mode : to be investigated
LED indicator not used by the system for notifications or charging status
graphical glitches, like some widgets are highlighted when they shouldn't be
sometimes doesn't boot correctly, reboot/shutdown and retry...
« There's an internal problem with your device » message is expected
due to unusual kernel version and of no real consequence.
It's unclear why it didn't happen with first build. Will see about removing it...
Downloads : (see first post for pre-requisites ; no clean update path supported)
aospm-idol347-6.2-android13_r35-20230319-1.zip
MD5 909243b939389e6b38c523eca5e18a4c
SHA256 60371e314a6481eef75a81e02947f31979002fe10766f3af1a05dfa615f164cd
aospm-idol3-6.2-android13_r35-20230319-1.zip
MD5 6950066b987c8eb993eff22e53d45897
SHA256 aac997a0a9dd0839397b674426e56b8185c29da0882032bab4f449479a8f2ba6
Special thanks to Roman for the work on GloDroid and mm-radio HAL !
Alpha 3 release with bluetooth fix.
Also updated to AOSP android-13.0.0_r41 branch (security patch April 5 2023).
Downloads : (see first post for pre-requisites ; no clean update path supported)
aospm-idol347-6.2-android13_r41-20230416-1.zip
MD5 52066524be01cb888f6e6b2376f37dc1
SHA256 eb90f9bb6eed4299ba6848667b55271a59a819eea4a5345e2141791ffc3b6f91
aospm-idol3-6.2-android13_r41-20230416-1.zip
MD5 a42fbb38f73d4eac830dcb63673342c6
SHA256 3bd1c3f7a091dab1363991b9e3824318e73b0be714c7e25afa770dc8bde8381b
vknecht said:
« There's an internal problem with your device » message is expected
due to unusual kernel version and of no real consequence.
It's unclear why it didn't happen with first build. Will see about removing it...
Click to expand...
Click to collapse
Some Android ndk init service is not start successful, cause start->stop->restart loop
most likely the camserver is the cause of error message. the workaround is disable camserver by starting up at init.rc

Categories

Resources