Esp-idf: HSP (IDFGH-1961)

Created on 4 Oct 2019  路  3Comments  路  Source: espressif/esp-idf

Linked to #1118 and more of a "how do I..." rather than an issue.

I have an ESP32 dev kit and a standard Bluetooth speaker (with mic). I can connect the ESP to my phone using HFP, seemingly with no issues, and receive SCO packets.

How can I use the bluetooth speaker/mic to send/receive audio? I am assuming HSP but can't find any documentation on this.

Note; ultimately I do not need the phone to be the gateway, in fact I don't need HFP at all. I am effectively setting up the ESP as a means to send I2S audio to a bluetooth speaker and pump out the bluetooth speakers microphone audio over another I2S line.

TIA

Most helpful comment

are there any examples for the HSP?

All 3 comments

Hi @howroyd ,
Bluetooth Hands-Free Profile defines two roles(configuration of devices): Audio Gateway(AG) and Hands-Free unit(HF). ESP32 Bluetooth host stack currently only supports HF, so it can connect to the phone which acts as AG.
As your bluetooth speaker also works as HF, it cannot work with the ESP32 currently.
HFP AG is under development on ESP32, and hopefully it can be released within a couple of months.

Your requirement is to transmit/receive audio stream with bluetooth speaker microphone. But Bluetooth audio link can only be set up according to the standard procedure defined in HFP which the standard bluetooth speaker follows.

As a gentle reminder, bluetooth (e)SCO link used in HFP to transmit audio has a limited bandwidth and audio quality. Typically, the audio stream is transcoded into CVSD or mSBC format through (e)SCO link, and finally the decoded audio stream is 8000Hz(for CVSD) and 16000Hz(for mSBC) sampled, 16-bit PCM stream. Please also check whether this quality is good enough for your application.

Thanks for the info.

The bandwidth limitations are fine for my application.

HSP is the preferred solution but I can't find any documentation on this. HFP is a fallback.

Is the esp32 capable of HSP now or in the future (how long until?).

Also, I am happy to assist HFP & HSP testing if you need help.

are there any examples for the HSP?

Was this page helpful?
0 / 5 - 0 ratings