This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2564C: Assisted WBS not working with Linux/Bluez5.43

Part Number: CC2564C
Other Parts Discussed in Thread: CC2564

I am unable to get HandsFree voice over PCM with assisted WBS mode of CC2564C. I have managed to get the system working with 8KhZ (NB voice) PCM sampling. As soon as I switch to WBS using HCI_VS_Write_CODEC_Config, I get a sped-up (chipmunk) voice. I have disabled Ant, Ant patch, BLE  and applied the AVPR patch as suggested on the forum. Init sequence is detailed below. Am I missing anything? Can you please provide some pointers that can help me debug this issue?

 http://processors.wiki.ti.com/index.php/CC256x_Advanced_Voice_and_Audio_Features#WB_Speech

https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/749492

AVPR Patch used (initscripts-TIInit_6.12.26_avpr_add-on.bts): git://git.ti.com/ti-bt/service-packs.git

Linux kernel version: 4.4.84

Bluetooth Stack: Bluez5_5.43 

BT Init sequence:

1. HCI Attach: Load the bts file (TIInit_6.12.26.bts)

2. Load AVPR patch: initscripts-TIInit_6.12.26_avpr_add-on.bts

3. Disable Ant: hcitool cmd 0x3f 0x1D0 0x00 0x00 0x00

4. Disable BLE: hcitool cmd 0x3f 0x15B 0x00 0x00
5. Connect to phone.
 
6. WBS Associate: hcitool cmd 0x3f 0x178 0x01 0x00
 
7. Write Codec Config:
a. 16KHZ LRCLK/512KHz BCLK: Sped-up voice
hcitool cmd 0x3f 0x106 0x00 0x02 0x00 0x80 0x3e 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x01 0x00 0x01 0x10 0x00 0x01 0x00 0x00 0x00 0x10 0x00 0x11 0x00 0x01 0x10 0x00 0x11 0x00 0x00 0x00
b. 16KHZ LRCLK/3072KHz BCLK: No voice
hcitool cmd 0x3f 0x106 0x00 0x0C 0x00 0x80 0x3e 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x01 0x00 0x01 0x10 0x00 0x01 0x00 0x00 0x00 0x10 0x00 0x11 0x00 0x01 0x10 0x00 0x11 0x00 0x00 0x00
c. 8KHZ LRCLK/256KHz BCLK: Normal voice, working correctly
hcitool cmd 0x3f 0x106 0x00 0x01 0x00 0x40 0x1f 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x01 0x00 0x01 0x10 0x00 0x01 0x00 0x00 0x00 0x10 0x00 0x11 0x00 0x01 0x10 0x00 0x11 0x00 0x00 0x00
 
8. Set voice profile: hciconfig hci0 voice 0x0063 up
9.  Initiate voice call.

  • A few comments:

    • The order of your commands is different than shown at http://processors.wiki.ti.com/index.php/CC256x_Advanced_Voice_and_Audio_Features#Software_Setup_for_Assisted_WBS
    • For example, the very first command shown is to disable BLE and ANT.  You should do that before you load the AVPR firmware.
    • Your commands for disabling BLE/ANT don't match the commands shown in the wiki.
    • HCI_VS_Write_CODEC_Config happens before WBS Associate.
    • Before WBS Associate, the wiki shows executing HCI_Write_Voice_Setting 0x0063
    • After WBS Associate, the wiki shows HCI_Setup_Synchronous_Connection.

  • Hi Brad,

    I had used the sequence from the flow sequence diagram just below the description. Looks like they are not consistent. Anyways, i have tried both and it does not make a difference. I have few more observations that I missed before, might help:

    1. BLE disable command returns an error 0x0C. You pointed out that my commands don't match wiki page. I had to reformat the commands for bluez's hcitool, but payload and opcodes are same as Wiki page. Can you please specify what exactly you think is wrong?

    2. WBS Associate commands require an ACL handle. Wiki page uses 0x01, but is this a generic handle or can it change on my setup?

    3. HCI_Setup_Synchronous_Connection always returns an error if run manually. My understanding was that this should be handled by Bluez during call setup.

    4. CC256xC datasheet mentions some changes related to WBS between B and C chip. Wiki page is for B chip. Can this somehow be related?

  • I get this error on btmon when running the command below:

    HCI_Setup_Synchronous_Connection 1, 0x1f40, 0x1f40, 0xE, 0x0063, 0x02, 0x03c8

    hcitool cmd 0x01 0x028 0x01 0x00 0x40 0x1F 0x00 0x00 0x40 0x1F 0x00 0x00 0x0E 0x00 0x63 0x00 0x02 0xc8 0x03

    hcitool cmd 0x01 0x028 0x01 0x00 0x40 0x1F 0x00 0x00 0x40 0x1F 0x00 0x00 0x0E 0x00 0x63 0x00 0x02 0xc8 0x03

  • Can, you take FW logs, to check the reason for the error status to connection setup.

    http://www.ti.com/lit/ug/swau058d/swau058d.pdf

    Thanks

  • Please note that with WBS I get no voice on 1st attempt. Then I disconnect and connect again from the phone. I then get the sped up voice. This log should show this issue aswell.

    I have also attached a nbs log with 8k fsync fyr.

    cc2564c_wbs_issue.zip

  • From the FW logs, it seems the first 'Rejected due to Limited Resources' is in fact coming from the remote/peer device. It is rejecting the eSCO link req..

    21102 07/08/19 18:32:09.253 0x0000C0BB 0x038E2300 HCI_Setup_Synchronous_Connection ---->
    21103 07/08/19 18:32:09.253 0x0000C0BB 0x038E2300 <---- HCI_Command_Status_Event
    21127 07/08/19 18:32:09.291 0x0000C0D0 0x038E2315 LMP_eSCO_link_req ----> eSCO handle = 0, eSCO LT_ADDR = 0, timing control flags = 2, D-eSCO = 0, T-eSCO = 6, W-eSCO = 4, SCO packet type M->S = 7, SCO packet type S->M = 7, Packet Length M->S = 30, Packet Length S->M = 30, air mode = 3, negotiation state = 0
    21128 07/08/19 18:32:09.291 0x0000C0D3 0x038E2318 <---- LMP_not_accepted_ext escape opcode = 127, extended opcode = 12, error code = 13
    21129 07/08/19 18:32:09.292 0x0000C0D3 0x038E2318 <---- HCI_Synchronous_Connection_Complete_Event

    In the second connection, when you have sped up voice, does it last long or disconnects by itself? On the host side, you taking care of the McASP/BSP configuration for the correct bit rate right?

    Thanks

  • Hi Hari,

    Sped up connection continues and does not drop until disconnected. On the host side, we have an ADAU1467 DSP which acts as an I2S slave. I have tried word lengths of 16 and 32, without any difference. I am not sure what you mean by bit rate configuration as I2S slave should such sync with the Master clk which is CC2564C in this case. I have configured the polarities of clk and fsync.

    My remote device is a iphone 7. I can try a different phone, why is it rejected? Any suggestions?

  • Hi,

    Are, you configuring the Data delay for each channel on the ADAU1467 DSP? If, you have at '0', please try with '1' and see if it improves the voice quality. 

    Thanks

  • Hi Hari,

    All I2S parameters are matched between DSP and CC2564. I have it all working perfectly fine with NBS (8KHz). 

  • Hi Hari,

    I tried WBS on PCM loopback mode and it works!!! I send a 1KHz sine wave to CC2654 and 1KHz sinewave come out. Analyzing the issue with phone I have made this new observation.

    In my case CC2564 is on a device running HFP and remote device/phone is an HF audio gateway. As mentioned earlier "HCI_Setup_Synchronous_Connection " returns an error. But during the call, Phone (HF AG) sends "Accept Synchronous Connection Request" with CVSD mode which I understand uses 8Khz sampling. So CC2564 is trying to decode 8Khz CVSD samples as 16Khz mSBC samples. That explains the sped up voice.

    But I am not sure what the solution is? Why is HF AG forcing CVSD sample rate, is part of LLC negotiation? Is host software supposed to switch between 8KHz and 16KhZ Fsync based on "Accept Synchronous Connection Request"? Why can't CC2564 handle it autonomously once WBS mode is enabled?

    < HCI Command: Accept Synchronous Connection Request (0x01|0x0029) plen 21                                                                                                                                                  [hci0] 27.193601
            Address: 90:97:F3:F7:33:31 (OUI 90-97-F3)
            Transmit bandwidth: 8000
            Receive bandwidth: 8000
            Max latency: 65535
            Setting: 0x0060
              Input Coding: Linear
              Input Data Format: 2's complement
              Input Sample Size: 16-bit
              # of bits padding at MSB: 0
              Air Coding Format: CVSD
            Retransmission effort: Don't care (0xff)
            Packet type: 0x003f
              HV1 may be used
              HV2 may be used
              HV3 may be used
              EV3 may be used
              EV4 may be used
              EV5 may be used
    > HCI Event: Command Status (0x0f) plen 4                                                                                                                                                                                   [hci0] 27.194687
          Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
            Status: Success (0x00)
    > HCI Event: Synchronous Connect Complete (0x2c) plen 17                                                                                                                                                                    [hci0] 27.234450
            Status: Success (0x00)
            Handle: 257
            Address: 90:97:F3:F7:33:31 (OUI 90-97-F3)
            Link type: eSCO (0x02)
            Transmission interval: 0x0c
            Retransmission window: 0x02
            RX packet length: 60
            TX packet length: 60
            Air mode: CVSD (0x02)
    

  •   

    I found that WBS is negotiated by the remote device using “Accept Sync connection request” command. I had to modify my host stack to fake mSBC codec support although, decoding is done by CC2564. So WBS now works fine in assisted (PCM) mode.

    I still need the information I asked for before to continue with this solution:

    Is host software supposed to configure CC2564C for 8KHz and 16KhZ Fsync based on "Accept Synchronous Connection Request"? Can't this be handled by CC2564C autonomously if WBS is enabled?

  • Snehal,

    Sorry for the delay in response.

    Snehal Tangadpalliwar said:
    Is host software supposed to configure CC2564C for 8KHz and 16KhZ Fsync based on "Accept Synchronous Connection Request"? Can't this be handled by CC2564C autonomously if WBS is enabled?

    The host needs to configure this based on the profile level activities. One of the main reasons this action cannot be offloaded to the CC2564C controller is that even if the local CC2564C based system supports WBS, there is no guarantee that the remote device (e.g. headset or head-unit) supports WBS. Only after the profile level connection is established, two devices exchange their HFP feature set and the compatibility for WBS is determined. Thus, the host needs to write the appropriate codec configuration to the CC2564C controller for each connection.

    Best regards,

    Vihang

  • Hi Vihang,

    Thanks for your reply. Please see the 2nd point from the CC2564 wiki page snapshot below. That is exactly what we need. It does not match your explanation or maybe there I haven't understood this correctly yet. Can you please help.

    http://processors.wiki.ti.com/index.php/CC256x_Advanced_Voice_and_Audio_Features#Software_Setup_for_Assisted_WBS

  • Snehal Tangadpalliwar said:

    The 2nd point above mentions the support for both Narrow Band Speech(8K samples/second) and Wide Band Speech(16K samples/second). It does not mean both configurations are autonomously applied by the CC256x for the PCM interface. The host input for PCM codec configuration is still needed when switching between two configurations.

    Snehal Tangadpalliwar said:
    That is exactly what we need.

    So far, it is a bit unclear to me exactly what your system requirements are. Could you please list your requirements and assumptions, so we can have a clear discussion about the feasibility of such implementation.

    Best regards,

    Vihang