Bluetooth Audio routing (SCO/HCI/A2DP)

Hello Everyone,
I am trying to figure out how this Android architecture will work. I would be grateful for any assistance you will provide on this. I have seen many discussions around which go in-depth however, bigger picture is not clear. So I am writing here to understand it

I am trying to work with Android ‘O’ and Bluetooth dongle. Currently we are working on the TI board to support it (TI doesn’t currently supporting BT in the new SDK release, earlier they have support for WLINK). I’ve seen discussion around TI /BT /WLINK here , Traditionally most of are using I2S instead of HCI and HCI is so discarded that latest google code is not supporting (broken) and TI has no support for HCI.

We are using the BT dongle 30%20AM through mini-USB cable, establish the interface over the HCI. Now, when we want to establish the Voice call we need SCO (SCO over HCI is broken) , so my concern here is how we should achieve the Voice call over the BT in this case. I am attaching a diagram of “MY” understanding and will appreciates any input or correction.

Specifically, I want to know the answers of the following questions:

  1. How we can do SCO in this case ( as we have USB no I2S)? Is HCI is the only way?
  2. With Android O,Fluoride latest code, do we need to set the A2DP Sink routing to work or it is working straight out of the box? I have seen some comments who agree it is working however I haven’t seen so far.
  3. If HCI is the only option then current Android O doesn’t support it , is there any alternative?

Please feel free to share your thoughts.

Standard USB dongle implements the Bluetooth class which only exposes a HCI interface. So HCI is the only way here. This is by the way the ‘official’ way to transmit SCO. In that case Audio encoding (CVSD) is performed by the host.

It should work out of the box, even if some chips offert I2C/PCM interface for A2DP as well, A2DP (ACL packets) usually goes through standard HCI interface, so this is something well supported by the Android BT stack.

  • Implement/fix it in Fluoride
  • Use bluez instead of fluoride (contact bluez mailing list to know the status)

Hello Loic,

Thank you for your valuable input.

Thank you again for clarification/confirmation on this.

Ok, that would use the current audio route(working for standard system audio) however, if you set the configuration as sink, is it still the same case? my current configuration looks as below (configured as A2DP sink, If I have both SRC/SINK ON, it always connect as SRC, so turn off):

21%20AM

I copied system logs here for reference, Captured immediate after I connect with the bluetooth A2DP profile and then play test sound.

Yes, this is considerable, Are they supporting Android O?

Hello Loic,

If we wants to correct HCI in android fluoride, is there any android version you can recommend which has the working HCI layer. I can see here Android N has HCI code which is removed in the Android O. Can you make suggestion or appriopriate input on porting these changes to Android O release.

Thank you in advance for any help you can provide us.

EDIT 1: That would not be a good idea, just checked they have changed the types and a lot more. may be the best idea would be to fix it instead porting.

EDIT 2: I wonder if they ever compiled the code for HCI, with latest version, After I fix more than 5 buys, there are variables/methods introduced in the code JB.4.2, who have no header files and declaration anywhere (Eg. tBTUI_SCO_CODEC_CFG, btui_sco_codec_open, btui_cb and many more). These error popup after I set the BTM_SCO_HCI_INCLUDED flag to true.

I don’t think if anyone ever tried SCO over HCI with Android bluetooth stack (Fluoride)?

I think this has been done used maybe at the very beginning of Android and code has not been well maintained, this could also be legacy untested code from Bluerdroid, initially developped by Broadcom. So except if you have time and strong knowledge in BT/SCO to re-implement the solution, I would not take this way.