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: Audio Distorted Over HCI interface

Part Number: WL1837MODCOM8I
Other Parts Discussed in Thread: WL1837

Tool/software: Linux

Hello,

I am using wl1837 chip along with am57x, the stack is bluez 5.45 + pulseaudio 9.

I am trying to get HF/HS profile over HCI interface. To route over HCI interface I have given the below command:

hcitool cmd 0x3F 0x0210 0x01 120 511 0xFF

I am getting the data but the audio is distorted and voice is not clear.

Can anyone guide me on what could be the issue? When I use ad2p_source and record over HCI the audio quality is proper, but when I switch to headset_head_unit profile the audio is distorted.

Thanks,

Mike

  • Hi , We have assigned your query to relevant expert. We will get back to you shortly .

    Thanks
    Saurabh
  • I do not think, HS/HF profile is supported by Bluez5. How are you ensuring that the connection to the headset is done through HS/HF? It is likely that Bluez has connected to the headset through a2dp?

    TI recommends using Blutopia stack for better support of these profiles (processors.wiki.ti.com/index.php )

    Thanks
  • Hello,

    HS/HF is supported in combination with bluez5 + pulseaudio [1].

    $> pactl list cards

    Card #2
    Name: bluez_card.05_43_54_48_C3_C8
    Driver: module-bluez5-device.c
    Owner Module: 23
    Properties:
    device.description = "X7"
    device.string = "05:43:54:48:C3:C8"
    device.api = "bluez"
    device.class = "sound"
    device.bus = "bluetooth"
    device.form_factor = "headset"
    bluez.path = "/org/bluez/hci0/dev_05_43_54_48_C3_C8"
    bluez.class = "0x240404"
    bluez.alias = "X7"
    device.icon_name = "audio-headset-bluetooth"
    device.intended_roles = "phone"
    Profiles:
    headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: yes)
    a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: no)
    off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
    Active Profile: headset_head_unit
    Ports:
    headset-output: Headset (priority: 0, latency offset: 0 usec)
    Part of profile(s): headset_head_unit, a2dp_sink
    headset-input: Headset (priority: 0, latency offset: 0 usec)
    Part of profile(s): headset_head_unit


    So here the current active profile is headset_head_unit.

    [1] www.freedesktop.org/.../

    Thanks,
    Mike
  • Also to add HF/HS profile are over PCM by default, to route them over UART following command is used "hcitool cmd 0x3F 0x0210 0x01 120 511 0xFF"

    In this demo [1] is data captured via mcasp ? As I dont see any command for arecord.

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

    Thanks,
    Mike
  • I suppose, you have 'oFono' installed.. See this statement from pulse audio release :
    "PulseAudio depends on BlueZ for all Bluetooth functionality, and additionally oFono is required for HFP support"

    As, such your VS command to route SCO packets HCI seems Ok.
    Can, you capture 'btssnoop' logs when in HFP with hcidump i.e in btssnoop format? Also, if you have BT sniffer, please collect sniff logs to analyze further.
  • Hi Hari,

    Yes I have bluez5 + pulseaudio + ofono which in combination supports HFP support.

    I have attached the log in btsnop format. Fyi btsnoop is now part of btmon and not hcidump command.

    btsnoop.txt

    Thanks,

    Mike

  • Mike, We are not able to open the btsnoop log file. What is the stored format? We, tried to open with FT's Comscope.

    Thanks
  • Hi,

    I used btmon command to save the traces in btsnoop format :

    btmon --write btsnoop.txt

    Is there any alternative tool to get btsnoop dump ?

    Thanks,
    Mike
  • Hello,

    I have got it working but the only issue is one channel sound is completely noise (left channel) and right channel is proper:

    Try the following command:

    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 will setup pcm clock 3072Khz (0xc00), fsync 8Khz (0x1f40), PCM master configuration

    Now when you want to capture from mcasp:

    time arecord --device=sysdefault:CARD=WILINKBT -d 10 test.wav -c2

    Note: I have used the patch (gforge.ti.com/.../0001-Enable-BT-PCM-patch-for-AM437x.patch) from here processors.wiki.ti.com/.../WL18xx_TI_Bluetooth_Stack_HFPM_Demo_App .I am still working on it to get it properly working, the only issue is lack of proper documentation.

    Cheers,
    --Prabhakar Lad
  • Hello,

    Alright got it properly working for mono:

    hcitool cmd 0x3f 0x0106 0x00 0x08 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 sets up PCM clock to 2048kHz and frame sync to 8Khz.
    On the mcasp side do a mono record
    arecord --device=sysdefault:CARD=WILINKBT -d 10 test.wav -c1

    Cheers,
    --Prabahkar Lad
  • Hi Prabhakar,

    Thanks Ill try this and update you. Is it possible to get stereo as well.

    Thanks,
    Mike