I am using WL1831 bluetooth module on a custom board, whose main processor has to send audio to mono heasets through bluetooth HFP/HSP profiles. The board I am working on has just UART connection, since the main processor lacks PCM controller. So, I want audio to go through HCI.
My setup is the following:
- bluez 5.34
- pulseaudio 6.0 with bluez5 module support
- ti wl18xx driver and firmware 8.5R, TIInit_11.8.32.bts file
I am able to pair and connect to headsets, so I think driver + Bluez stack is fine. After connection, pulseaudio creates bluetooth source and sink devices (through module-bluez5-device). I also send these HCI commands to wl1831, in order to enable SCO over HCI:
# Route SCO connection over HCI instead of PCM
hcitool -i hci0 cmd 0x3f 0x210 0x01 0x00 0x00 0x00 0xFF > /dev/null
When I play any audio file to headsets, the sound is distorted, as if sampling frequency were wrong. Anyway, the sample specifications reported by PulseAudio are correct:
sample spec: s16le 1ch 8000Hz
So, why is sound distorted and how can I fix it?