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.

Linux/WL1837MODCOM8I: Assisted A2DP (A3DP) AM5728

Part Number: WL1837MODCOM8I
Other Parts Discussed in Thread: WL1837, BEAGLEBOARD-X15

Tool/software: Linux

Hi Folks,

I was trying to get audio streaming/capture over  the PCM interface, I am using linux version 4.4, bluez version 5.41 and pulseaudio-9.

I was able to  capture audio, but it was via uart interface and not via PCM, is there some sort of init I am missing to get it working with the PCM interface.

We have MCASP2 connected to BT PCM, the pinmux is done and enabled as well:

        mcasp@48464000 {
            compatible = "ti,dra7-mcasp-audio";
            ti,hwmods = "mcasp2";
            reg = <0x48464000 0x2000 0x45c00000 0x1000>;
            reg-names = "mpu", "dat";
            interrupts = <0x0 0x95 0x4 0x0 0x94 0x4>;
            interrupt-names = "tx", "rx";
            dmas = <0xaf 0x83 0x1 0xaf 0x82 0x1>;
            dma-names = "tx", "rx";
            clocks = <0xf5 0xf6 0xf7>;
            clock-names = "fck", "ahclkx", "ahclkr";
            op-mode = <0x0>;
            tdm-slots = <0x2>;
            serial-dir = <0x1 0x2 0x0 0x0>;
            tx-num-evt = <0x20>;
            rx-num-evt = <0x20>;
            status = "okay";
        };

Thanks,

Mike

  • Mike, Are you using AM572x EVM? Default, Bluez uses A2DP. For using A3DP, you would need to program the Codec with VS commands for PCM connection from controller, and the external codec separately from AM572x..

    Thanks
  • Hi Hari,

    Its a custom board based on am572x. I want to test the PCM interface on wl1837 using bluez and pulse audio.
    I have followed link [1] and applied the patch "New Feature: BT PCM integration on the AM335x EVM".
    With this I get :
    [ 9.079359] asoc-simple-card sound@1: wilink8_bt-hifi <-> 48464000.mcasp mapping o

    root@am572x:~# arecord -L
    null
    Discard all samples (playback) or generate zero samples (capture)
    pulse
    PulseAudio Sound Server
    default
    Default ALSA Output (currently PulseAudio Sound Server)
    sysdefault:CARD=BeagleBoardX15
    BeagleBoard-X15,
    Default Audio Device
    sysdefault:CARD=WILINKBT
    WILINK-BT,
    Default Audio Device
    root@am572x:~# aplay -L
    null
    Discard all samples (playback) or generate zero samples (capture)
    pulse
    PulseAudio Sound Server
    default
    Default ALSA Output (currently PulseAudio Sound Server)
    sysdefault:CARD=BeagleBoardX15
    BeagleBoard-X15,
    Default Audio Device
    sysdefault:CARD=H58040000encode
    HDMI 58040000.encoder,
    Default Audio Device
    sysdefault:CARD=WILINKBT
    WILINK-BT,
    Default Audio Device

    But when I pair and try to record I dont see any clock on BT audio.


    I am not sure what exactly you meant by "program the Codec with VS commands for PCM connection from controller," you mean the WILINK8 chip ?

    And also "external codec separately from AM572x.." How should I do that ?

    [1] processors.wiki.ti.com/index.php

    Thanks,
    Mike
  • Hi Hari,

    I have AM572x EVM as well, I can try it on this as well. What macsp interface the wl18x is connected ?

    Thanks,
    Mike
  • Mike,
    Let me check and get back. I believe, the patch you mentioned above if for AM335x, and it routes PCM from controller to AM335x McASP port to TLV codec. I believe, there was a limitation on AM335x EVM, that did not allow direct PCM connection from WL18xx to External codec.

    Thanks
  • Hi Hari,

    If I am not getting you wrong you mean the following path:
    Headset ---> WLINK8 ----> Codec (TLV) ----->MCASP2 ---->>> Store to file ?

    But shouldn’t this be ?

    Headset --> WILINK8--->MCASP--->> Store to file ?

    I don’t want to connect a external codec to wilink, I want audio to be captured from PCM interface which is bluetooth microphone.
    And simultaneously use ble devices to use UART.

    For A2DP can I use it over PCM instead of uart and let the LE connections from UART ?

    Thanks,
    Mike
  • Alright.. I mis-undestood your desired configuration. Sure, for PCM MIC capture, your routing seems correct.. I need to check on Codec PCM configuration options with Bluez (i.e when and how to send Codec VS commands) and AM572x EVM McASP connection to COM8 port and get back to you..

    Thanks
  • Hi Hari,

    Looking at [1] on am572x evm mcasp7 is connected to P12 connector, so I guess we need to enable mcasp7 + pinmux and apply patch which I posted in my earlier post.

    I found some commands to configure the codec [2], but no luck so far, Looking at the patch I can see that the wifi BT module is registered as the codec, but we need to tell the wilink8 chip to route the audio data via AUDIO interface and not by UART.

    [1] processors.wiki.ti.com/.../AM572x_General_Purpose_EVM_HW_User_Guide
    [2] processors.wiki.ti.com/.../CC256x_VS_HCI_Commands

    Thanks,
    Mike
  • Hi Mike, We, do not seem to have a ready made example for A3DP in linux environment. We have for MCU based Bluetooth stacks with A2DP restricted to SBC codec.. I am checking with our BT experts, on the commands needed for putting device into A3DP mode and this may take a day or two..

    Thanks
  • Hi Hari,

    Thanks for the reply I'll wait for your inputs.

    Thanks,
    Mike
  • Mike, If, you are using HFP controller should automatically route PCM.
    On the other hand for A3DP on linux. You would need to do the following. (I have n't tried it myself)
    Set up the connection with a2dp profile, then -
    a) using 'HCI_VS_Write_CODEC_Config' configure the controller's PCM port
    b) using 'HCI_VS_A3DP_Codec_Configuration' configure the SBC codec
    c) Open the stream with 'HCI_VS_A3DP_Open_Stream'

    Details of the VS commands are at : www.ti.com/.../swru442a.pdf

    Thanks
  • Hi Hari,

    I have gone through the document, but still not had any luck!
    Do all microphone support HFP ? By default when I bootup I get handsfree:

    Controller 20:91:48:C3:D0:78
    Name: am572x-evm
    Alias: vb4
    Class: 0x200000
    Powered: yes
    Discoverable: no
    Pairable: yes
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v1D6Bp0246d0529
    Discovering: no


    I am using bluez, will connecting to Handsfree (0000111e-0000-1000-8000-00805f9b34fb) default to PCM ?

    I am not able to convert those HCI_VS_A3DP_Codec_Configuration to proper hci commands..

    Thanks,
    Mike
  • It seems, Bluez5 supports only A2DP. It ceased support for HFP.. So, you can only connect through A2DP with the headset.. If, you use TI Bluetopia stack, you can use HFP.