Sorry for delay. I was a bit busy today. Here is my workaround for bt issue:
2) device tree
Honestly this workaround is terrible (explanations will be provided below) and disabled by default. You should add two parameters to vendor config in order to activate it:
- Enable/disable the fix. TRUE/FALSE. Default value is FALSE.
- SCO codec. Use the numeric value from the sco_codec_t
enum. Default value is SCO_CODEC_CVSD.
Seems that the problem lies in firmware for our BT chip and eSCO command set. Controller have invalid audio configuration or doesn't have any audio configuration at all after firmware upload. That was not a problem before this change
for research). I've tried a solution
proposed by @Sashko98
but nothing changed. After a couple of days playing with different parameters in configs i noticed interesting line in logcat:
filter_incoming_event command complete event with no matching command (opcode: 0xfc6d)
is a HCI_VSC_WRITE_I2SPCM_INTERFACE_PARAM
constant defined here
and used inside of the hw_sco_i2spcm_config
method. Seems that bt controller responds to HCI_VSC_WRITE_I2SPCM_INTERFACE_PARAM
command. But why we still have an issue with audio? The answer is simple: SCO configuration can not be completed because bt_hci blocks events and callbacks are not called at all! If device uses SCO_INTERFACE_PCM
bus interface then hw_sco_i2spcm_config
method will send 3 commands: HCI_VSC_WRITE_I2SPCM_INTERFACE_PARAM
. Each next command will be sent only if previous was sent successfully and controller responded with correct status. Сontroller responds, but bt_hci blocks the very first event and SCO configuration fails.
We have 2 possible solutions here:
1) Understand why bt_hci blocks events... This is ideal solution, but not easy! bt_hci is a part of system bluetooth stack and bluetooth stack is huge!
2) Send all the necessary commands without waiting for response from bt controller. Yep, i know how it sounds but it works! At least for now...
I've implemented solution #2. Look at hw_config_continue_sco_setup
method. It works just like the hw_set_SCO_codec
method but doesn't wait for response from bt controller. Why the hw_set_SCO_codec
? Because it sends one more command related to WBS before calling the hw_sco_i2spcm_config
As i said before i think this solution is terrible. Here are my concerns about it:
1) Uncontrolled commands sent to bt controller. Who knows how long this will work...
2) Can be applied only for broadcom chips.
That's all I found at the moment. I will try to implement the solution #1, but I can't tell whether it will work. Feel free to contact me if you have any questions/ideas/improvements.
Many thank to devs who still support our old hammy! @razorloves
and many other! You guys are awesome! Thanks a lot for your work!!! All this would be impossible without you!!!
PS: Sorry for my terrible english