2004 to 2020 Mazda 3 Forum and Mazdaspeed 3 Forums banner
1 - 20 of 46 Posts

·
Registered
Joined
·
33 Posts
Discussion Starter · #1 · (Edited)
I made some but not complete progress on that Bluetooth Call Bug on Android Auto V1.02 Headunit.

The bug was introduced after the git update below;

https://github.com/gartnera/headunit/commit/8a6e139e897f81c105194cdda4c4bc80851fd0b9

specifically when the following lines were added;

+ HU::ChannelDescriptor* btChannel = carInfo.add_channels();
+ btChannel->set_channel_id(AA_CH_BT);
+ {
+ auto inner = btChannel->mutable_bluetooth_service();
+ callbacks.CustomizeBluetoothService(AA_CH_BT, *inner);
+ inner->add_supported_pairing_methods(HU::ChannelDescriptor_BluetoothService::BLUETOOTH_PARING_METHOD_A2DP);
+ inner->add_supported_pairing_methods(HU::ChannelDescriptor_BluetoothService::BLUETOOTH_PARING_METHOD_HFP);
+ }
+
return hu_aap_enc_send_message(0, chan, HU_PROTOCOL_MESSAGE::ServiceDiscoveryResponse, carInfo);
}


It is simply telling AA app on the phone side to route the audio to the Bluetooth side while the original Phone to Infotainment Bluetooth Telephony profile is still active. But the AA app on the phone side does not see the already active bluetooth connection thus it is attempting to make another link resulting to that looping bluetooth on and off effect during the phone call.

This was not present on the V0.99 as the AA app on the phone assumes that there is NO bluetooth call profile defined on the current link due to the absence of the above code thus the phone call is passed to the infotainment via the usual MZD bluetooth connection (which is completely separate from the AA telephony call protocol).

Some initial solutions done to fix to the issue while using headunit V1.02 ;

1. COMPLETELY Disable Bluetooth on the Infotainment Side. This will force the AA app on the phone side not to initiate a bluetooth link to the car as the headunit program on the MZD side will not report any active bluetooth connection to the AA app. Navigation/Google Voice/Spotify-Google Play Music Audio will still pass through via the USB link AOA2 protocol.

2. Disable SMS Notification on the CMU Infotainment side. This will prevent a CMU - SMS screen takeover and it will always stay on the AA headunit screen whenever you receive or send SMS messages.


3. Because there is no Bluetooth connection, the AA Telephony screen is deactivated. To activate that Screen (Dialpad, Call Logs, SMS , etc.) , you need to click "Unknown sources" at the phone side AA app ; About --> Developer Settings --> "Unknown Sources". You also need to set About --> Developer Settings -->Application Mode --> "Developer".After doing this, you will have complete access to dialpad, Phonebook, SMS, etc. even without the bluetooth connection.


The only thing left out is routing the Phone Call Audio back to the car. ANY IDEAS here ? :) Via USB Audio perhaps ? Through the car's auxillary port ? At least at this point there is no Bluetooth call on/off interruption bug and you have access to the dialpad :)

Right now, the phone is just a glorified speaker phone during phone calls once the above settings are in place

* In the meantime, i installed an extra app called "Tasker" that automatically puts the phone in Speakerphone mode during calls (outgoing and incoming) while AndroidAuto is running :)

https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm

and a much simpler app --

https://play.google.com/store/apps/details?id=com.androidm8.speakerphoneex
 

·
Registered
Joined
·
48 Posts
Thanks for this explanation!

What you mean by V1.07? Am I missing something?or is it just typing error and it should be 1.02?

I have already activated developer mode in AA app and I will test your idea of switching BT off in car as soon as I leave work...
 

·
Registered
Joined
·
33 Posts
Discussion Starter · #3 ·
Thanks for this explanation!

What you mean by V1.07? Am I missing something?or is it just typing error and it should be 1.02?

I have already activated developer mode in AA app and I will test your idea of switching BT off in car as soon as I leave work...
Sorry its a typo and already corrected it. Its V1.02
 

·
Registered
Joined
·
32 Posts
The other option would be perhaps to answer query about the bluetooth state - when you define the bluetooth there's a new channel opened meant for bluetooth metadata. Right after connection the phone AA queries the state over that channel - and it currently does nothing. Judging by the source of AA library, the packets there contain information like "Paired with HU", HU MAC, etc.

I guess if headunit could answer to the phone "ok, bluetooth is already connected and paired", the issue would go away as well.
 

·
Registered
Joined
·
33 Posts
Discussion Starter · #5 · (Edited)
The other option would be perhaps to answer query about the bluetooth state - when you define the bluetooth there's a new channel opened meant for bluetooth metadata. Right after connection the phone AA queries the state over that channel - and it currently does nothing. Judging by the source of AA library, the packets there contain information like "Paired with HU", HU MAC, etc.

I guess if headunit could answer to the phone "ok, bluetooth is already connected and paired", the issue would go away as well.
I've been experimenting the setup with an Ubuntu box plus the latest headunit git image and a Samsung phone connected to the unix box via USB and Bluetooth, The entire phone call process is seamless. It is just when we execute the headunit program on the infotainment it conflicts with the current telephony process (BTHF) of the CMU which means the current state of the headunit code seems to be ok except that we need to find a way to allow the AA phone app to co-share the existing bluetooth connection to the CMU.

Actually another possible option would be to temporarily disable the CMU's Telephony handling process while the bluetooth connection is active. Will test this later.

This is the process running on the CMU side which accepts bluetooth handsfree calls;

1724 root 0:00 {L_jciBTHF} /jci/sm/sm_svclauncher -l jciBTHF /jci/bthf/svcjcibthf.so -a


I also tested with the phone's bluetooth call connected to a BT headset while phone is connected CMU's AA headunit. Dialpad, etc. etc . are all working, spotify audio routed to the car via USB, Navigation voice prompts also working and is also routed to the car via usb. Phone call audio at this point is routed to the BT headset.
 

·
Registered
Joined
·
33 Posts
Discussion Starter · #6 ·
Ok. I did a quick experiment with the Bluetooth activated (both call and media profiles active), killed the /jci/bthf/svcjcibthf.so process. MZD CMU Telephony screen is gone and you will see the AA call progress popup on the headunit screen which is good.

I was able to establish the call. Bluetooth call connection is maintained and stable (no looping) but there is no audio both on the phone and the car. That means AA app on the phone is transmitting the call audio to the bluetooth connection and not on the phone speakers - thats good. But because there is no running process to receive the bluetooth call audio data and to transmit to the car speakers, it is expected that you will not hear the call audio on the car speakers. So im guessing that best/permanent fix is to replace the CMU telephony process " /jci/bthf/svcjcibthf.so" to a custommized CMU handsfree application that will redirect audio to the speakers. This is the same bluetooth audio stack such as "ofono" which i am currently using on ubuntu debug setup.

I am confirming that the bluetooth call bug is a resource conflict between the CMU Handsfree telephony process and AA's headunit program.

Doing such customization would make the AA integration seamless specifically on the phone call handling as there will be no CMU screen takeover during calls and SMS sending/receiving.
 

·
Registered
Joined
·
48 Posts
3. Because there is no Bluetooth connection, the AA Telephony screen is deactivated. To activate that Screen (Dialpad, Call Logs, SMS , etc.) , you need to click "Unknown sources" at the phone side AA app ; About --> Developer Settings --> "Unknown Sources". After doing this, you will have complete access to dialpad, Phonebook, SMS, etc. even without the bluetooth connection.
I was unable to activate that screen.

Kill the process? No possibility to set any priorities? ??

We have Bluetooth settings in menu where we can choose between audio only, phone only and both. Why it does not work as a process killer? :)
 

·
Registered
Joined
·
33 Posts
Discussion Starter · #10 ·
I was unable to activate that screen.

Kill the process? No possibility to set any priorities? ??

We have Bluetooth settings in menu where we can choose between audio only, phone only and both. Why it does not work as a process killer? :)
Sorry. My bad. You also need to set About --> Developer Settings -->Application Mode --> "Developer".

I will edit the first post.
 

·
Registered
Joined
·
48 Posts
I was unable to activate that screen.

Kill the process? No possibility to set any priorities? ??

We have Bluetooth settings in menu where we can choose between audio only, phone only and both. Why it does not work as a process killer?
Sorry. My bad. You also need to set About --> Developer Settings -->Application Mode --> "Developer".

I will edit the first post.
OK. Tested and it works.
 

·
Registered
Joined
·
33 Posts
Discussion Starter · #12 ·
OK. Tested and it works.
Great !

With all the GUI components working at hand and only the phone call audio - to Car speakers is missing. I think this setup is enough in the meantime.

I installed an app that automatically puts the phone is Speaker Mode whenever its proximity sensor (phone not near your ear) is not triggered. Thus for now i think this setup works and you can still manage phone and SMS through the CMU screen with the phone call audio on the phone's Speakerphone.


https://play.google.com/store/apps/details?id=com.androidm8.speakerphoneex


The rest (Spotify, Googlemaps, waze, Voice commands) works as is with the audio through the car speakers.
 

·
Registered
Joined
·
25 Posts
3. Because there is no Bluetooth connection, the AA Telephony screen is deactivated. To activate that Screen (Dialpad, Call Logs, SMS , etc.) , you need to click "Unknown sources" at the phone side AA app ; About --> Developer Settings --> "Unknown Sources". You also need to set About --> Developer Settings -->Application Mode --> "Developer".After doing this, you will have complete access to dialpad, Phonebook, SMS, etc. even without the bluetooth connection.


The only thing left out is routing the Phone Call Audio back to the car. ANY IDEAS here ? :) Via USB Audio perhaps ? Through the car's auxillary port ? At least at this point there is no Bluetooth call on/off interruption bug and you have access to the dialpad :)

Right now, the phone is just a glorified speaker phone during phone calls once the above settings are in place

* In the meantime, i installed an extra app called "Tasker" that automatically puts the phone in Speakerphone mode during calls (outgoing and incoming) while AndroidAuto is running :)

https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
So, I figured out how to turn on Developer mode in AA, lol. Go to About and tap on 'About Android Auto' (top left), 10 times, then in the 3 dot menu you'll see the developer options. In case people didn't know. :)

Now for your tasker task, I think I set it up correctly?
- Add Application: Android Auto (had 2 of them show up for some reason so I added both)
- Long press, Add State: Call, Any
- Add Task: Speakerphone, on
- Add Exit Task: Speakerphone, off
 
  • Like
Reactions: MechaBouncer

·
Registered
Joined
·
33 Posts
Discussion Starter · #14 ·
So, I figured out how to turn on Developer mode in AA, lol. Go to About and tap on 'About Android Auto' (top left), 10 times, then in the 3 dot menu you'll see the developer options. In case people didn't know. :)

Now for your tasker task, I think I set it up correctly?
- Add Application: Android Auto (had 2 of them show up for some reason so I added both)
- Long press, Add State: Call, Any
- Add Task: Speakerphone, on
- Add Exit Task: Speakerphone, off
I have not tried that approach. How was it ?

This one i tried using the same Tasker app and it works.

https://android.gadgethacks.com/how...holding-your-android-device-your-ear-0159325/
 

·
Registered
Joined
·
12 Posts
Do any of the Android Auto settings have anything to do with why AA is missing from my Applications in the CMU? I'd originally installed AA 1.02, decided I didn't want to deal with the Bluetooth bug, so tried downgrading to AA 0.99. Since then, AA doesn't show up in applications. Tried an uninstall of the head unit, followed by an install of the 0.99 head unit on a freshly formatted USB, and still no joy.
 

·
Registered
Joined
·
166 Posts
Do any of the Android Auto settings have anything to do with why AA is missing from my Applications in the CMU? I'd originally installed AA 1.02, decided I didn't want to deal with the Bluetooth bug, so tried downgrading to AA 0.99. Since then, AA doesn't show up in applications. Tried an uninstall of the head unit, followed by an install of the 0.99 head unit on a freshly formatted USB, and still no joy.
The AA app on the phone has no control over whether the app appears on the car. If you installed the "No More Disclaimer" mod as well, that should have added it to the app menu in the car even when the phone is not connected.
 

·
Registered
Joined
·
5 Posts
Will be watching this with interest, I installed AA and thought it was good but uninstalled it due to lack of Bluetooth phone calls. Is there any updates planned from 1.02 that may address this without a back door fix?
 

·
Registered
Joined
·
20 Posts
Tested the settings as suggested by EQMOD. Everything is working as expected :)

No issues taking calls with a bluetooth earpiece or the phone's speaker.
 

·
Registered
Joined
·
25 Posts
1 - 20 of 46 Posts
Top