Solution: Get Rid of Google Voice Search Popping In At Random While Using Headphones - Android Q&A, Help & Troubleshooting

With the latest software update of my Sony Z5P I faced a really annoying issue, which essentially prevents me from listening to the music with the device. Symptoms are as following: during headphones connect or disconnect, or even slight movement of the jack in the audio port, volume randomly goes all way up or down and, the most annoyingly, music pauses and Voice Search is activated. Very frustrating.
I searched for the possible fixes in the Internet and found that there are dozens of posts on various web resources, regarding exactly the same issue. The issue exists on a very broad range of phones, tablets and Android versions. There are a lot of solutions too, generally "Try to install app X" or even "disable Google Search", but nothing worked for me (and probably for majority of users). And I didn't wanted to disable Voice Search, because it's a useful feature.
Looking into the problem further, I discovered that the issue is caused by the wrong detection of a headphones by Android. The system decides that it's not headphones, but a headset, that is the headphones with a mic and hardware buttons to control audio. The system even places an icon to the upper bar and there is a "Headset is plugged in" notification in the drawer.
Due to a hardware difference between connectors of headphones and a headset, every time it is slightly moved in port generates random electric signals which Android mistakenly recognizes as commands from a hardware remote control. If you are listening to the music while walking or especially running, the chances are pretty high, that connector is moving slightly. And the music become constantly interrupted by Voice Assistant or its volume is being decreased or increased. That's really, really disturbing.
One particular useful post which I found was this one. From it I learned there is a /system/usr/keylayout directory in Android filesystem, with files handling hardware buttons. Other useful insight is a link to the small Chris Boyle's app for keypresses debug (he even made a blog post about it). With this knowledge and this small useful tool I started to dig into my phone's system.
Using Key Test app mentioned above I figured out that any slight jack movement generates keypresses with scan codes 226 and 582 (HEADSETHOOK and VOICE_ASSIST) and occasionally 114 and 115 (VOLUME_DOWN and VOLUME_UP). That's what I should find in the system.
At first I should state that to make my solution work, you will need a rooted phone. All dirty hacks need root privileges. For Sony Z5 Premium rooting I assembled a dedicated guide, although it should work with most recent Sony devices. If you have a phone from some other OEM, please search this forum, there are plenty of rooting guides.
Okay, you have a topic problem, your phone is rooted and your adb works. That's how I fixed my phone.
At first you should check contents of your phone's /system/usr/keylayout directory and inspect individual files. It's easier to do on a computer, so copy this folder (maybe with some file manager like ES File Explorer) to your internal or external storage (for example to /sdcard) and then transfer by MTP to the computer (in Windows use File Explorer, the directory is in the This PC\Xperia Z5 Premium Dual folder or something like this).
Once you have keylayout directory on your computer, use some text editor tool which can search multiple text files for a particular text (I use Notepad++, but if you are on a Unix-like OS, you may use grep as well). You should search you files for this text strings:
Code:
HEADSETHOOK
and
Code:
VOICE_ASSIST
On the latest Z5 Premium firmware (Android 6.0.1, build .224) these particular strings were found in the Generic.kl and msm8994-tomtom-snd-card_Button_Jack.kl files. While the former is a generic keymapping file of all Android devices, the latter is specific to Z5P, because of it's name, which suggests that it is somehow related to MSM 8994, which is a partnumber of Qualcomm Snapdragon 810 SoC. In fact, this file is obviously handles headset keypresses, and its contents are:
Code:
key 226 HEADSETHOOK
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 582 VOICE_ASSIST
key 260 VENDOR_1
Your phone may have file with some other name but contents should be similar. What worked in my case is a changing the codes in this file to some different values which are not used elsewhere. I changed mine to this:
Code:
key 995 HEADSETHOOK
key 996 VOLUME_UP
key 997 VOLUME_DOWN
key 998 VOICE_ASSIST
key 999 VENDOR_1
And that's how I placed modified msm8994-tomtom-snd-card_Button_Jack.kl back into its original place in the phone. This is particularly tricky and you absolutely need rooted phone to do this.
First, place the file into the phone's memory with a guaranteed write access. /sdcard usually is a such place:
Code:
adb.exe push msm8994-tomtom-snd-card_Button_Jack.kl /sdcard/
Then login to the phone's shell and become superuser (root):
Code:
adb.exe shell
[email protected]:/ $ su
[email protected]:/ #
After that make /system mounted as a read/write filesystem:
Code:
[email protected]:/ # mount -o remount,rw /system
And copy the modified file back in place. After that reboot:
Code:
root[email protected]:/ # cp /sdcard/msm8994-tomtom-snd-card_Button_Jack.kl /system/usr/keylayout/
[email protected]:/ # reboot
Once the file was updated and the phone rebooted, I checked keypresses with Key Test again. These keypresses were generated as before, with the same scan codes, but this time key codes were registered as KEYCODE_UNKNOWN and did not any harm. The system cannot recognize them and doesn't react to them in any sensible way.
That's it. Be informed, that if you plan to use a real headset, with this hack its keys will not work at all.

tl;dr
- Enable ADB and root access for ADB
- In ADB shell:
Code:
$ su
# mount -o remount,rw /system
# sed -i "s/\(key.*HEADSETHOOK\)/#\1/g" /system/usr/keylayout/Generic.kl
# sed -i "s/\(key.*VOICE_ASSIST\)/#\1/g" /system/usr/keylayout/Generic.kl
# reboot

Related

The HP Touchpad Sticky Master Thread

This is some of the info that I have put together and I figured it may help some of you also. Let me know if I need to add anything. Looking forward to working with this device. Hopefully the Devs will take an interest in it also. With these hardware specs I feel like they will. Anyway, carry on............
Dev/Config/Soft/Tools
CyanogenMod team Touchpad port
HP Site
SDK - Multiple Platforms Instructions
Command line tools
Java - WIndows 32 and 64 Bit Instructions
****Note - Be sure to add the Java Bin path to your Environment Variables PATH
Java - Linux
Bluetooth with Non-WebOS device
Enabling Developer Mode (Rooting)
How To: Connect TP to network shares​HW
Exploded and PCB
Quick sum up/start up guide Thanks KameoRE
Bill of Materials
Specs 16GB
Specs 32 GB
Repair Manual / Teardown
Comparisons​
Extra info
Enabling Developer Mode (Rooting)
In general, simply installing the Palm SDK gives you everything you need for full access to the Linux operating system on any webOS device. There is no special "rooting" or "jailbreaking" process. Simply installing the SDK provides you with unlimited access to the Linux operating system.
Download & install the Palm SDK for Linux, OS X or Windows.
Enable developer mode on the HP Touchpad:
Launch Device Info and tap its top-left menu.
Select "Custom Application..." and type in: ##3386633#
In the application, move the Developer Mode slider to the On position.
Tap Reset the Device.
When reset is complete, Developer mode is enabled.
Plug the device into the computer via the USB cable, and just close out the USB storage mode thing.
The next step varies:
Mac OS X / Linux: Type novaterm into terminal to directly access the Linux command line for the HP Touchpad.
Windows: you will need to download and install a novaterm program.
On Windows 32-bit, download novacom-win-32.tgz and install novacom with NovacomInstaller_x86.msi.
On Windows 64-bit, download novacom-win-64.tgz and install novacom with NovacomInstaller_x64.msi.
Then, just like the Mac and Linux users you can just type novaterm.
At this point you will have a window with a prompt that says [email protected]: or something similar.
You are now logged in as root on your webOS device and can do anything you would normally do on a Linux device.
DISCLAIMER: We cannot be held liable for any loss of data, damage, bricking, or other malfunctions of the device. We solely provide the information needed to achieve root access.
This quick sum up/start up guide might come handy:
http://forums.precentral.net/hp-touchpad/293028-new-touchpad-heres-your-get-started-guide.html
[Q] What is wrong with my touchpad?
RESET: Hold Power Button & Home Button until the tablet resets.
Doing the above solved the below issue.
My touchpad won't turn on I used it until it had about 30 % battery last night, but didn't put it to charge. When I woke up this morning, it was at 28% battery. I used it to check facebook and xda, locked it and put it down to watch the price is right but when I went to use it again, none of the buttons unlocked it. I plugged it into mulitple outlets and held the power button for about 30 seconds each time, but nothing is happening I don't know what to do. Can anybody help?
Click to expand...
Click to collapse
solution #2
this happened twice:
plug it in to pc
open webos quick install
tools - command line
type "reboot" and hit enter
Bill of Materials
$318 Bill of Materials
Comparisons
Comparisons
Exploded and PCB
Exploded and PCB
First non-webOS phone to be fully tetherd with HP TouchPad
First non-webOS phone to be fully tetherd with HP TouchPad
Worked for me, I had to fool with it a couple of times to get it to work. My screenshot is attached
The messaging does not work but the phone calls do.
How To: Connect TP to network shares
How To: Connect TP to network shares
spud101
Member
Join Date: Jun 2004
Location: Netherlands
Posts: 574
Likes: 34
Thanks: 43
Thanked 69 Times in 34 Posts
Updated (Sep 7th 2011):
Rewritten to include a method for stock kernel, make shares usable for KalemSoft Media Player & automount at (re)boot. Thx to everybody who contributed to this thread! (Under construction, finished later)
Updated (Aug 9th 2011): processed some comments from this thread and the fact that uberkernel now also supports CIFS (& NFS).
Prerequisites:
- HP Touchpad, webOS 3.0.2 or later.
- One of the following Kernels:
---- Stock kernel
---- Uberkernel 3.0.2-52 or later (Next to support for CIFS & NFS this kernel also supports UTF-8. More info here: WebOS Internals Uber-Kernel
---- F15C,.. (completed later)
- Terminal access to your TP, either via webOS Quick Install or Xecutah + Xserver + Xterm (install from preware)
- Internalz Pro with show hidden files set to yes
Three parts:
This guide has three parts:
Basic Mounting
Mounting with shares visible in apps like Kalemsoft Media Player
"Sticky" mounting: Auto mount at (re)boot
Definitions:
hostIP = IP address of the computer or NAS you want to connect to. You can use hostnames too, but need to also edit /etc/hosts then.
sharename = The share name you want to connect to as configured on your computer/NAS
mountpoint-path = as discussed above, e.g. /mnt/nas
cifs = type of filesystem to mount (cifs is better version of smbfs, I've been told)
auto (or can also be noauto) auto/noauto determines if the share is mounted automatically at startup.
username & password = share login credentials. There are probably safer ways to do this instead of having this plain text on your device, anyone can tell me how to do that?
rw = access mode, in this case read & write, other possibilities exist too
The numbers have someting to do with filesystem check at boot.
1a: Basic Mounting (without fstab)
- Create a mountpoint, a path where the share will be accessible, e.g. /mnt/nas or /mnt/media/internal/nas I used Internalz Pro in master mode for this.
- In a terminal type:
mount.cifs //<hostIP>/<sharename> <mountpoint-path> -o username=<username>,password=<password>
Example: mount.cifs //10.0.1.26/DataVolume /mnt/Shared -o username=foo,password=bar
1b: Basic Mounting (with fstab, not supported by stock kernel)
To be finished later
2: Mounting with shares visible in apps like Kalemsoft Media Player
To be finished later
For now please refer to:
Road to Success - How to allow NAS to show up under /media/internal on Touchpad Apps?
How To: Connect TP to network shares
How To: Connect TP to network shares
3: "Sticky" mounting: Auto mount at (re)boot
To be finished later
For now please refer to:
Road to Success - Mounting SAMBA/CIFS Permanently on Touchpad
-------------------------------
Original post:
In short: The stock kernel on a webOS 3.0.2 Touchpad does not support CIFS. Or at least I didn't get it to work just the same way I do get it to work out of the box on a 1.4.5 Pre-.
Then I saw this thread: F15B & F15C test kernels
It says CIFS support! So I hesitantly installed this experimental F15C kernel, quickly ran Govnah to set max speed to 1.5 GHz (I don't want no real overclocking beyond this speed). But, YES, it does work, I now can access my NAS!
After I initially posted this thread webosinternals also added support for CIFS (& NFS) to the uberkernel (as of version 3.0.2-36). Thanks a lot for that guys!!
So how to go about:
- Install the F15C kernel from the testing kernel feed
The rest is standard linux stuff for mounting Samba shares:
- Create a mountpoint, a path where the share will be accessible, e.g. /mnt/nas or /mnt/media/internal/nas I used Internalz Pro in master mode for this.
- Open /etc/fstab again you can use Internalz Pro in master mode for this
Add a line:
//<hostIP>/<sharename> <mountpoint-path> cifs auto,username=<username>,password=<password>,rw 0 0
hostIP = IP address of the computer or NAS you want to connect to. You can use hostnames too, but need to also edit /etc/hosts then.
sharename = The share name you want to connect to as configured on your computer/NAS
mountpoint-path = as discussed above, e.g. /mnt/nas
cifs = type of filesystem to mount (cifs is better version of smbfs, I've been told)
auto (or can also be noauto) auto/noauto determines if the share is mounted automatically at startup.
username & password = share login credentials. There are probably safer ways to do this instead of having this plain text on your device, anyone can tell me how to do that?
rw = access mode, in this case read & write, other possibilities exist too
The numbers have someting to do with filesystem check at boot.
- Save the file
- Open a terminal
- type in this command:
mount -t cifs //<hostIP>/<sharename> <mountpoint-path> -o username=<username>,password=<password>
No idea whether all the -o options are still needed, as they are in the fstab line already as well.
Apparently mount -a should also mount your shares inside fstab. But for me that didn't work, maybe because I have it set to noauto.
This should do it.
Unmounting as follows:
umount <mountpoint-path> e.g. umount /mnt/nas
Note: as soon as you have a kernel running that supports CIFS, you can also use the xt tools. See this thread and the threads referenced inside it. samba filesharing - install/support thread
The xt tools will take over all the fstab editing and directory creation.
I agree this is still cumbersome. On an Android phone for example this is buildin in every decent filemanager. So I really, really hope that either or both Gemini and Internals HD will have some easy solution for this (both configuring and the actual mounting/unmounting). Or a solution straight from HP, this is also aimed at enterprise market after all!
Last edited by spud101; 09/08/2011 at 07:41 PM.
Thanked by 60milesmile, cookie_42, El_Titi, flyers333, ichi2k, Major Payne, mivoligo, Nightburn, obarthelemy, PF Graham, phil71, pre101, RickNeff, runner77, sf3000, sjp770, sps_2k1, tabaloos, teng_lin, thomaz, timjhenry, tlaswell​
Weird shortcut to USB mode
Has anybody else seen this?
While connected to PC in "just charging" mode I reached out and accidentally hit the Volume Down and Power buttons at the same time. The TouchPad instantly switched to USB Storage mode.
Interesting behavior and I couldn't seem to find any mention of it anywhere.
PreCentral had it as a tip on their web site about a week ago and I spotted it there - http://www.precentral.net/access-usb-mode-touchpad.
Quite a few other useful titbits crop up on there - it is worth following. I use the webOS News app from the App Catalog. That gives heads-up on the free software codes as well.
dmarchant said:
PreCentral had it as a tip on their web site about a week ago and I spotted it there - http://www.precentral.net/access-usb-mode-touchpad.
Quite a few other useful titbits crop up on there - it is worth following. I use the webOS News app from the App Catalog. That gives heads-up on the free software codes as well.
Click to expand...
Click to collapse
LOL, I think you mean "TIDBITS."
Too bad there is no reverse version of this.

KGL Unit + USB DAC SABRE ES9023

Following the instructions below, I managed to get my USB DAC to work. I will attach the drivers that worked for me.
aluver said:
So, I am glad to say, we have USB Audio (DACs) support now.
If you want to build a serious car sound system, you have to make a digital out to your amp (or DSP) instead of using our head units line outs.
I will try to write in more detail and more simply as to repeat it.
For the redirection of all sounds of the Android to your USB device (a sound card, DAC) it is necessary:
1. To be convinced that a system's kernel version is 3.0.36+ . The version of a firmware can be any. At me I was KLD-1.98 and 4.2.2. But despite it I pulled out driver modules from a tablet firmware on the Android 4.4.2.
2. Get root, root explorer and Android terminal emulator.
3. Copy by root explorer USB Audio support modules *.ko from the applied archive in /system/lib/modules/, and set them permissions to 0644.
4. It is obligatory to try loading modules manually from the terminal exactly in that order:
Code:
[email protected]:/ $ su
[email protected]:/ # insmod /system/lib/modules/snd-hwdep.ko
[email protected]:/ # insmod /system/lib/modules/snd-rawmidi.ko
[email protected]:/ # insmod /system/lib/modules/snd-usbmidi-lib.ko
[email protected]:/ # insmod /system/lib/modules/snd-usb-audio.ko
If the device reboots at execution of this commands, these drivers don't suit to you (though probability of it is small as our HU are identical)
If system silently swallowed your commands - everything normally, we go further.
5. Connect your USB device to one of the back USB ports intended for 3G/Wifi (as we surely need port with support of USB-host).
6. In the terminal enter the following commands and check your device, what number it was defined.
Code:
[email protected]:/ # ls dev/snd
controlC0
controlC1
controlC2
pcmC0D0c
pcmC0D0p
pcmC1D0p
[COLOR="Red"]pcmC2D0c
pcmC2D0p[/COLOR]
timer
[email protected]:/ # cat /proc/asound/cards
0 [RK29WM8731 ]: RK29_WM8731 - RK29_WM8731
RK29_WM8731
1 [RKHDMII2S ]: RK-HDMI-I2S - RK-HDMI-I2S
RK-HDMI-I2S
[COLOR="red"]2 [Headset ]: USB-Audio - Plantronics Headset
Plantronics Plantronics Headset at usb-usb20_host-1.3, full speed[/COLOR]
[email protected]:/ #
Apparently from replies of system, my test Plantronics headset received the address pcmC2D0p - that is Card 2 Device 0. Remembered these figures. Due to the identical architecture of our HU, I think, it will be similar for all of us.
7. To make modules *.ko were loaded at each start of a system, it is necessary to copy by root explorer install-recovery.sh script from archive to /system/etc/install-recovery.sh, set permissions 0755.
8. For providing the redirection of a sound to our USB device it is necessary to deceive system. For this purpose it is necessary to replace number of the device (card) in file /system/lib/hw/audio.primary.rk30board.so. You need find 'pcmC0D0p' string and change it to your remembered value (pcmC2D0p, I think so). It is best of all to make it on the computer by any binary files editor. But I put already my edition of the audio.primary.rk30board.so file with pcmC2D0p value. Don't forget to set it permission 0644. And it is obligatory to make a backup of the original file for ability to return to an initial state.
Click to expand...
Click to collapse
At step 7. my unit looses root capability, therefore I created a script that runs after boot with Script manager.
The script contains the following:
insmod /system/lib/modules/snd-hwdep.ko
insmod /system/lib/modules/snd-rawmidi.ko
insmod /system/lib/modules/snd-usbmidi-lib.ko
insmod /system/lib/modules/snd-usb-audio.ko
At step 8, I didn't find that PCM in my unit so I used another audio.primary.rk30board.so file. I will attach it below.
Problems:
After the sound was rerouted to the DAC, I discovered that I can't control the volume.
Therefore, I bought USB AUdio Player PRO. Now I can control volume, but only from the app, the buttons still doesn't work.
!!!!!! I want to change the tracks from the buttons + SWC and the volume too.
I tried Headunit app, but it doesn't do anything with this player.
PS: Viper4Android doesn't work with this app too.
Instead, Viper4Android works with stock musicplayer but I can't control the volume over HiFimeDIY Sabre USB DAC ES9023 96kHz/24bit
PS2: After I start the USB Audio Player PRO App, I get no sound in other applications. If I don't start that app, I get sound in stock Music Player, Youtube, PowerAmp, etc.
Excellent!
I have found that I can control the volume with the following command:
alsa_amixer -c N cset numid=X Y
Click to expand...
Click to collapse
Where:
N is the number of the card
X is the option corresponding to the volume
y is the value of the volume
In my case, maximum volume is 110 and minimum is 0
Example of command in my case:
alsa_amixer -c 2 cset numid = 2 100
Click to expand...
Click to collapse
Can someone please make a widget/app or integrate it somehow in Headunit so that I can control the volume?
I would be very grateful.
R4D3N said:
I have found that I can control the volume with the following command:
Where:
N is the number of the card
X is the option corresponding to the volume
y is the value of the volume
In my case, maximum volume is 110 and minimum is 0
Example of command in my case:
Can someone please make a widget/app or integrate it somehow in Headunit so that I can control the volume?
I would be very grateful.
Click to expand...
Click to collapse
Here is my edition of last version (2.15) of RK3066-Headunit-service
My edition is able to change the volume levels of DAC and HU together - in same percentage.
DAC volume is changing by command:
Code:
alsa_amixer -c2 sset 'PCM' X%
where 2 - is a card number of DAC (for our HU is always 2)
PCM is the name of alsa volume simple control of Sabre U2 (and many others DACs too)
X% - the value of volume, % - always equal to internal volume of HU, that calculating from 0...30 to 0...100 "exponentialy" by microntek service.
And by the way it also can switch folders/albums in Poweramp through API-commands NEXT_IN_CAT / PREVIOUS_IN_CAT (my wheel buttons codes for it - 61, 62; yours may be different).
I wrote to petrows (developer of this RK3066-Headunit-service) about this modification and asked him to include this functionality to next versions.
Thank you very much. It works but now I have another problem.
After 10-15 minutes, the volume control stops working. It remains or at maximum volume or at the last volume that was set up.
Any ideas how to fix this?
I gues sthe problem is that your volume knob does not control android's volume but send commands to MCU.
Could you try using "Volume+" App to control volume if that works?
Volume+ doesn't work over my DAC.
Headunit does, but after 15 minutes stops working, but if I clear data or restart the Headunit application it works again for 15 minutes.
Any ideas?
PS: SHould I give special permissions to Headunit app? Before it was 0777 and now I am trying with 0644 and I will get back with review.
R4D3N said:
Thank you very much. It works but now I have another problem.
After 10-15 minutes, the volume control stops working. It remains or at maximum volume or at the last volume that was set up.
Any ideas how to fix this?
Click to expand...
Click to collapse
I have had this problem, but only once. Not depends from time in my case. Fixed by reboot too. I think you need to check the direct capability of alsa_amixer to change the dac volume from terminal when it happened again.
Code:
su
alsa_amixer -c2 sset 'PCM' 50%
If it will work, i think the problem is your SU is only for 15 minutes for application. Check your root preferences.
---------- Post added at 07:51 PM ---------- Previous post was at 07:44 PM ----------
dark alex said:
I gues sthe problem is that your volume knob does not control android's volume but send commands to MCU.
Could you try using "Volume+" App to control volume if that works?
Click to expand...
Click to collapse
Our RK3066 HU doesn't have this functional - android volume change is blocked by ROM. Tried this some time earlier.
Alsa mixer was used on this reason. Service just catches microntek MCU volume changes and sends alsa_amixer commands with the same value of volume in %.
How do I check my root preferences?
aluver said:
Code:
su
alsa_amixer -c2 sset 'PCM' 50%
If it will work, i think the problem is your SU is only for 15 minutes for application. Check your root preferences.
.
Click to expand...
Click to collapse
This works so the problem is my root preferences.
then you have to change it in superuser (or SuperSU - depending) app.
I tried but It won't appear in Superuser because when I run it, it doesn't prompt for Root Privilleges, it just runs. How can I manually add it to Superuser?
PS: I am using Malaysk's latest firmware for RK3188.
I installed SuperSU, i granted permanent SuperUser for Headunit but I have the same problem. After a while, the volume control stops working. It works again only if I reboot or if I clear data of the Headunit program.
Ideas?
R4D3N said:
I installed SuperSU, i granted permanent SuperUser for Headunit but I have the same problem. After a while, the volume control stops working. It works again only if I reboot or if I clear data of the Headunit program.
Ideas?
Click to expand...
Click to collapse
When you clear data of the Headunit program, it restarts. So, you just give it 15 min of work with root-access again. Try to delete in SuperSU access rule for this service and reboot. When it will ask for root, give it permanent root. Or you can choose in SuperSU permanent root for all applications.
Thank you very much. I got that working too, I now I have only one problem.
Everytime I power one the unit or when it powers from sleep the volume is at 100% and after I press the volume button it changes at the value on the screen.
Is there a way the set set the default volume as MUTE or 10% ?
Any idea?
If this happens after cold start too, I have the one idea only. Your sevice is starting too early, before the DAC determined by system. Check your startup sequences scripts.
Insmod-commands must be at first positions of install-recovery.sh
mtcservice must be launched by install-recovery-2.sh
There is no problem for me with Malaysk fw #23.
default install-recovery-2.sh from there:
Code:
#dsa
lsd () {
to=$1
shift
for i in $*; do
if [ -d $i ]; then
i=${i%/}
j=${i##*/}
if [ "${j#com.tomtom.*}" != "$j" ]; then
k=$((k+1))
j=$to/$j
if [ -n "`ls $j`" ]; then continue; fi
mkdir -p $j
if mount | grep "$j "; then umount $j; fi
mount -o bind $i $j
else
lsd $to $i/*/
fi
fi
done
}
{
IFS=${IFS#??}
while ! mount | grep "/mnt/internal_sd "; do sleep 1; done
ck=0
while true; do
k=0
#########################################################################
### lsd syntax: ###
### First argument is the target (internal) folder. ###
### Further arguments make a list of source (external) storage paths. ###
### If any com.tomtom.* folder is found in any source path tree, ###
### it will be (bind) mounted under the target folder. ###
#########################################################################
lsd /mnt/internal_sd/tomtom /mnt/external_sd*/*/ /mnt/usb_storage*/*/
if [ $k -gt 0 ]; then
ck=0
sleep 20
continue
fi
if [ $ck -ge 90 ]; then
sleep 30
else
ck=$((ck+1))
sleep 1
fi
done
} >/dev/null 2>&1 &
getpid () {
ps | busybox sed -n "/busybox sed -n/! s/[^ ]* *\([0-9]*\).*$1.*/\1/p"
}
while true; do
pid=`getpid maxmpz`
if [ -z "$pid" -o "$pid" != "$pap" ]; then
om=0
st=0
while true; do
st=$((st+1))
nm=`mount | grep usb_storage | busybox wc -l`
if [ $nm -ne $om ]; then
om=$nm
st=0
else
if [ $st -gt 3 ]; then
if [ $nm -gt 0 ]; then
usb=1
break
fi
if [ -z "$usb" ]; then
break
fi
st=0
fi
fi
if [ $nm -gt 0 ]; then
sleep 1
else
sleep 3
fi
done
while ! am startservice -a com.maxmpz.audioplayer.API_COMMAND --ei cmd 3; do sleep 1; done
sleep 2
pap=`getpid maxmpz`
fi
pid=`getpid petrows`
if [ -z "$pid" ]; then
while ! am startservice com.petrows.mtcservice/.ServiceMain; do sleep 1; done
sleep 1
fi
sleep 10
done &
As you can see startservice com.petrows.mtcservice exists here by default.
I have just replaced old mtcservice apk by new own edition.
PS: Answer with quotes please, because it's the only way to get an E-mail notification for me. I visit this place very rarely.
Does anyone use any RCA mixer or other stuff with DAC to use the built in BT handsfree and FM radio? If I understand good need to connect the DAC and the head unit's RCA outputs to the amplifier in same time.
I found this: Rolls MX22A it is an active mixer, or a passive diy mixer good enough for us?
Or anybody tired the Behringer UCA202/UCA222? It has RCA input and monitor output.
I haven't got any DAC, so I can't try it, but thinking of buying one.
peti007 said:
Does anyone use any RCA mixer or other stuff with DAC to use the built in BT handsfree and FM radio? If I understand good need to connect the DAC and the head unit's RCA outputs to the amplifier in same time
Click to expand...
Click to collapse
If you want to built SQ system, don't do this. This way is wrong - you'll loose the sound quality your DAC gives. Just leave one pair of speakers (coax at rear?) plugged to front speaker outs of your HU and all dirt will live there with BT and radio. You'll CAN hear sound from them, when you need that, but the noise from line outs of HU shouldn't be mixed to your clear music stream
The real music must be at front only: 2-way, 3-way, with sub, etc.
aluver said:
If you want to built SQ system, don't do this. This way is wrong - you'll loose the sound quality your DAC gives. Just leave one pair of speakers (coax at rear?) plugged to front speaker outs of your HU and all dirt will live there with BT and radio. You'll CAN hear sound from them, when you need that, but the noise from line outs of HU shouldn't be mixed to your clear music stream
The real music must be at front only: 2-way, 3-way, with sub, etc.
Click to expand...
Click to collapse
If I listen to FM radio, the HU's RCA out sounds and the DAC is muted, if I listen to music over DAC the HU's RCA is muted.
Maybe I'm wrong, but if I connect the HU's front RCA out and the DAC's RCA out to the RCA mixer in the same time, it doesn't mean they both sound in the same time. There is noise on the HU's RCA too when no sound came out from it?

How to create a shelf icon that executes a shell programm call?

Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
I would like to know it too. Anyone?
Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Run a tiny web server like lighttpd in the shell on a weird port, restrict to localhost. Set up index.php to run system (whatever);
Then bookmark the 127.0.0.1: xxxx URL
Which system call invokes power_dbus_suspend?
Thanks Parrotgeek1. Working off your excellent suggestion I installed a lightweight local server on ChromeOS (Web Server for Chrome with the 200 OK! icon) and built a small framework app that is served from local storage. I'm all set up to call chrome.app.??? from my JavaScript. Which API provides the power_dbus_suspend capability? I looked through the Power and System APIs and I don't see anything. - Thanks!
Sneets said:
Hey everyone,
I am looking for a way to activate sleep mode of my chromebook manually in order to save battery without having to log out or power off all the time (it's connected to an external display, so closing the lid doesn't trigger it).
So far I found out that calling "powerd_dbus_suspend" from the shell does the trick, but as you can imagine, using the shell and actually typing the command every time is not really a solution.
Is there a way to create a chrome os app that executes this program call, so I can put it in my shelf and just click it to activate sleep?
I'm not really good at .json, maybe there's a way? Or any other suggestions?
Thanks alot!
Markus
Click to expand...
Click to collapse
Have you tried this simple extension? Keep Awake
https://chrome.google.com/webstore/...lb?utm_source=chrome-app-launcher-info-dialog
What I do is have the shell tab pinned, and press [up arrow] for the command then hit [enter]. Probably not ideal if you use the shell a lot as you have to step through recently used commands.
Re: Pkt_Lnt's post
Thanks Pkt_Lnt. That app only deals with disabling the normal sleep behavior, not causing it, and in particular not causing it when an external monitor is connected. I'm looking for something like Sneets has requested, to invoke a powerd_dbus_suspend command that will force the system to sleep (and turn off an external monitor). Per Parrotgeek1's comment, I've got a little app now sitting on the shelf that is all set to call some system command to invoke powerd_dbus_suspend, only I'm looking for what command to call, from JavaScript.
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html
Impressive! But a bit more than I'm looking to do
@Nolirum - I read your blogspot doc and your procedure's pretty impressive. Frankly it's a little beyond me and beyond what I'm looking for. If you ever run across a way to invoke powerd_dbus_suspend a little more directly please post here as well. You clearly have a strong grasp of the issues!
Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
This method might be overkill somewhat, but, anyway, what I did was as follows:
Installed Secure Shell extension; setup sshd on the Chromebook (by making a symlink in /etc/init/ pointing to /usr/share/chromeos-ssh-config/init/openssh-server-conf); rebooted; added public key from ConnectBot (Android app) to ~/.ssh/authorized_keys in order to test connection; setup Android homescreen shortcut to send shell command; created profile in Secure Shell app on Chromebook to connect to [email protected]/my local IP address; generated keys on Chromebook (in ~/.ssh); added generated public key to ~/.ssh/authorized_keys; imported newly-generated private/public key pair within Secure Shell app (one by one); created bookmark link to [email protected] profile in shelf, and, finally, added required command to profile in Secure Shell.
It works well! It looks like any command can be added to the 'Arguments' field in Secure Shell, with the syntax:
Code:
-- thecommand
Although I guess commands that need sudo would require a connection to [email protected], instead of chronos. (-t argument lets you use sudo, but then sending a line break/ENTER seems to be needed)
The window opened with the click does hang around - I haven't figured out if it's possible to avoid this - but it does at least seem to persistently remember the size and position to which it's set.
Click to expand...
Click to collapse
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
However, I got to thinking. I was wondering if this could be extended to use an alias stored in ~/.bashrc?
After doing some research of my own and using various parameters and arguments, I was unsuccessful.
The goal is to have a linux app (through crouton) be run using xiwi with just a single bookmark by utilizing an alias.
Any thoughts?
UPDATE:
Of course just a few moments later I figured this out! Rather than dealing with an alias stored in ~/.bashrc and ensuring ssh had access, typing the entire alias command as an argument worked. Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Thanks again!
DandyRandyMarsh said:
This really is impressive! Thanks for the extremely detailed explanation.
I was able to follow along completely and get the SSH argument "powerd_dbus_suspend" working.
Click to expand...
Click to collapse
No problem! I think it's perhaps overly detailed if anything. Might be easier to follow if I cut it down a bit.
DandyRandyMarsh said:
Now I can run Steam directly from a shelf bookmark. All it took was replacing "powerd_dbus_suspend" with "-- sudo enter-chroot xiwi steam" in the argument.
Click to expand...
Click to collapse
Nice!
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Inspired by your post I added xiwi to my chroot to try it out. I seem to remember experiencing quite unbearable lag and slowness when running a full desktop via xiwi in the past, but with single apps there doesn't seem to be any noticeable performance hit (this is on an armv7 Asus Flip, with the chroot on a slooow USB drive).
In order to not have to enter my sudo password, in the argument I put:
Code:
-t -- echo mypassword | sudo -S sh /media/removable/3/bin/enter-chroot xiwi firefox
Maybe I'm missing something? Is there a better way, perhaps?
Anyway, since I have rootfs verification switched off, I also tried saving a similar command to a file in /usr/bin, and putting the filename in the argument instead. This works, too, and I suppose could potentially be useful e.g. in the case of needing to run a more convoluted sequence of commands with a shortcut.
Nolirum said:
Adding crouton single app shortcuts is a cool idea which I hadn't considered. Does it work OK for you with sudo in the command, even straight after booting up? ...You didn't have to setup sudoing without a password via sudoers.d or anything?
Click to expand...
Click to collapse
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
As a side note, this is the crouton installation I am running on an ASUS c302.
sudo sh ~/Downloads/crouton -r trusty -t unity,touch,xiwi,extension
Setup Bookmarks that Run Shell Commands
1. Installed Secure Shell extension
2. Open crosh with Ctrl+Atl+T
3. Enter Command: shell
4. Enter Command: sudo su -
5. Enter Command: sudo /usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification
6. Enter Command: reboot
7. Let Chrome OS reboot
8. Open crosh with Ctrl+Atl+T
9. Enter Command: shell
10. Enter Command: sudo su -
11. Enter Command: mount –o remount rw /
12. Close current crosh window
13. Open a new crosh with Ctrl+Atl+T
14. Enter Command: shell
15. Enter Command: sudo ln -s /usr/share/chromeos-ssh-config/init/openssh-server.conf /etc/init/openssh-server.conf
16. Enter Command: sudo initctl reload-configuration
17. Enter Command: sudo initctl start openssh-server
18. Enter Command: cd ~/.ssh/
19. Enter Command: ssh-keygen
“Enter file in which…” *LEAVE BLANK*
“Enter passphrase” *LEAVE BLANK*
“Enter same passphrase” * LEAVE BLANK*​20. Enter Command: cat /home/chronos/user/.ssh/id_rsa.pub >> /home/chronos/user/.ssh/authorized_keys
21. Enter Command: cp -a /home/chronos/user/.ssh/id_rsa* /home/chronos/user/Downloads
22. Close current crosh terminal and open Secure Shell extension
23. Select [New Connection]
24. Click Import… and select “id_rsa”
25. Click Import… again and select “id_rsa.pub”
26. Enter chronos as the username and localhost as the hostname
27. Enter a shorthand name replacing the text in the top cell “[email protected]”
28. Click Enter. If prompted, enter “yes” to continue connecting
29. Bookmark the page that is open which should end in, "#profile-id:_ _ _ _"
DONE. Now time to add some commands to automate.
Open Secure Shell and select the connection created. In the arguments box, start with two dashes -- and follow it your desired shell command.
Examples:
-- sudo startunity
-- sudo startgnome
-- sudo enter-chroot xiwi steam
-- sudo enter-chroot xiwi wine microWord​
Next Steps... Getting Custom Shelf Icons
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Followed a strategy found on reddit, Change Shelf Icon for Website, but this only works if the site already had an "apple-touch-icon" set. Also, tried to inject the entire code myself which I couldn't get to work. Unfortunately, I think that since this bookmark is created from a Secure Shell, there are some issues.
I have already tried adding in code for this into the site, but it is having no effect. If someone could make this work then we're really looking good here.
DandyRandyMarsh said:
I'm not entirely familiar with exactly how my process worked, but I do not have any sudo password required within shell.
Click to expand...
Click to collapse
Oh, I see what you mean. You are saying that you can sudo in the shell generally, without being prompted for a password, right?
Was that the default setup on your CB (after switching to Dev mode)? Or did you have to configure it manually for passwordless sudoing...
DandyRandyMarsh said:
Here's the list of steps I followed allowing me to use sudo commands in the SSH Arguments box.
Click to expand...
Click to collapse
Nice work summarizing the steps. :highfive: It's probably easier to follow, listed out like that. One slight addendum, perhaps - at step 29, it might be good to clarify the "add to shelf" procedure. Especially because of the following...
DandyRandyMarsh said:
Next Steps... Getting Custom Shelf Icon
Now here I am running into some issues. Rather than have all these icons be the same, I was hoping to customize them.
Click to expand...
Click to collapse
Happily it turns out that, when you add shortcuts to the shelf on Chrome OS like this, a minimal app is created for each one, with its own manifest.json, and icon.pngs. Our shell shortcuts were getting created with blank pngs by default (the black box with P in the center).
So, all we need to do, is get some icons, find the right folder for our shelf shortcut apps, then copy our new icons into them!
For instance, here's how I made a nice shiny icon for my single app shelf shortcut to Firefox.
Prepared icons:
Created a temporary folder in ~/Downloads to store downloaded icons.
Prepared a set of icons in ~/Downloads/firefox. (I downloaded mine from findicons.com).
Six sizes are required - from 32px to 256. To avoid any manifest editing, saved them as *size*.png
e.g. 32.png; 48.png; 64.png; 96.png; 128.png; 256.png
Located folder to copy icons to:
It is easiest to do this directly after clicking "add to shelf"
EITHER:
To change dir into the most recently modified extension icon subfolder automatically, the following one-liner worked for me*.
Code:
shell
cd ~/Extensions/&&cd $(ls -v1td */ | head -1)/*/icons&&ls
A list of blank icons (*.png) should be visible. If so, the new icons can simply be copied over these, e.g..
Code:
sudo cp ~/Downloads/firefox/* .
*YMMV with this particular one-liner - sometimes there's an extra 'temp' folder in ~/Extensions, which stops it working as expected. If you get an error after running the command, simply use the slightly more manual method to locate the folder, as detailed below.
OR:
(slightly more manual method).
Code:
shell
ls -ltr ~/Extensions
Checked the date/times - the most recently added folder is at the bottom. Then,
Code:
cd themostrecentlyaddedfolder
(or, the folder modified at the date/time that the shortcut was "added to shelf"). Then,
Code:
cd */icons
ls
sudo cp ~/Downloads/firefox/* .
I then repeated the above with a new SSH argument and a set of Ubuntu icons, for a custom startxfce4 shortcut, too.
Then just did sudo restart ui, and enjoyed the shiny new shelf icons!
I am hopeful that these changes will get picked up by CrOS's sync, thus getting backed-up and restored automatically. At this point I am not sure if that will be the case, but I don't see why it wouldn't.
Another way?
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Clicking the newly-created link (which looks like an "N") will launch /usr/bin/crosh in a tab. Changing the default behavior of /usr/bin/crosh could accomplish your goal to do whatever you want. With some experimenting, you might even be able to pass arguments to make it do different things depending on how it's opened (via ALT-CTRL-T vs from the shelf-- dunno if it can read the url used to call crosh), but at the very least you could do something like have it run whatever you want it to run if a second modifier key is held down (or if it isn't...), otherwise return to normal operation. A menu w/1 sec timeout could do this as well, ie--
Doing [THE THING YOU WANT] in 2 seconds (press SPACE for crosh)... /
Note there's no proof-of-concept here. Just throwing it out as an idea that I'm pretty sure would work... Someone might even create a neat extension that allows crosh to use scripts/plugins to execute different system operations beyond the stock ones that are built-in via single-clicks... If it worked, it might be a little simplier than via the SSH extension and you wouldn't have to run any extra daemons.
ft
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
var terminal = new hterm.Terminal(profileName);
And then you can do stuff with it. You could then create an extension that could handle multiple shelf-icons (say by appending ?COMMAND=ls to the URL to do different shell commands(. The security implications for this would probably be huge obviously.
Update: More on embedding hterm is here.
Nolirum said:
I managed to find a way to do something similar with the Secure Shell app. During the process of figuring it out, I also found that I was able to create a homescreen shortcut on my Android tablet which when tapped sends a shell command to the Chromebook.
I posted up some further details at http://nolirium.blogspot.com/shell-command-shelf-shortcut-chromeos.html
Click to expand...
Click to collapse
Nice post - Some good food for thought, changing up the contents of crosh etc directly is an interesting idea.
fattire said:
Another way to approach this, since you're modifying system stuff anyway, might be to edit crosh at /usr/bin/crosh. It's a regular ol' dash/bash shell program, and you can create a shortcut to it on the shelf by opening crosh (ctrl-alt-T), then right click the top right of the browser and select More Tools --> Add to shelf...
Click to expand...
Click to collapse
Interesting! ....Aaaaand, now I've broken crosh. lol. Lucky I had my SSH shortcut setup... (actually, we can still get into the VTs with CtrlAltF2 etc anyway).
Some good potential for experimentation with this, definitely.
fattire said:
This is probably harder, but a third way, which probably is the "right" way is to see how the crosh extension works and learn about opening the hterm.Terminal instance chrome.terminalprivate object directly, sending it output, and closing it in the same way crosh does it. There's a file in the crosh extension at js/crosh.js that shows the basics of how it's done:
Click to expand...
Click to collapse
Again, very interesting. Now you come to mention it, an approach such as this does seem like it might be do-able without too much messing around (maybe)...
Any possible method we can get e.g. an extension to 'talk' to the shell is worth looking into I think; as you say, if we can cut out the middleman (ssh) and maybe do it more elegantly, that might be pretty useful indeed.

Copying english voice prompt files to WOS 2.0 ?

I really want to switch to WOS 2.0, but the one thing preventing me from doing so is that the voice prompt (when running with bluetooth headphones), would be in chinese.
I know that pacefied has english voice prompts (or had, as I believe it's not working in the most recent versions)
So my question is: is it a simple case of copying over some english voice files to the watch?
Could I install WOS 2.0 and then after installation copy the english files ?
I did replace the chinese voiceprompts with the english ones in the NewWearSport.apk, installed the rooted spanished version from here:
https://www.htcmania.com/showthread.php?t=1412777
and replaced the NewWearSport.apk via adb.
Everything installed well and is working well but I don't hear any voiceprompts. Since I don't have that much outdoor activities now due to an injury I couldn't check, why the voiceprompts are not working. I guess it is better to wait for Saratoga79 to have it done.
nhedgehog said:
I did replace the chinese voiceprompts with the english ones in the NewWearSport.apk, installed the rooted spanished version from here:
https://www.htcmania.com/showthread.php?t=1412777
and replaced the NewWearSport.apk via adb.
Everything installed well and is working well but I don't hear any voiceprompts. Since I don't have that much outdoor activities now due to an injury I couldn't check, why the voiceprompts are not working. I guess it is better to wait for Saratoga79 to have it done.
Click to expand...
Click to collapse
You mean you couldn't hear the voice prompts when your bluetooth headphones were connected? Could you hear chinese voice prompts instead?
I realise that Saratoga could probably solve this problem fairly easily (that guy really seems to know what he's doing), but I don't want to keep asking him cos I realise he's busy.
I feel like it must be just a case of replacing files in the file system. Or is it not that simple?
Voiceprompts are in the NewWearSport.apk integrated. I replaced the Chinese ones with the English ones. I didn't check the Chinese ones before. You have to open the apk files to do so. For this you can use several tools. Since my manipulated apk did install properly I guess it is save to assume, that I did it allright.
nhedgehog said:
Voiceprompts are in the NewWearSport.apk integrated. I replaced the Chinese ones with the English ones. I didn't check the Chinese ones before. You have to open the apk files to do so. For this you can use several tools. Since my manipulated apk did install properly I guess it is save to assume, that I did it allright.
Click to expand...
Click to collapse
I see. My assumption was as follows:
When you install an apk, the files are unzipped to the android file system somewhere (e.g. a newwearsport/voiceprompt folder or something). I thought that (without installing a new apk) you could just copy english files directly to the folder. Perhaps there is some technical reason why this isn't possible. I know very little about this stuff.
The version of the voice files in EN is missing some phrases in the new sport app, but the version in Spanish seems to be complete. I will do some tests today, trying to use ES+EN, so no words in CN...
le_lutin said:
When you install an apk, the files are unzipped to the android file system somewhere (e.g. a newwearsport/voiceprompt folder or something). I thought that (without installing a new apk) you could just copy english files directly to the folder.
Click to expand...
Click to collapse
I just had a look on the watch to be on the safe side.
This quoted assumption is wrong. The only trace of the NewWearSport.apk I found was under:
\system\app\NewWearSport\NewWearSport.apk.
Where is a Subfolder mips which contains the actual code as odex file which I didn't touch.
We have some traces in the data folder :
\data\data\com.huami.watch.newsport
but not the voicefiles. So in my opinion the only way to get to this files is via replacing them in the NewWearSport.apk and installing the new version of this apk.
.
nhedgehog said:
I just had a look on the watch to be on the safe side.
This quoted assumption is wrong. The only trace of the NewWearSport.apk I found was under:
\system\app\NewWearSport\NewWearSport.apk.
Where is a Subfolder mips which contains the actual code as odex file which I didn't touch.
We have some traces in the data folder :
\data\data\com.huami.watch.newsport
but not the voicefiles. So in my opinion the only way to get to this files is via replacing them in the NewWearSport.apk and installing the new version of this apk.
.
Click to expand...
Click to collapse
Thanks man - you know this stuff better than I do!
lfom said:
The version of the voice files in EN is missing some phrases in the new sport app, but the version in Spanish seems to be complete. I will do some tests today, trying to use ES+EN, so no words in CN...
Click to expand...
Click to collapse
Sounds good!
I just did a quick and dirty replace of the voices with ES + EN, still a few phrases in CN but I think that all of them are used only for VO2max which is deactivated on Pace.
DISCLAIMER
** Although I have tested the procedure, if you do it then you do on your own risk. I am not responsible for any errors or damaged caused. **
Requires: WOS 2.0.6.12 set to "en" + adb + root, code is for macOS/Linux, probably on Windows it will work if you use "adb.exe" instead of "adb" (untested), apk file must be in current directory.
Code:
adb root
adb remount
adb shell mv /system/app/NewWearSport/NewWearSport.apk /system/app/NewWearSport/NewWearSport.apk_OLD
adb push NewWearSport.apk /system/app/NewWearSport/
adb shell chmod 0644 /system/app/NewWearSport/NewWearSport.apk
adb remount
adb reboot
To revert:
Code:
adb root
adb remount
adb shell rm /system/app/NewWearSport/NewWearSport.apk
adb shell mv /system/app/NewWearSport/NewWearSport.apk_OLD /system/app/NewWearSport/NewWearSport.apk
adb remount
adb reboot
EDIT: attached file removed, please see other post in this thread with all EN version and scripts to install/uninstall.
lfom said:
I just did a quick and dirty replace of the voices with ES + EN, still a few phrases in CN but I think that all of them are used only for VO2max which is deactivated on Pace.
DISCLAIMER
** Although I have tested the procedure, if you do it then you do on your own risk. I am not responsible for any errors or damaged caused. **
Requires: WOS 2.0.6.12 set to "en" + adb + root, code is for macOS/Linux, probably on Windows it will work if you use "adb.exe" instead of "adb" (untested), apk file must be in current directory.
Code:
adb root
adb remount
adb shell mv /system/app/NewWearSport/NewWearSport.apk /system/app/NewWearSport/NewWearSport.apk_OLD
adb push NewWearSport.apk /system/app/NewWearSport/
adb shell chmod 0644 /system/app/NewWearSport/NewWearSport.apk
adb remount
adb reboot
To revert:
Code:
adb root
adb remount
adb shell rm /system/app/NewWearSport/NewWearSport.apk
adb shell mv /system/app/NewWearSport/NewWearSport.apk_OLD /system/app/NewWearSport/NewWearSport.apk
adb remount
adb reboot
Click to expand...
Click to collapse
You're a legend! Will try this out as soon as I get a chance.
Thanks!
le_lutin said:
You're a legend! Will try this out as soon as I get a chance.
Thanks!
Click to expand...
Click to collapse
Please test the attached file, all voices in EN high quality, with scripts to install/remove for macOS, Linux and Win. I haven't tested the BAT scripts, if someone test them, please report back. Thanks.
DISCLAIMER
** Although I have tested the procedure, if you do it then you do on your own risk. I am not responsible for any errors or damaged caused. **
Requires: WOS 2.0.6.12 set to "en" + adb + root (permanent or use temporary)
- Unpack file
- Open command line and change directory to the contents of the file
- To install run "sh install_en_voices.sh" for macOS/Linux or "install_en_voices.bat" for Windows
- To uninstall run "sh remove_en_voices.sh" for macOS/Linux or "remove_en_voices.bat" for Windows
When reboot, watch will re-optimise all app, it's normal, simply wait. No data will be affected.
lfom said:
Please test the attached file, all voices in EN high quality, with scripts to install/remove for macOS, Linux and Win. I haven't tested the BAT scripts, if someone test them, please report back. Thanks.
DISCLAIMER
** Although I have tested the procedure, if you do it then you do on your own risk. I am not responsible for any errors or damaged caused. **
Requires: WOS 2.0.6.12 set to "en" + adb + root (permanent or use temporary)
- Unpack file
- Open command line and change directory to the contents of the file
- To install run "sh install_en_voices.sh" for macOS/Linux or "install_en_voices.bat" for Windows
- To uninstall run "sh remove_en_voices.sh" for macOS/Linux or "remove_en_voices.bat" for Windows
When reboot, watch will re-optimise all app, it's normal, simply wait. No data will be affected.
Click to expand...
Click to collapse
Nice work, will add this to next WOS ROM.
Btw, note that I had some problems with voices using different bitrate, frecuency or channel number comparing to stock CN voices. I face several Bluetooth issues due to this, even bluetooth disconnections, so be advised.
Saratoga79 said:
Nice work, will add this to next WOS ROM.
Btw, note that I had some problems with voices using different bitrate, frecuency or channel number comparing to stock CN voices. I face several Bluetooth issues due to this, even bluetooth disconnections, so be advised.
Click to expand...
Click to collapse
Thanks. And thank you for all the work you've done for the Amazfit community as well. No problems with my testings yesterday, I did a walk and also indoor running for testing. But this was the initial version, a quick build for testing purposes. Many of phrases can be improved, maybe it's better to wait until it's finished.
Regards
I tried it today while running. I got no voicealerts.
Settings:
Bluetooth headset connected but no musicplayer started (music playing is working with bluetooth headset [verified]).
Run - Settings - Training target (not set)
- Alerts - Lap Alert - on
- HR Alert - above 170
- HR Zone - off
- Auto Lap Alert - on
- Pace Alert - off
more settings - Voice prompt - on
- Auto Pause - off
- Auto Lap - off
- Realtime Stats - Heartrate
- Data Screen - 6fields
- 3D Data - on
- BG Color - white
nhedgehog said:
I tried it today while running. I got no voicealerts.
Click to expand...
Click to collapse
I have tested with walk and indoor run and it worked with me, enabled most voice alerts and I could hear warning on pace, heartrate and distance. If you don't connect the headphones in the Accessories part of the activity settings, then try to start playing a music before you start the activity and then pause it using the headset to make sure it's activated.
nhedgehog said:
I tried it today while running. I got no voicealerts.
Settings:
Bluetooth headset connected but no musicplayer started (music playing is working with bluetooth headset [verified]).
Run - Settings - Training target (not set)
- Alerts - Lap Alert - on
- HR Alert - above 170
- HR Zone - off
- Auto Lap Alert - on
- Pace Alert - off
more settings - Voice prompt - on
- Auto Pause - off
- Auto Lap - off
- Realtime Stats - Heartrate
- Data Screen - 6fields
- 3D Data - on
- BG Color - white
Click to expand...
Click to collapse
Try with music, if there is a problem with voice files music will stop playing
Thanks for the support.
Headphones were connected and playing music fine before.
I think I have an idea whats wrong.
1) I run with airplane mode on but bluetooth activated. (PaceON)
2) I did not use the settings accessories to connect with the headphones but did it before with music.
3) Auto Lap - off
Have test this theorie further.
Saratoga79 said:
Nice work, will add this to next WOS ROM.
Btw, note that I had some problems with voices using different bitrate, frecuency or channel number comparing to stock CN voices. I face several Bluetooth issues due to this, even bluetooth disconnections, so be advised.
Click to expand...
Click to collapse
NewWearSport concatenates all the mp3 files needed to form the phrase in a temporary mp3 file.... these means that all mp3 files need to be same bitrate and with no headers (xing, id3, VBRI or another tags at the start or end of the file)

How to install a script in Remix Os

Hi guys, at first sry for my bad English.
I have a big problem and i need help to solve this. One of my heater thermostat make problems. I started a firmeware update and make a big mistake. Now it is always in update mode. I found a solution for that problem with Remix OS.
Install a current (!) VirtualBox and VirtualBox Extension Pack for USB support DONE
Blacklist btusb module and possibly more specific device drivers like ath3k if it applies to your system to keep the Bluetooth USB device unoccupied (revert this later!); give chmod a+rw permission to the USB device file under /dev/bus/usb/xxx/yyy, see lsusb I skiped this step. I hope it was okay.
Install RemixOS in a VirtualBox VM, add a USB device filter to expose your Bluetooth chip to RemixOS DONE (Install Remix on Ubuntu 64bit Bluetooth is working fine and Remix OS show me the thermostat.)
Install calor BT on RemixOS, run it at least once DONE (app for the thermostat from the play store
Determine the device Bluetooth address: Open the device by unscrewing the four screws, then gently pulling the turning knob outwards, remove the cover; locate the "ADDRESS" QR code printed on the front of the circuit board; scan the QR code to retrieve the Bluetooth adress in form M001A22XXYYZZ (I had to take a picture, crop it and then run the QR scanner on the image); the Bluetooth address then is 00:1A:22:XX:YY:ZZ; replace the cover, again gently pulling the turning knob outwards, turn it to make it fit the turn encoder; screw the cover DONE MAC is M001A220EE2D5
Manually set up the calor BT configuration to address the bricked device. Save this as container.json, replacing all XX:YY:ZZ by the address determined above: {"clients":{},"devices":{"00:1A:22:XX:YY:ZZ":{"availableFirmwareVersion":null,"firmwareVersion":null,"groupId":"17f51411-4be0-4155-98f6-9a03bbde5681","groups":[],"id":"00:1A:22:XX:YY:ZZ","label":"Device","lastStatusUpdate":0,"lowBat":false,"unreach":false,"updateState":null,"operationLockActive":false,"temperatureOffset":0,"valvePosition":null,"type":"HEATING_THERMOSTAT"}},"groups":{"17f51411-4be0-4155-98f6-9a03bbde5681":{"channels":null,"devices":["00:1A:22:XX:YY:ZZ"],"homeId":null,"id":"17f51411-4be0-4155-98f6-9a03bbde5681","label":"Room","lastStatusUpdate":0,"lowBat":null,"metaGroupId":null,"unreach":null,"activeProfile":null,"actualTemperature":null,"boostDuration":0,"boostMode":false,"controlMode":"AUTOMATIC","maxTemperature":29.5,"minTemperature":5,"nextSwitchPoint":null,"profiles":null,"setPointTemperature":17,"windowOpen":null,"windowOpenTemperature":12,"type":"HEATING"}},"home":{"absenceEndTime":"","absenceType":"NOT_ABSENT","availableAPVersion":null,"clients":[],"connected":false,"currentAPVersion":null,"deviceUpdateStrategy":null,"ecoDuration":null,"ecoTemperature":0,"groups":["17f51411-4be0-4155-98f6-9a03bbde5681"],"id":null,"lastReadyForUpdateTimestamp":0,"location":null,"nonAbsenceGroups":[],"pinAssigned":false,"powerMeterCurrency":null,"powerMeterUnitPrice":0,"timeZoneId":"","updateState":"UP_TO_DATE","dutyCycle":null},"metaGroups":{},"weather":{"temperature":0,"weatherCondition":"UNKNOWN","weatherDayTime":"DAY"},"homeGroup":null,"inboxGroup":null} Maybe use http://www.jsoneditoronline.org/ to edit this. DONE change all the MAC address. I create the file container.json.
Now, install this configuration inside RemixOS: make sure the VM is shut down.
Mount the RemixOS VM image, first making the VM image available as a block device (using qemu-nbd from qemu-tools): modprobe nbd qemu-nbd -c /dev/nbd0 --partition 1 <path to RemixOS.vdi>
Now mount it: mount /dev/nbd0 /mnt
Copy container.json to /mnt/android-2016-06-30/data/data/de.eq3.ble.android/app_data/ (might vary depending on RemixOS version)
Unmount the RemixOS image: umount /mnt qemu-nbd -d /dev/nbd0
Boot up RemixOS; run calor BT; go to "Room", then "Device", then "Update firmware"
Firmware should be transferred (showing moving bars next to "UPD" on the device), then rebooted, device is then going to "InS" mode, turn it off and on again to enter date setup, etc.
up to step 7 I understood the steps so far. But now i'am lost and need help.
i hope somebody could help me to finish this solution.

Categories

Resources