[WIP] Hotword detection with screen off - Android Software/Hacking General [Developers Only]

Hello everyone,
This is a work in progress thread meant to gather info about how to add hotword detection support while the screen is off and the processor is in deep sleep. Ideally, this will work just like the Pixel devices by Google, so you'll be able to get to the assistant by saying "Ok Google" without turning on your device.
Let's start off with the first big question: Is the hardware that's required to do this in our devices?
Well, not every device. I have only looked into Qualcomm SoCs, but this is also possible with some Exynos processors through S Voice.
Qualcomm first added support for Hotword detection with the Snapdragon 800. The only device prior to that processor that had support for Hotwords was the first gen Moto X, which had its own Custom chip separate from the processor. However, my research indicates that all devices after the Snapdragon 800's launch use the processor's DSP for this job.
You can view the announcement of this feature for the Snapdragon 800 at this link:
https://www.qualcomm.com/news/onq/2...akes-mobile-world-snapdragon-voice-activation
In the blog post, the feature is mentioned as Qualcomm Voice Activation. I also found out that this was eventually also backported to the Snapdragon 600. However, looking elsewhere online reveals that this has other names as well, as it is part of Qualcomm Fluent PRO and All-Ways Aware. There are marketing videos for both online, and they all work with the Hey Snapdragon hotword. However, it seems that all of these features are part of the Hexagon DSP on the actual SoC and that they are compatible with v5 and up. So that means that technically all processors in the 600, 700 (in the future) and 800 line should be able to do this.
As far as I'm aware, the only device that uses the Hey Snapdragon wakeup command is the OnePlus One, which has a Snapdragon 801. On its default firmware, CyanogenMod 11S, you could go into the device's settings and train the device by saying Hey Snapdragon three times. Then, you could select the activity that would run every time you said it.
Someone on XDA updated this feature for newer firmware versions and looking at the flashable zip files it has one application file, a modified mediaserver, a modified audio library for its processor and some lib files for voice detection. I haven't attempted to Port this feature for any other device, but I doubt that it would work, even on devices with the same SoC.
I have also looked at Qualcomm's forums and found this thread which has a reply with links that could probably help us out here:
https://developer.qualcomm.com/foru...timedia-optimization-hexagon-sdk/speech/28153
This is source code from the Google Pixel and AOSP which might be the solution to making this work. I am not familiar with C and AOSP's code, so if someone with more experience could check this out, that would be great!
Lastly, I want to mention that I have a couple of devices that could help with testing including my daily driver Xiaomi Mi 5 (Snapdragon 820), a now retired LG G2 (Snapdragon 800) and a Galaxy S7 Exynos which should be able to use S Voice for this but I have not tested it yet. My friend @David_#27 also has a Redmi Note 4X (Snapdragon 625) and I could probably also borrow a Redmi 4X (Snapdragon 435) if we ever need it for testing.
Hopefully we can get some more info on this topic from people that have looked into this more than I have. Please reply to this topic with any info you may have, any help is very much appreciated! Making this work eventually on our devices would be incredible!
Thank you

Bump!

@chrismin13, think this thread is dead...
No one is taking our consideration for real!?

In my opinion it is kind of creepy having the device listen to every sound around it at all times. Many, MANY, exploits were released in 2016 and 2017 specifically based around bugs in mediaserver, and audioserver.
You said this might entail using "...a modified mediaserver, a modified audio library for its processor and some lib files for voice detection..."
So I don't know if I'd even want to mess around with that until maybe even 8.1

Delgoth said:
In my opinion it is kind of creepy having the device listen to every sound around it at all times. Many, MANY, exploits were released in 2016 and 2017 specifically based around bugs in mediaserver, and audioserver.
You said this might entail using "...a modified mediaserver, a modified audio library for its processor and some lib files for voice detection..."
So I don't know if I'd even want to mess around with that until maybe even 8.1
Click to expand...
Click to collapse
True, there are significant security concerns. However, many other devices have also invaded our personal lives, with smart speakers especially becoming more popular lately. I agree, this is scary, but if I'm the one making the code for my device, then I'm more confident knowing what my device does. Also, this is more of an experiment rather than a long term solution. So it's up to you whether you want it or not. I'm willing to take the risk.

Related

Qualcomm TOQ: too weak to run Android Wear ROMs I guess...

So, a "number" of OEMs are using Qualcomm SOCs for their Android Wear devices.
So my guess would be that Qualcomm TOQ is a "reference platform" for Android Wear.
Perhaps there may be ROMs released.... or leaked given that OEMs surely have them already.
No source code for now....
I'm guessing the kernel will be the more or less usual Android variant of the Linux kernel, perhaps with fewer drivers/features. And it's ARM of course.
How similar to standard Android on the higher level ?
I'm still pretty new to smart-watches. I haven't looked at the preview SDK yet.
EDIT: Uses an STM micro, too weak I'd guess to run Android (Wear variant).
EDIT: Looking now, and wondering if the code will even be open sourced ? Google may want to have more control this time around. Google, and the HW OEMs, might even put in roadblocks to custom ROMs even if the source is open, including the usual device locking of course.
http://developer.android.com/wear/preview/start.html :
Caution: Do not install apps on the Android Wear emulator. The system does not support traditional Android apps and the result of running such apps is unpredictable.
Click to expand...
Click to collapse
LOL. Time to try some of my apps and see what happens.
EDIT2: My app UI works !, although the UI is very squished. Looks almost like normal Android (from the app/dev point of view, Launcher or whatever UI is very different). I'm sure a whole bunch of APIs don't work and some will never work.
hm they use their cpus, why not the displays?
mirasol displays seem to be the perfekt ones
http://www.qualcomm.com/mirasol/technology
I really doubt that the toq can run google wear. It is using a 200mhz non snapdragon soc.
yerand said:
I really doubt that the toq can run google wear. It is using a 200mhz non snapdragon soc.
Click to expand...
Click to collapse
Is there a teardown of it somewhere ?
I really think the android wear platform is going to be locked down. I even doubt google will allow oem customization beyond maybe some skinning. Wearables is too fragile of a market to allow the amount of freedom we have on android phones/tablets. So, that means it'll probably have specific hardware requirements and such that prevent it from running on devices that weren't intended to run it. Even if it were remotely possible it wouldn't work very well. Look at other porting projects like Windows phone to android devices and sense for non-htc devices.
I'm leaning towards Google treating "Android Wear" the same as "Android Phone/Tablet".
Google has never hesitated to be open with the "basic" code to run Nexus devices. Open source is good for them.
That's the low level stuff that they build upon and REALLY protect with closed source and licensing requirements: Google Play, GMail, etc.
It's in their interest for everybody to be build the compatible low level.
I don't think Google has committed on the matter publicly yet, funny.
mikereidis said:
Is there a teardown of it somewhere ?
Click to expand...
Click to collapse
I was looking up a part number after tearing down one and found theTech Insights report: http://www.techinsights.com/uploade...ts/Wearable-Wellness_Survey_Sample_Report.pdf
Fencesitter said:
I was looking up a part number after tearing down one and found theTech Insights report: http://www.techinsights.com/uploade...ts/Wearable-Wellness_Survey_Sample_Report.pdf
Click to expand...
Click to collapse
Thanks ! I thought there was only one teardown and it cost $1250 to see.
So, STMicroelectronics STM32F207IGH6 ARM Cortex-M3 32-Bit Microcontroller...
Not a Qualcomm SOC/CPU. And only 16 MB of RAM ???
I don't think this will ever run Wear.
I guess it's just an early prototype, of Mirasol among other things.
mikereidis said:
Thanks ! I thought there was only one teardown and it cost $1250 to see.
Click to expand...
Click to collapse
Which company was that?
Let me say for the purposes of CYA that I found the Tech Insights link merely by searching for the term "wcn2243 data sheet" Which is one on of the smaller chips on the Toq.
Fencesitter said:
Which company was that?
Let me say for the purposes of CYA that I found the Tech Insights link merely by searching for the term "wcn2243 data sheet" Which is one on of the smaller chips on the Toq.
Click to expand...
Click to collapse
Same company, more detailed report, including some die photos. Advertised for $1250 here: http://www.techinsights.com/reports...market-reports/Report-Profile/?ReportKey=9830
You linked to a legitimate sample report, linked from this page: http://www.techinsights.com/teardown.com/teardown-sample-reports/
I looked at the firmware for the 1st Sony smartwatch and could see several of the hardware components and some proprietary RTOS. Sony supposedly "opened" the watch, but it's just a toy OS last I looked. They weren't releasing anywhere near enough code to replicate stock.
Anyway, the TOQ parts list seems somewhat reasonably similar; there's probably just a few common designs out there. But things may be changing if the new watches will run an actual variant of Android; ARM based micro-controllers being replaced with I guess more powerful "SOCs", not that it's too easy to distinguish a SOC from a micro...
...Now I'm wondering what's in the Chromecast I just got, LOL... Google is going more deeply embedded now.

[Q] Is the Galaxy R I9103 still worth buying?

Do you guys think that the I9103 is still worth buying? This device caught my attention since it's one of the few that's supported by the "voodoo sound" application and at the same time is equipped with a tegra 2 chipset, but I'm kind of worried about the problems(Lag, unresponsive screen, reboots...) that seem to affect this particular model, were they all solved in the latest roms?
If you don't worry about not having NEON instruction support in the CPU (nowadays almost all devices support it), it's a good device to get. Unfortunately the lack of that support is a very big miss. There are apps that are built with NEON instructions and those don't work on the device. Google abandoned non-NEON devices support in 4.2.2 and few Google apps need tricking to get them working. Otherwise it's a very good device, stock rom is a bit laggy if not debloated, screen is only unresponsive if your fingers are wet and I've never encountered random reboots.
Sent from my OmniROM-powered LG Optimus 4X HD
@Adam77Root Thank you for your detailed reply! It's a real shame about the lack of neon support in the Tegra 2 devices. Could you tell me what kind of apps (Other than the Google now voice recognition and the Gesture keyboard that were mentioned here "https://plus.google.com/+CyanogenMod/posts/8wcuSVkr7zR") might not work on this device?

Has anyone bought generic unbranded smartphones available on ebay etc?

1) I'm hoping someone can advise pls! I'm a very light user mostly for wsapp and sometimes maps/gps when walking (no gaming and occasionally watch youtube videos) so was hoping to find something £40-£50.
https://www.ebay.co.uk/itm/M20-Pro-...var=564119885073&_trksid=p2055119.m1438.l2649
There are others I'm looking at but they don't mention anything about the processor (sometimes it'll mention the number of cores but no name)? The specs seem way better than even xiaomi phones for the same money, I know there's gonna be no support updates etc. how important is that? Couldn't I just search for a custom ROM, try to upgrade to higher android version etc? Would it be difficult/impossible to find roms for an unbranded phone?
Also I've read that there's a possibility they could just be sneaky re-brands so potentially could be getting a xiaomi etc. phone for less?
2) I'm also considering paying a bit more if unbranded is a no-go. Xiaomi Redmi 7 3GB/32GB around £100 vs Xiaomi Mi Play 4GB/64GB if it's £6 more?
I like the extra ram and storage for only £6 more but the battery seems better on R7 and larger screen
MTK devices
supashaka said:
1) I'm hoping someone can advise pls! I'm a very light user mostly for wsapp and sometimes maps/gps when walking (no gaming and occasionally watch youtube videos) so was hoping to find something £40-£50.
https://www.ebay.co.uk/itm/M20-Pro-...var=564119885073&_trksid=p2055119.m1438.l2649
There are others I'm looking at but they don't mention anything about the processor (sometimes it'll mention the number of cores but no name)? The specs seem way better than even xiaomi phones for the same money, I know there's gonna be no support updates etc. how important is that?
Click to expand...
Click to collapse
I've seen some advertisements (on wish.com or Ali Express) for devices with no apparent name brand that mention having 10 core processors, dual sim, Android 9 and more. These are all MTK devices which pose difficulties if you want to flash a ROM into them to upgrade or change something. RCA tablets are MTK devices and I, along with many others have spent a lot of time just trying to gain access to such devices. It's been done. However, it has been more than difficult as of yet to find any compatible ROMs and these devices are extremely picky when it comes to using other ROMs. For those of us that are currently still working on it, we have yet to find anything compatible. That's not saying they are bad devices, they are actually pretty good I've had mine (the RCA Maven, Viking and Galileo) for years with little problems.
Casper Young said:
I've seen some advertisements (on wish.com or Ali Express) for devices with no apparent name brand that mention having 10 core processors, dual sim, Android 9 and more. These are all MTK devices which pose difficulties if you want to flash a ROM into them to upgrade or change something. RCA tablets are MTK devices and I, along with many others have spent a lot of time just trying to gain access to such devices. It's been done. However, it has been more than difficult as of yet to find any compatible ROMs and these devices are extremely picky when it comes to using other ROMs. For those of us that are currently still working on it, we have yet to find anything compatible. That's not saying they are bad devices, they are actually pretty good I've had mine (the RCA Maven, Viking and Galileo) for years with little problems.
Click to expand...
Click to collapse
Thanks for the reply. Any MTK processor devices are difficult/unlikey to have custom roms or tweak/upgrade in any way?
MTK devices
supashaka said:
Thanks for the reply. Any MTK processor devices are difficult/unlikey to have custom roms or tweak/upgrade in any way?
Click to expand...
Click to collapse
Theoretically there should be, but many here would rather work on the newest devices most of which are not MTK (Media Tek). They're not built like Samsungs and if you open one up the whole motherboard is the size of today's phones or roughly one quarter the size of the tablet which could be the reason they're so cheap. The only thing I've been able to flash into mine is the original stock firmware, anything else led to bricking. And recovering from a brick is difficult the SP Flash tool is nothing like the Odin3 we use for Samsungs.
Casper Young said:
Theoretically there should be, but many here would rather work on the newest devices most of which are not MTK (Media Tek). They're not built like Samsungs and if you open one up the whole motherboard is the size of today's phones or roughly one quarter the size of the tablet which could be the reason they're so cheap. The only thing I've been able to flash into mine is the original stock firmware, anything else led to bricking. And recovering from a brick is difficult the SP Flash tool is nothing like the Odin3 we use for Samsungs.
Click to expand...
Click to collapse
I have also bought uhans u300 and took a look at the Development & Support topic here, there's absolutely no way to upgrade it from Android 6.0?

Cheap Chinese phones with good custom ROM support

Hi,
since today there's the big 11.11 sale and I could need a new secondary phone I was looking for a cheaper model (say up to 150€ maybe 200€).
One could get some very nice hardware for this money already, but unfortunately they come with software that I don't trust.
Also I'd like to avoid Xiaomi and their annoying bootloader unlocking process (unless it's Android One).
Do you know any newer phone model or brand in general that has good custom ROM support? I looked at the supported device list of LineageOS but most of the devices are either a bit old or quite expensive. Ulefone, Dogee, Umidigi, Oukitel or how they are all called - I don't care as long as I can install my own software.
Thanks in advance for your recommendations.
simsees said:
Hi,
since today there's the big 11.11 sale and I could need a new secondary phone I was looking for a cheaper model (say up to 150€ maybe 200€).
One could get some very nice hardware for this money already, but unfortunately they come with software that I don't trust.
Also I'd like to avoid Xiaomi and their annoying bootloader unlocking process (unless it's Android One).
Do you know any newer phone model or brand in general that has good custom ROM support? I looked at the supported device list of LineageOS but most of the devices are either a bit old or quite expensive. Ulefone, Dogee, Umidigi, Oukitel or how they are all called - I don't care as long as I can install my own software.
Thanks in advance for your recommendations.
Click to expand...
Click to collapse
Idk if this offer will be available in your country, but for 204€ you can have a google pixel 3a, it has really good ROM support, easy bootloader unlock, and official Android updates.
Here's the link : https://www.backmarket.fr/google-go...cSYGn2dk7zH0iLe_IMj76LldDMGMtSYRoCnuoQAvD_BwE
Try this one if the other doesn't work with your country :
https://fr.shopping.rakuten.com/mfp...rid=pt|930664584875|m|471167205547|3912771384
In short, Google pixel 3a is a good 2ndary phone
The cheap knock offs state fake specs on the phone and descriptions. Since they are all slightly different you would have to study the product in detail using an app called phone information. https://play.google.com/store/apps/details?id=com.inpocketsoftware.andInfo&hl=en_CA&gl=US
The most common processor is the MT65XX. Most of these phones are surprisingly 32bit only. The sellers will never tell you exact specs before you buy, so it's a gamble. I have the Oukitel K9 with a MT6765 that works with Android 12 GSI, but lacks a partition and required some additional magisk setup. Having this knowledge you can look for Oukitel as a model number in the Spec on websites. For instance Mix 4 (knock off) all fake specs but the model is Oukitel and chances are the processor should be Mediatek. If the processor is greater than MT67XX and Ram is 4GB then you will be able to install GSI provided the partitions are standard.

Millions of phones and tablets are obsolete because of sofware. Is there a way around?

Hi everyone.
Every year millions of phones and tablets are produced. Because hardware makers don't worry about updating them, those devices are often dumped. However, lots of them are very capable machines.
As I've read these forums for years, I've seen a lot of work from a lot of people trying to bring those forgotten devices to life again by making unofficial ROMs with tons of customization, new features, and great efforts like LineageOS and PostmarketOS. However, those lack the resources to bring an updated OS for the majority of those binned and obsolete phones.
If I'm not wrong, the biggest issue about replacing the original OS on those devices are the bootloaders and drivers/blobs for the large amount of different hardware configurations. There are multiple workarounds, shims, ports that solve those problems for one or other device.
It might be quite naive, but i'd like to ask a question I've been thinking about lately. AFAIK, if I have the blobs/drivers for a camera, wifi, bluetooth, GPS or other "peripheral" for a devices' original ROM running Android 4.4, I can make it work on AOSP 4.4. I know this might be crazy, but:
As long as I have the blobs for a certain chipset and display/touch, why can't we use a VM running a nano version of AOSP that matches the devices' original ROM that bridges the device IO to the main ROM?
As an example, imagine wifi. I could network bridge AOSP 9 to a VM running AOSP 4, which would then have the drivers so network would work. The same for bluetooth or camera or GPS, maybe? Is this absolutely unfeasible?
Thank you for your time!
wasserprojekt said:
Hi everyone.
Every year millions of phones and tablets are produced. Because hardware makers don't worry about updating them, those devices are often dumped. However, lots of them are very capable machines.
As I've read these forums for years, I've seen a lot of work from a lot of people trying to bring those forgotten devices to life again by making unofficial ROMs with tons of customization, new features, and great efforts like LineageOS and PostmarketOS. However, those lack the resources to bring an updated OS for the majority of those binned and obsolete phones.
If I'm not wrong, the biggest issue about replacing the original OS on those devices are the bootloaders and drivers/blobs for the large amount of different hardware configurations. There are multiple workarounds, shims, ports that solve those problems for one or other device.
It might be quite naive, but i'd like to ask a question I've been thinking about lately. AFAIK, if I have the blobs/drivers for a camera, wifi, bluetooth, GPS or other "peripheral" for a devices' original ROM running Android 4.4, I can make it work on AOSP 4.4. I know this might be crazy, but:
As long as I have the blobs for a certain chipset and display/touch, why can't we use a VM running a nano version of AOSP that matches the devices' original ROM that bridges the device IO to the main ROM?
As an example, imagine wifi. I could network bridge AOSP 9 to a VM running AOSP 4, which would then have the drivers so network would work. The same for bluetooth or camera or GPS, maybe? Is this absolutely unfeasible?
Thank you for your time!
Click to expand...
Click to collapse
That's sort of what project treble is.
Project Treble
The Android 8.0 release includes Project Treble, a major re-architect of the Android OS framework designed to make it easier, faster, and less costly for manufacturers to update devices to a new version of Android. Treble is for all new devices launching with Android 8.0 and beyond.
forum.xda-developers.com
I was reading about it and it seems like treble is not very seccessful. I imagine Google isn't very interested on this, as they want phones to be sold every year. Anyway, I was asking about this specific method of making phones and tablets compatible with today's OS or, who knows, even linux.
wasserprojekt said:
I was reading about it and it seems like treble is not very seccessful. I imagine Google isn't very interested on this, as they want phones to be sold every year. Anyway, I was asking about this specific method of making phones and tablets compatible with today's OS or, who knows, even linux.
Click to expand...
Click to collapse
Yes and the only way it might work is trebel. Because treble handles lot of the problems involved with booting newer androids on older systems.
You can run linux on older Androids or even Windows XP.
How to install a Linux desktop on your Android device
Get even more from your Android device by running a desktop OS! Lots of options including Debian (no root), Ubuntu, and Kali Linux.
www.androidauthority.com
Running Windows XP on Android
No rooting or custom modifications needed, we’re going to do this with stock Android and a few free (but high-quality) apps.
centerorbit.medium.com
Also, it's not that the OS gets deprecated, it's that the applications like Google Play services which become heavier as years go by.
Degoogled-Android on my Android ICS phone worked fine till it's screen got busted. With Google Play services, it was impossible to install any app since its paltry 400MB storage was extended/
Thanks for your answers!
Running other OSes via VNC is just meant to use the devices as mere thin clients, and that was not the objective.
The Project Treble will never be as widespread as it should be, because Google is obviously not interested in making phones last longer (they want more devices to be sold). Of course I was not talking about devices 10 years old, more about 5yrs. They have specs good enough to run contemporary Android and most of non-entertainment apps.
The obstacles to being able to do this are artificial. The problem is there are no drivers and project Treble does not address this in any meaningful way. Manufacturers aren't interested in this too because they want to sell more chips. So the only way it came to my mind it could work was by running a very light VM with an older Android for which the components' drivers were available. Of course main components would still have to be compatible with newer Android, such as the SOC. But things such as wi-fi, camera... could be bridged from a VM, I believe.
Not sure, but I'd guess the low-level interface would have to be outside the VM.
That is, to be able to run the VM you'd have to have some drivers already in place. I'm also not sure everything can be virtualized. For example, desktop VMs couldn't so easily passthru PCIe or USB to VMs, at least in the past.
There's some EU push to make fixing and servicing some non-phone devices easier, and to mandate labeling phones (and other devices) with repairability scores. Maybe eventually they could mandate, under certain conditions, the logical separation of hardware and software?
Well, after a long time, for those who where curious about this thread: the project Halium is exactly what was in my mind. If I'm not wrong, it basically consists in a minimal Android rom running on a Virtual Machine which then interfaces with any Linux distro, effectively giving the phone the ability to run a (more or less) updated version of Linux kernel and, therefore, many Linux distros. https://docs.halium.org/en/latest/project/Scope.html
hkjo said:
Not sure, but I'd guess the low-level interface would have to be outside the VM.
That is, to be able to run the VM you'd have to have some drivers already in place. I'm also not sure everything can be virtualized. For example, desktop VMs couldn't so easily passthru PCIe or USB to VMs, at least in the past.
There's some EU push to make fixing and servicing some non-phone devices easier, and to mandate labeling phones (and other devices) with repairability scores. Maybe eventually they could mandate, under certain conditions, the logical separation of hardware and software?
Click to expand...
Click to collapse
You are right, and I believe Halium just works on phones which are minimally supported by Linux kernel drivers (like basic SoCs). But all those other hardware parts, like GPS, Wi-Fi, Camera... can be brought to life this way, I think.
Thanks for your insight!

Categories

Resources