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.

CC2564CSTBTBLESW: External audio codec(CVSD) implementation in normal HFP mode.

Part Number: CC2564CSTBTBLESW
Other Parts Discussed in Thread: CC2564C, CC2564

The CC564C BT controller has been used in BT 4.2 classic(A2DP and HFP) + BLE mode. Since, we are using BLE+HFP/A2DP simultaneously, BT controller can't be configured as assisted A2DP/HFP mode.

From the datasheet, it is clear that external audio codec has to be used to encode and decode audio data packets received over BT profiles in normal mode(A2DP/HFP).

Bluetopia v4.2.1 has SBC encoder and decode functionality. However, phones like oneplus 3T(Android 9.0), redmi note 7 pro(Android 9.0) uses CVSD audio codec in HFP profiles.

And blutopia stack doesn't contain any CVSD encoder/decoder functionality. We would like to get reference/code/examples on CVSD encoder and decoder. 

  • Akshay,

    Akshay P22 said:

    From the datasheet, it is clear that external audio codec has to be used to encode and decode audio data packets received over BT profiles in normal mode(A2DP/HFP).

    Bluetopia v4.2.1 has SBC encoder and decode functionality. However, phones like oneplus 3T(Android 9.0), redmi note 7 pro(Android 9.0) uses CVSD audio codec in HFP profiles.

    And blutopia stack doesn't contain any CVSD encoder/decoder functionality. We would like to get reference/code/examples on CVSD encoder and decoder. 

    The external codec IC and encoder/decoder are two different components. The codec IC performs ADC and DAC back and forth from analog audio to digital PCM signal. The PCM interface of the audio codec IC communicates with wither the I2S/PCM interface of the CC2564C controller (in the case of voice call or assisted A2DP) or the host processor (for unassisted A2DP).

    The coding schemes like CVSD and mSBC on the other hand are used to encode/decode the audio data between the PCM interface of the controller and the over the air transmission. The CC2564C firmware contains the implementation of CVSD encoder/decoder so there is no need to implement it on the host stack.

    Akshay P22 said:
    And blutopia stack doesn't contain any CVSD encoder/decoder functionality. We would like to get reference/code/examples on CVSD encoder and decoder.

    Like I mentioned above, the host stack would not need to encode/decode the CVSD frames as that is handled at much lower levels in the controller's firmware. Regarding the reference code / example for narrow band speech (using CVSD coding), you can make the following changes in the default HFPdemo_AG or HFPDemo_HF code example of the CC2564CSTBTBLWSW to restrict the demo to narrow band speech only. This way, you can also support BLE functionality while using narrow band speech for all connections.

    1. Exclude the HFRE_HF_CODEC_NEGOTIATION_SUPPORTED_BIT from the HFRE_SUPPORTED_FEATURES bitmask. So, it would look something like the following snippet.

    #define HFRE_SUPPORTED_FEATURES                    (HFRE_CLI_SUPPORTED_BIT | HFRE_HF_ENHANCED_CALL_STATUS_SUPPORTED_BIT | HFRE_HF_SOUND_ENHANCEMENT_SUPPORTED_BIT | HFRE_HF_VOICE_RECOGNITION_SUPPORTED_BIT)

    2. Skip the call to BSC_EnableFeature(BluetoothStackID, BSC_FEATURE_WIDE_BAND_SPEECH); in  OpenStack function.

    /* Skip the function call to enable WBS and set Result=1 parameter to continue with rest of the initialization. */
    //Result = BSC_EnableFeature(BluetoothStackID, BSC_FEATURE_WIDE_BAND_SPEECH);
    Result = 1;

    Best regards,

    Vihang

  • Thanks for reply Vihang.

    The requirement is HFP/A2DP + BLE working simultaneously. To achieve this configuration, BT controller can't be used as assisted HFP/A2DP mode.

    PCM/I2S lines of CC2564C are not useful in normal HFP configuration and hence we haven't used in our design.

    With reference to below snapshot from datasheet, normal HFP 1.6 Architecture of CC2564 doesn't contain mSBC where as in assisted HFP 1.6 Architecture, CC2564C contains mSBC.

    Normal HFP 1.6 - Stack(Bluetopia) contains mSBC in the MCU(STM32F412 in our case)

    Assisted HFP 1.6 - CC2564C contains mSBC.

    Due to design constraint in CC2564C, we are not able to use assisted HFP mode simultaneously with BLE. This means that mSBC has to be implemented in stack, which is available in bluetopia stack (This we have). However, We also need to have CVSD support in normal HFP profile because some phones like oneplus 3T, nokia 6.1 plus, redmi note 7 pro use only CVSD in HFP profile. Bluetopia stack v4.2.1 doesn't support CVSD.

    So, we need to implement CVSD in our controller(STM32F412) FW. Can we get references for the same?

  • Akshay P22 said:

    The requirement is HFP/A2DP + BLE working simultaneously. To achieve this configuration, BT controller can't be used as assisted HFP/A2DP mode.

    PCM/I2S lines of CC2564C are not useful in normal HFP configuration and hence we haven't used in our design.

    That is correct. However, to use narrow band speech - NBS (with CVSD), you do not need the assisted HFP. The assisted HFP is only when wide band speech - WBS (with mSBC) is used. The narrow band speech voice call and BLE can simultaneously run in the CC256x controller.

    Akshay P22 said:
    Normal HFP 1.6 - Stack(Bluetopia) contains mSBC in the MCU(STM32F412 in our case)

    This is not true. The SBC codec included in the Bluetopia stack is for use with A2DP use case, not for HFP or WBS.

    Akshay P22 said:
    Due to design constraint in CC2564C, we are not able to use assisted HFP mode simultaneously with BLE. 

    Like I mentioned above, there are no constraints in the CC2564C controller that prevent the NBS voice (CVSD) and BLE operation simultaneously. The only constraint is that WBS voice and BLE cannot work together in the CC2564C controller. From your use-case, it appears that you want to use NBS anyways. So I do not see a reason why you would need to implement the CVSD codec in the host stack.

    Best regards,

    Vihang