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.

Enabling I2S support to route audio from WiLink8 to an external codec.

Hi,

 We are using the TI CC256x chip for customer. We have a requirement to route the SBC encoded audio to an external decoder. We are struggling to configure the I2S path.

What I have tried till now:

I tried using the following vendor specific command:

Command Name: HCI_VS_BT_IP_Set_Audio_Path(0xFD95)

root@stratos:~# hcitool cmd 0x3f 0x195 02 FF 00 FF 22 22 FF 31 FF 12 FF 11 FF 11 FF 11
< HCI Command: ogf 0x3f, ocf 0x0195, plen 16
  02 FF 00 FF 22 22 FF 31 FF 12 FF 11 FF 11 FF 11
> HCI Event: 0x0e plen 4
  01 95 FD 01

Could someone help us to route the audio over I2S successfully.

 

Thanks,

Kumar B.S.R.S

  • Hi,

    Please use the CC256x forum, for CC256x related questions.
    I think there is a slimier question, which was raised by you see http://e2e.ti.com/support/wireless_connectivity/f/660/t/387960
  • Hi,

    We are using WiLink8 in our product. we are trying to route encoded audio data from WiLink8 to an external decoder connected via I2S.

    we have verified the hardware connection FSync. Clk and Data in to external decoder. they are as per the requirement mentioned in here.

    http://processors.wiki.ti.com/index.php/CC256x_System_Design_Guide#PCM.2FI2S_Interface

    http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_CODEC_Config_.280xFD06.29

    I used the below Vendor specific command (codec_config)

    hcitool cmd 0x3f 0x0106 64 0x00 1638 0x0000 0x00 0x00 0 16 0x00 0x00 0x08 0x00 0x00 0 16 0x00 0x00 0x08 0x00 0x00 0

    For us WiLink8 is I2S master and external decoder is I2S slave.

    And i see that command goes through, when i scope the lines FSYNC and clk i do not see any signals.

    I am not sure if we need to do any thing extra? Can some one help here

    Are we missing anything in the firmware? is there proven firmware that has been worked for I2s..

    Thanks

    Vijay

  • Hi Vijay,

    You will only see the clock ticking when there’s active voice/audio..
    Upon removal of voice/audio, we’ll stop the clock. This is in order to save current consumption.
  • Hi Sundeep,

    My bad i should have mentioned that clk is not driven when there are audio/video data..

    clk gating is understood, but why there is not signal on the line when there is active data.. is there any debug point. how do we know if the  clk bit is set?

    we do not have access get any kind of firmware log.

    Is there an easy way to test I2S path?

    Thanks

    Vijay

  • Hi,

    I think it is because of either the codec configuration is not set properly or the hardware interface is not right.
    For hardware configuration see processors.wiki.ti.com/.../WL18xx_Module_Schematic_Checklist
    For codec configuration, note that to configure the PCM/I2S lines to work in I2S (using the PCM HW lines of the device), you should configure the fsync duty cycle to 50% (as the spec dictates).

    But before that I would first recommend you to check PCM loopback mode.
    For PCM loopback test, you just needs to run Initscript, run the codec configuration command, and then the PCM loopback command.

    Send_HCI_VS_Set_Pcm_Loopback_Enable 0xFE28, 0x1
    processors.wiki.ti.com/.../CC256x_VS_HCI_Commands

    You needs to make sure the device is configured to be PCM master, as otherwise the clock is provided by the host.

    Could you also let me know what platform are you using with WL18xx?

  • Hi Sundeep,

    we are using AM335x as reference platform. Host is the I2S master in our case, had to fake the audio stream and is generating clk so i can see clk and fsync on WiLink8 probe points, but still no data on I2S lines to external decoder. I verified hcidump and there is not data coming to host. But it is not getting routed to the decoder.

    As you said i suspect codec_config command.

    I think you need to educate us on the PCM loopback mode, referance documentation in the above link is not leading us anywhere. in what way does the loopback mode help us?

    Hardware interface is right i cross checked this.

    so here is the vendor specific command that i am sending for codec configuration.

    /*HCI_WRITE_CODEC_CONFIG*/

    hcitool cmd 0x3f 0x0106 64 0x00 1638 0x0000 0x00 0x00 0 16 0x00 0x00 0x08 0x00 0x00 0 16 0x00 0x00 0x08 0x00 0x00 0

    the event is success as mentioned in my earlier post.

    Thanks

    Vijay

  • Hi Vijay,

    1. hcidump won't give you any SCO data as it is routed over the PCM lines (and not over UART).
    2. The hcitool command that you have pasted is incomplete or wrong. It seems to me that in some cases, you have not account for multi byte parameters. Please see a detailed example below:


    hcitool cmd 0x3f 0x0106 0x00 0x02 0x00 0x80 0x3e 0x00 0x00 0x01 0x00 0x01 0x01 0x00 0x10 0x00 0x01 0x00 0x01 0x10 0x00 0x01 0x00 0x00 0x00 0x10 0x00 0x11 0x00 0x01 0x10 0x00 0x11 0x00 0x00 0x00


    This is the command for the below parameters:

  • Hi Sundeep,

    1) The use case we are trying is not HFP (so sco does not come in to picture). The use case is A2DP, What i was trying to point by saying we do not see audio packets in the hcidump was controller is trying to route the data on I2S to the external decoder attached and not to the host through UART.

    2) I did try the command you shared still there is no data on the decoder..

    I have one basic question. Is this command or the I2S path tested on WiLink8? If this does work on your setup, is it possible to share the BT firmware.

    I do not have hcitester that you are using to cross verify using the gui utility.


    Thanks
    Vijay

  • Hi,

    Sorry my bad, In that case without running any codec configuration command, can you just establish a A2DP connection and see if it works.
    If you are still facing the problem please do provide me the Service pack (BTS file) you are using, I jut want to make sure that there is no codec configuration command in it.
  • Hi Sundeep,

    Yes i can establish A2DP connection without running codec configuration command.

    this is where we got the bts file.

    github.com/.../TIInit_11.8.32.bts

    Thanks

    Vijay

  • Hi,

    The Service pack file you have provided includes codec configuration.

    Going forward please do use the Service packs from location https://git.ti.com/ti-bt/service-packs/trees/master/, as the github is no longer tracked.

    So do you mean to say that you were able to send audio data after establish A2DP connection?

    Anyway the Service pack you provided and the ones from the new location are configuring the codec configuration command. Please try with the attached Service pack If you are still having the problem in sending the data where i have removed the Codec configuration from the Service packbts.zip

  • Hi Sundeep,

    Any updates for I2S path?

    Thanks
    Vijay
  • Sorry over looked your answer. yes i can stream audio data over A2DP if i use UART path.
    My only worry is on the I2S path where i do not see SBC encoded data on to my decoder.


    Thanks
    Vijay
  • Hi Sundeep,

    we cross checked with latest .bts file that you have shared. sorry this did not help us much.
    Before that i would like to understand the solution we are trying here.

    If i understand the correctly sbc encoded audio data can be routed via I2S (instead of the default UART path) using the codec config command that we recently discussed correct?
    By disabling it from bts file what we are trying to address? or is it that the default codec config is not supposed to be used we should manually set it as per the need.

    Any way i tried both.
    1) Use the bts file as is
    2) send the codec config command as we discussed above and try to see if we can see data.

    Both time i do not see any sbc encoded data on the decoder.


    OK one more thing that i tried to rule out problem with external decoder.
    Instead trying to decode the data on the decoder, tried to loop back the data from decoder. And record it on the arm using g-streamer.
    audio data is always NULL.



    Thanks
    Vijay
  • Hi Sundeep,

    Any pointers for us to debug further.



    Thanks
    Vijay
  • Hi,

    Sorry for the delay.

    Yes, to configure route the audio to I2S, You need to configure codec configuration command.
    It MUST be routed over PCM (I2S) lines if A3DP (assisted) is used. If it’s A2DP, then it’s over HCI interface.
    You needs to make sure you are using A3DP and not A2DP. I hope you know the difference between the two modes.

    For using the A3DP (source) you need to run the below commands see processors.wiki.ti.com/.../CC256x_VS_HCI_Commands
    If otherwise it’s pure A2DP, and it’s over HCI interface
    1. HCI_VS_AVPR_Enable
    2. HCI_VS_A3DP_Open_Stream
    3. HCI_VS_Write_CODEC_Config
    4. HCI_VS_A3DP_Codec_Configuration
    5. HCI_VS_A3DP_Start_Stream