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.

Bluetooth HFP HF role setup

Our software is based on 4AJ2.1 release.

Based on http://www.omappedia.com/wiki/Audio_Drive_Arch, in our device, microphone is connected in DMIC1 port and speaker in MM_EXT_OUT back end. Both speaker and mic work fine.

Because our device is in HF role, after few days research, my initial guess is: after adev->mode is set as AUDIO_MODE_IN_CALL in audio_hw.c, I need to mix BT-VX-UL link and DMIC1_UL link,and send them to the speaker location(MM_EXT_OUT).

In tinymix, for bluetooth audio :

Set MUX_VX0/1 as BT Left/Right

Enable Sidetone Mixer Capture/Playback

Enable DL1 BT_VX Switch

For microphone:

Set MUX_UL10/11 as DMic0L/R

Enable DL1 Mixer Capture

Enable SDT mono Mixer

After picking up the mobile phone call, I still cannot hear any voice from the speaker. My questions can be summarized as:

1. How to route audio link properly described above?

2. Any extra changes needed to switch the orginal AG role into HF role? Thanks!

  • Hello,

    What platform are you using? Blaze or a custom omap board?

    If it is a custom board, then to which MCBSP is your BT connected? According to OMAP4460 TRM bluetooth should be connected to MCBSP3.

    In case you are using blaze board or the BT in your device is connected to MCBSP3 then to my knowledge except your settings you need to apply the examples shown in: http://www.omappedia.com/wiki/Audio_Drive_Arch#4AJ
    and the bluetooth should work fine.

    Best Regards,
    Yordan

  • Hello Yordan,

    We are using omap4430 customized board and all source codes are based on blaze 4AJ2.1 release. I remember blaze board is using MCBSP1 for BT audio transfer and so is our board. We don't have issue to stream audio to an A2DP headset, but the question is how to stream mobile call audio into our device using HFP.

    Best Regards,

  • We are using Bluez instead of Blueti for our case, will this effect the bluetooth audio routing?

  • Hello,

    To my knowledge this shouldn't affect the routing. I think the problem is properly configuring the profile.

    Here are some links I was able to find, that you can use as a reference:
    http://developer.android.com/guide/topics/connectivity/bluetooth.html#Profiles

    http://processors.wiki.ti.com/index.php/Android-Adding_Bluetooth_Profile

    Maybe someone else could elaborate on this topic.

    Another useful source of information is search in the Android (http://e2e.ti.com/support/embedded/android/default.aspx) & WiLink™ WiFi + Bluetooth (http://e2e.ti.com/support/wireless_connectivity/f/307.aspx) sections of the e2e forum.

    Best Regards,

    Yordan

  • After several discussions with  TI support, I finally could capture audio from bluetooth. Here are steps below

    1. Send HCI command Send_HCI_VS_Write_CODEC_Config to configure the wilink as audio PCM master base on link http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_CODEC_Config_.280xFD06.29

    hcitool cmd 0x3f 0x0106 0x00 0x0c 0x00 0x40 0x1f 0x00 0x00 0x01 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

    This means pcm clock 3072Khz (0xc00), fsync 8Khz (0x1f40), PCM master configuration

    2. enable BT channel in tinymix:

    Number of controls: 54
    ctl type num name value
    0 ENUM 1 DL1 Equalizer 4Khz LPF 0dB
    1 ENUM 1 Sidetone Equalizer Flat response
    2 ENUM 1 AMIC Equalizer High-pass 0dB
    3 ENUM 1 DMIC Equalizer High-pass 0dB
    4 INT 1 DL1 Media Playback Volume 115
    5 INT 1 DL1 Tones Playback Volume 115
    6 INT 1 DL1 Voice Playback Volume 120
    7 INT 1 DL1 Capture Playback Volume 0
    8 INT 1 VXREC Media Volume 0
    9 INT 1 VXREC Tones Volume 0
    10 INT 1 VXREC Voice DL Volume 0
    11 INT 1 VXREC Voice UL Volume 0
    12 INT 1 AUDUL Media Volume 0
    13 INT 1 AUDUL Tones Volume 0
    14 INT 1 AUDUL Voice UL Volume 120
    15 INT 1 AUDUL Voice DL Volume 0
    16 INT 1 SDT UL Volume 0
    17 INT 1 SDT DL Volume 120
    18 INT 2 DMIC1 UL Volume 140 140
    19 INT 2 DMIC2 UL Volume 120 120
    20 INT 2 DMIC3 UL Volume 120 120
    21 INT 2 AMIC UL Volume 120 120
    22 INT 2 BT UL Volume 120 120
    23 BOOL 1 DL1 Mono Mixer On
    24 BOOL 1 AUDUL Mono Mixer On
    25 BOOL 1 DL1 MM_EXT Switch On
    26 BOOL 1 DL1 BT_VX Switch Off
    27 BOOL 1 DL1 PDM_DL2 Switch Off
    28 BOOL 1 DL1 PDM Switch Off
    29 BOOL 1 Sidetone Mixer Capture Off
    30 BOOL 1 Sidetone Mixer Playback On
    31 BOOL 1 Capture Mixer Tones Off
    32 BOOL 1 Capture Mixer Voice Playback Off
    33 BOOL 1 Capture Mixer Voice Capture Off
    34 BOOL 1 Capture Mixer Media Playback Off
    35 BOOL 1 Voice Capture Mixer Tones Playback Off
    36 BOOL 1 Voice Capture Mixer Media Playback Off
    37 BOOL 1 Voice Capture Mixer Capture On
    38 BOOL 1 DL1 Mixer Tones On
    39 BOOL 1 DL1 Mixer Voice On
    40 BOOL 1 DL1 Mixer Capture Off
    41 BOOL 1 DL1 Mixer Multimedia Off
    42 ENUM 1 MUX_VX1 BT Right
    43 ENUM 1 MUX_VX0 BT Left
    44 ENUM 1 MUX_UL11 None
    45 ENUM 1 MUX_UL10 DMic0L
    46 ENUM 1 MUX_UL07 None
    47 ENUM 1 MUX_UL06 None
    48 ENUM 1 MUX_UL05 None
    49 ENUM 1 MUX_UL04 None
    50 ENUM 1 MUX_UL03 None
    51 ENUM 1 MUX_UL02 None
    52 ENUM 1 MUX_UL01 None
    53 ENUM 1 MUX_UL00 None

    3. Connect mobile phone and after phone call, call "tinycap /data/test.wav -d 2 -b 16 -c 2 -r 8000" to capture BT audio.

  • Right now the question is how to send audio to the BT chip by tools such as tinyplay.

    I enable DL1 BT_VX Switch and play 8KHz wav file from VX-DL port but didn't hear anything.