yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] gtxaspec:
I have this problem too with v4.

Have you tried removing the joying Navi apk completely? Audio routing is different
[Android Head-Units] gustden:
I just put up a version v4.1 with that corrects the issue with the "google voice search" not lowering the music volume.
[Android Head-Units] surfer63:
Fine with me if you tested it.

Can you explain which differences you experienced/hear?
[Android Head-Units] gtxaspec:
[MENTION=3076686]gustden[/MENTION],

I have discovered the steering wheel left scoll control key codes in my 06 audi a4, which were only being displayed in the debug log while the radio is open. If you would be so kind, if you have time, to add them to the next release?

steering wheel left scroll up
D/MCUKEY ( 674): MCUKEYINPUT: B1=1 B2=3 B2=5 B2=3

steering wheel left scroll down
D/MCUKEY ( 674): MCUKEYINPUT: B1=1 B2=3 B2=5 B2=2
[Android Head-Units] gustden:
The codes take you to the functions:

HandlerRadio.searchState(2);

HandlerRadio.searchState(3)

Just wondering if they do anything in the radio app when pressed, such as change channel, scan, or search? Do they do anything outside of the radio app?

Just want to make sure that stealing these codes doesn't break anything.
[Android Head-Units] gtxaspec:
They change the radio station backward or forward depending on scroll direction.
[Android Head-Units] gustden:
The problem here is the MCU is taking action when the keys are pressed, and just notifying android after the fact.

It is possible to create a trigger on them, but it will also change the radio station.
[Android Head-Units] gtxaspec:
Yeah it's really weird, because the MCU beeps whenever I move the scroll wheel, in the radio app or not, and only reports if the radio app is active.

If you add a hook for it, presumably it will disable control in the radio app, or based on what you said, will it change the radio (if in the app) and the executed action? My goal is to have it control next or reverse in most media apps, since I don't use the built in joying applications. Very strange behavior that the MCU exhibits.
[Android Head-Units] AssassinsLament:
Ok, while finishing up my dac mod, I stumbled upon how/why Google Search won't talk back to us. For some reason Google Search's reply is streamed on the "Alarm" stream on our Joyings, and if you look at Settings->Sound & notifications, you'll see that the Alarm sound level is forced to stay at 0. Funny thing is that Bluetooth's audio is also on the Alarm stream. I finally figured out their logic. Joying's software maxes the Alarm stream when you connect via Bluetooth and use their Bt Music app. Media stream is muted at that point. Basically, they mute the Alarm stream or Media stream so that you can't hear both streams at the same time. This has the side effect of not allowing us to hear Google Search because the it's on the Alarm stream which is usually muted unless the Bt Music app is on top and playing music.

Luckily, the fix was easy (easy after days of following the code all around). Basically, we just have to intercept where Joying is muting the Alarm stream, and tell it to stop it! The only thing is you gotta remember to turn off the Bt Music app before you listen to your favorite media player, else they both will be playing music. Not that big of a deal of course. Let me know if there are any other side effects that you discover!

Here is the code so [MENTION=3076686]gustden[/MENTION] can include it in his future updates to his mods (just find the method and replace it in ToolkitApp):

.method public static setStreamVol(II)V
.locals 3
.param p0, "streamType" # I
.param p1, "vol" # I

.prologue
.line 553
const/4 v1, 0x4

if-eq v1, p0, :cond_1

invoke-static {}, Lapp/ObjApp;->getAudioManager()Landroid/media/AudioManager;

move-result-object v0

.line 554
.local v0, "am":Landroid/media/AudioManager;
invoke-virtual {v0, p0}, Landroid/media/AudioManager;->getStreamVolume(I)I

move-result v1

.line 556
.local v1, "value":I
if-eq v1, p1, :cond_0

.line 557
const/4 v2, 0x0

invoke-virtual {v0, p0, p1, v2}, Landroid/media/AudioManager;->setStreamVolume(III)V

.line 559
:cond_0
return-void
:cond_1
return-void
.end method

Basically, if Joying's software is trying to change stream 4 (Alarm Stream), then just skip.

I will also upload a copy of gustden's latest 4.1 mod with my mod already in it. I haven't done anything else to it except add a few lines to the "player_app.txt" file and "unkill_app.txt"

player_app.txt

com.audlabs.viperfx #updated viper4android package name
org.videolan.vlc #updated VLC package name
com.google.android.youtube #Just in case

unkill_app.txt

com.audlabs.viperfx #updated viper4android package name

Let me know how it goes if you use the apk. Don't forget to make a backup of your apk before copying this one in. Also, after you replace the file,

change permissions to 0644 and reboot, and then go into settings->sound&notifications and adjust the Alarm volume to your liking and test out google search.
[Android Head-Units] WILD9:
This is some amazing work, thank you for taking the time to look into it!

One quick question, have you considered/is it possible to redirect the voice output onto the media stream or is this defined in Googles code rather than Joyings? This would allow us to maintain the enforced audio from only one source at a time.

How/Does this affect the way the unit silences audio when you receive a phone call?

This also seems to imply that Bluetooth audio/phone calls actually play through Android rather than bypassing it and playing straight from the MCU so it should be included in the USB audio output which is excellent news!
[Android Head-Units] AssassinsLament:
I think it's found somewhere in Joying's code, so I would say it's possible, but it be very hard and time consuming. Reading and following someone else's source code is difficult already, imagine not having the source code and trying to follow through it. lol, not something I want to do.

I do not know how it affects how the unit silences audio in a call, as I haven't tried that. So hopefully someone tests it out. My guess is if Calls are routed through the Alarm stream, then it should still silence media, as my mod only stops Alarm stream change.

Yeah I am finishing up a usb dac mod also, and as far as I have noticed while testing it is that it seems everything goes through it once it's plugged in.
[Android Head-Units] gustden:
Great work :)

So the only thing that changed here was the check for stream 4, jumping to a return, correct?

const/4 v1, 0x4

if-eq v1, p0, :cond_1

What does adding the players to the player_app.txt actually do? I have been experimenting with adding things here. About the only difference I seen was the radio would quit playing immediately when pulling up the app, vs when the app started playing.

Are changes need to the unkill_app.txt if we have commented out the task killer?
[Android Head-Units] WILD9:
Thanks, looking forward to the DAC mod!
[Android Head-Units] AssassinsLament:
Yes, that's all the code does.

Not too sure what those files do to be honest, I didn't think it was important enough to trace them down in the code. I was hoping those files actually let you determine what stream they went through... but that was wishful thinking.

And you're probably right about the changes to unkill_app.txt.
[Android Head-Units] gtxaspec:
[MENTION=503463]AssassinsLament[/MENTION] awesome work! This mod works great! [MENTION=3076686]gustden[/MENTION] Do you guys mind if I pack the wheel mod in Allapp.pkg and upload it online????
[Android Head-Units] sanangel:
I am with the latest firmware, I downloaded V4.1-Custom-Keys-Mods.zip and I tried to install using adb, but I do not know exactly what the launcher script is and where I have to put it.

According to the first message step you have to place it in data / launcher.sh, I can not find this route. Should launcher.sh be placed directly in the data folder?

Is it placed before doing install.bat using adb? If I do not put it, I get the message of the photo ...
[Android Head-Units] surfer63:
The launcher.sh file is inside the zip you downloaded from the first post. Please make sure you have the launcher.sh in that CUSTOM_KEYS folder.

[MENTION=3076686]gustden[/MENTION]: These error messages are my fault. I adapted the bat file incorrectly. It does work correctly though.

The sleep command is deprecated. I used now the new timeout command.

I replaced the # remarks with proper DOS REM statements (I could have used :: as well). (95% of the time I'm on linux and I was sloppy. sorry)
[Android Head-Units] gustden:
I'll include the updated copy next time I post an update. I'm closer to 99% of the time on linux, so I understand completely. Windows (.bat) files are a foreign language to me.
[Android Head-Units] sanangel:
Again, a thousand thanks for your response and help (and for your patience with me).

With your install.bat file I can install the modified application using adb, after the reboot android update the application but it does not work for me.

After a time off and when restarting Joying, the applications do not continue, they have been killed by the terminal...

Thank you for your time and your patience with me.
[Android Head-Units] budwha:
I would like to try installing V4.1 on my unit. I am pretty sure I have read every thread related to my unit and customization's for it. I have downloaded V4.1 from the first page but now what? Where do I start? Do I install SuperSU first? Is there a tutorial on how to do this? I have adb on my pc which I have never used before....I tried to see my unit wirelessly in adb from my pc but it didn't show( could I just connect hardwire from laptop?).......Is there a good video on how to do this?........so this is all pretty new for me but looking forward to learning something new........
[Android Head-Units] WILD9:
Does anyone have any insight into the purpose of : tip_sound_app.txt

does the line :

com.google.android.googlequicksearchbox

which is in all the keymod versions appear in the original version or is this an addition by someone on XDA?
[Android Head-Units] gustden:
It is in the original. Not sure exactly what an entry in this file does.

I have played with removing and adding back and did not notice anything different. For the packages I put up, I try not to have any changes to the original unless I have an understanding of what I am changing.
[Android Head-Units] WILD9:
Just struck me it's an unusual mention of an app which is not installed by default. I wondered if it could be what is causing voice responses to appear on the alarm stream rather than the media stream.
[Android Head-Units] surfer63:
What strikes me more is that we have users here and on the forum.carjoying.com that mention that google Search worked up till the October ROM. The November ROM and later don't function anymore with Google search. As I'm a newby who got his unit half of January, I can't comment on that.
[Android Head-Units] gtxaspec:
There's no posted ROM before November correct?
[Android Head-Units] surfer63:
No. I have already been searching. I also tried the "way back machine", but that one didn't contain links to older ROMs either.
[Android Head-Units] Yury_D:
Hello!

I installed the latest v4.1 mod and it works on my unit but the NAVI event (9) doesn't work. When it called in the script the navigation doesn't start and it types "2" when the NAVI key is pressed while a text editor is opened =o.O= even if this event processing is removed.
[Android Head-Units] gustden:
It sounds like you do not have a case for 9) in the shell script.

It hits the default and 9 is passed as a keyevent(9) = KEYCODE_2, resulting in the 2 being typed.

If you look at the launcher_simple.sh, the case 9) should be very similar to the existing functionality of the NAVI button.

What action do you want the NAVI button to perform?
[Android Head-Units] Yury_D:
I'd like to lunch a standard navigation by a single press and the google map by a double press. The google map lunch is working but not a standard one
[Android Head-Units] barnesk9:
is Google maps set as your default navigation app? if so that's causing the issue, also make sure you're sending the navigation button first and not Google maps
[Android Head-Units] Yury_D:
No, my default navigation is iGO.

Here the part of code I'm using:

# NAVI
navi="input keyevent 9"

# Google maps
maps="am start com.google.android.apps.maps/com.google.android.maps.MapsActivity"

9)	# NAVI:
#	1x iGO
#	2x Google maps
#
last=`cat /data/$key.cnt`
last=$((last+1))
case $last in
1)
echo $last > /data/$key.cnt
(sleep .5 && [ `cat /data/$key.cnt` = $last ] && echo 0 > /data/$key.cnt && $navi ) &
;;
2)
echo 0 > /data/$key.cnt
$maps
;;
*)
echo 0 > /data/$key.cnt
$home
;;
esac
;;
[Android Head-Units] AssassinsLament:
You need to define the navi line to start the activity of iGo. Currently, it's set to "input keyevent 9", so that's just like hitting the number 2 on the keyboard.

# Tom Tom iGO
navi="am start com.tomtom.gplay.navapp/com.tomtom.mobilenavapp.MobileNavAppActivity"
[Android Head-Units] Yury_D:
Thank you, I suspected that but I have no iGO lunch string... (

Is it possible to perform a standard NAVI key action which will start a predefined navigation app?

It's much easier to select the app through a Joying interface neither edit the script each time.
[Android Head-Units] surfer63:
Sure it is. I have that in my launcher.sh

In the program (package name) declarations

# One key Navi app - the default navi app
navi="am start com.syu.onekeynavi/com.syu.onekeynavi.MainActivity"

An in the "case $key in" section

9) # NAVI - the default navi app
$navi
;;

I don't care about other options although I occasionally use another nav app.
[Android Head-Units] Yury_D:
Thank you so much! That what I was looking for! Not sure how I missed it
[Android Head-Units] rhino6303:
Would there be any issue running v3.0 without buttons on an older built rom? I'm still on the december build and using v1.0 without issues but I would like the newest functionality of google voice. Thanks.
[Android Head-Units] gtxaspec:
Update!
[Android Head-Units] rhino6303:
I know but everything else works great and I hate that the update wipes the data partition. I may just give it a go and see if there aare any issues. I can always just revert back.
[Android Head-Units] dpredster:
I can try to create a v1 file with the Google voice mods but you will have to test it as I am currently on the March build.
[Android Head-Units] rhino6303:
That would be great but I understand if it is a hassle. I'm the one being difficult and not updating, haha. Thank you.
[Android Head-Units] dpredster:
There seem to be several changes between v1.0 and v3.0. Without having the December rom to test myself I don't want the post the changes I made. My advice would be that you upgrade your software. I know it's a hassle to do but you would be able to enjoy that all the fixes that are being done to the software here.
[Android Head-Units] dayanandgp:
Hi all, wonderful to hear about Google voice solution!! Thanks to developers making this unit better and better ?. Should I install it separately or does V4.1 already takes care of it?
[Android Head-Units] budwha:
Could you tell me exactly how to do this please.......

I just tried this, but it won't let me remove the original apk.
[Android Head-Units] surfer63:
Because the partition is read-only and need to be remounted for read-wrtie.

Download the modkey version and use the install.sh (linux) or install.bat to install your(!) version of the apk, or check the contents and do it by hand.

The simple Nokill version does not need the laucher.sh
[Android Head-Units] joshnat:
I updated to the 3/28 ROM the other day, and rooted with no problem. Reinstalled everything via Titanium Backup. Then I installed the 4.1 version of the custom keys mod. I used my old launcher.sh since I had it set up the way I wanted previously. Now, when I push the Band or Media buttons I get an "f" or "e" character, respectively. I replaced the launcher.sh with another copy, and it's doing the same thing. Permissions seem right. The custom key assignments are working properly. Band and Media are hard buttons on my VW-specific HU that should (in theory?) be passed to the MCU without modification, right? I had this problem before, but with one of the custom buttons (Navi, I think), and found an error in the launcher.sh file I had made. But there's no assignment for these stock keys so I'm not sure what to do about. Thanks!
[Android Head-Units] gustden:
These were added in version 4.

V4: Updated code base using 3/14/2017 Joying ROM

Changes/Added support for:

MEDIA KEY - hard key on unit

BAND KEY - hard key on unit
[Android Head-Units] joshnat:
That explains it, thanks!!
[Android Head-Units] joshnat:
Next question: is there a command I can assign to a button to turn the screen off without muting sound? The volume button will turn off the screen with a long press, but it mutes the HU when used.
[Android Head-Units] gustden:
As far as I know, it cannot be done through a command in the launcher.sh script. There is a function within the Sofia Server apk called blackScreenCmd(I) that does this. It can be hard coded to a specific key by modifying the Joying code directly to call it on a specific button press.

I actually had my unit set up this way for a while, but didn't find it useful enough to waste (one of my few) buttons on it. The problem is even adjusting the volume or any user action will cause the screen to come back on.

It would be really nice to have a button to "toggle" the timeout to something real small like 5 seconds, so it keeps shutting off automatically even after you change the volume.
[Android Head-Units] edit:
Is it possible to have a button that can be used like an windows alt-tab... so I can toggle between running apps.

I want to be able to switch between PlayerPro and Waze using as little moves as possible...

I prefer to be able to keep my eyes on the road and do the swap via a physical button rather then fiddling with the touchscreen.

Thank you !
[Android Head-Units] joshnat:
Do you think it's worth trying to call that command in launcher.sh? I wonder what it is about that makes it necessary to hard code?
[Android Head-Units] phatass_dk:
Hi Gustden,

I applied the NO KILL mod just now and it has seriously messed up my unit I'm afraid.

After having replaced the file and created a copy of the old one named "xxx_x" in the same folder, I have lost CANbus support and all audio on the unit.

Changing back didn't do anything even after a few reboots.

What to do? Do I need to reinstall the whole system again?

Thanks.

/Peter
[Android Head-Units] bogdi1988:
Make sure the old one doesn't have the APK extension. Also make sure the chmod is done on the new file.
[Android Head-Units] phatass_dk:
Ahh, that just might be it! Damn! Thanks a lot for the fast response! :)
[Android Head-Units] dalu:
Do I need a root to replace files?
[Android Head-Units] phatass_dk:
Yes you do

---------- Post added at 01:47 PM ---------- Previous post was at 01:46 PM ----------

Bogdi's tip worked perfectly on my issue. The mod is great!
[Android Head-Units] concept5400:
I have a problem with Waze and modified Server apk (with no kill) - every other app continue to run flawlessly (Spotify continue to play and local community traffic sharing app work in the background) after suspend but Waze is stuck on black screen and not responding. I have to force close it and reopen. Anyone else had this issue? Is there a workaround?
[Android Head-Units] gtxaspec:
Uninstall waze and reinstall. Corrupted data folder.
[Android Head-Units] concept5400:
Deleted app data and cache, uninstalled, installed fresh Waze from Google Play - didn't help, same problem.

When I open Waze manually it works perfect, this problem only occurs when I turn the car off with Waze running and after suspend turn the car on - all apps are coming back perfectly but Waze very often is stuck on black screen not responding (sometimes is starts ok and sometimes it freezes).
[Android Head-Units] KamaL:
This happens to me sometimes, especially if you s set auto Navi in the car media settings.

I just use a shortcut on the steering wheel for waze and I open it whenever I need it.

Nothing in this unit is perfect, it's a matter of finding acceptable compromises. It's still a Chinese product
[Android Head-Units] dongali:
Joying 2GB - Steering wheel key customization - V4 (NO KILL)

Finally got it all set up after putting together information from 2 large threads...

Here's a quick summary with everything you need- assuming you know how to use adb:

1. Root your Joying Intel head unit with a easy script [MENTION=2550900]surfer63[/MENTION]

https://github.com/hvdwolf/Joying-RootAssistant

2. Install the Google Voice Services [MENTION=4287714]dprester[/MENTION]

https://github.com/dpredster/Joying_GVS

3. Download Steering keys customization 4.1 [MENTION=3076686]gustden[/MENTION]

https://xdaforums.com/android-auto/android-head-units/joying-2gb-steering-wheel-key-t3543390

4. Download the fixed Ok, Google version of Sofia-1-C9-Server-V1.0.apk [MENTION=503463]AssassinsLament[/MENTION]

https://xdaforums.com/showpost.php?p=71565661&postcount=274

5. Replace the "Sofia-1-C9-Server-V1.0.apk" in the Steering keys customization folder with the fixed Ok, Google version

(this is because the original post has not been updated to included the fixed version yet)

6. Install the Steering wheel customization script

7. Replace the Joying Settings.apk with the Stock Settings.apk located in the folder /system/priv-app/settings

https://xdaforums.com/showpost.php?p=71701071&postcount=352

8. Done! I highly recommend you going back into the Steering wheel key customization folder to edit the "launcher.sh" script to your liking.

This is all possible thanks to this community. I thank you all and especially the developers who can make this possible!
[Android Head-Units] concept5400:
I have decompiled the server apk and found nokill txt files. Is there a way to modify it to let the HU kill Waze task and at the same time prevent other tasks from being killed?

If I exit Waze manually before ACC OFF it can be turned on automatically by AUTO NAVI option in CAR MEDIA SETTING. This way it's not freezing. If HU would kill it for me instead I wouldn't have to do it manually.
[Android Head-Units] surfer63:
In the key mod version you will find in launcher.sh

98) # ACC_OFF
$pause
;;

You could change this to

98) # ACC_OFF
$pause
am force-stop com.waze
;;

This will kill Waze and its processes before going into sleep mode.

And you would keep all other processes in memory, as that is the purpose of the NoKill functionality.

You could also wrap the last command in a nice variable of course.
[Android Head-Units] SebbiSt:
Hello,

i really love this mod, thank you very much! Do you think it is possible to include Bliter.de Plus in the navi.txt of the next version?

https://play.google.com/store/apps/details?id=de.blitzer.plus

Its the most famous speedcamera app in germany

Thanks! I would relly appreciate this

btw: what command can i add to #ACC_ON to run blitzer.de Plus every start?
[Android Head-Units] concept5400:
That's a good idea, thank you.

BTW

There are three semicolons after 98) $pause in launcher.sh (V4.1). Is it intentional or typo?

[MENTION=8126339]SebbiSt[/MENTION] I have some basic programming knowledge but I have decompiled server apk from 4.1 mod, added local speed camera app to navi.txt and compiled and signed it again. I will push it to HU later today. I hope it will work :)
[Android Head-Units] surfer63:
typo.
[Android Head-Units] concept5400:
[MENTION=2550900]surfer63[/MENTION]

Thanks.

BTW How can I add some wait time to launcher.sh script? I would like to add

"am start com.waze/com.waze.MainActivity"

to 97) #ACC_ON

But after waiting 5 second, to make sure that everything else is already woken up.
[Android Head-Units] surfer63:
Use the sleep command like

sleep 5