Routing Media Audio to Headset in BTstack’s HSP_HS Example on ESP32

45 views
Skip to first unread message

Dhruv Menon

unread,
Sep 7, 2024, 5:43:39 AM9/7/24
to btstack-dev

Dear BTStack Team,


I have just tested the current demo example of BTstack’s HSP_HS using an ESP32, and it is functioning seamlessly. However, I noticed that only the phone’s call audio is being routed to the headset. I would like to route media audio (such as music or app sounds) through the same HSP connection.


Could you please provide guidance on the steps required to achieve this?


Thank you for your assistance in advance.


Best Regards

Dhruv Menon


Dhruv Menon

unread,
Sep 10, 2024, 1:46:24 AM9/10/24
to btstack-dev
I also didn't notice any sine wave when I was testing the sample.

Any Guidance over this is appreciated.

Regards
Dhruv Menon

Matthias Ringwald

unread,
Sep 10, 2024, 5:03:43 AM9/10/24
to btsta...@googlegroups.com
Hi Dhruv

HSP only supports 8khz mono audio. To hear music, you'd need to convince your phone to route music over HSP, which a) depends on the OS and b) might not be possible.
You can try the HFP_HF example, which supports Wide-Band Speech, which gives you 16 kHz audio (or even Super Wideband with 32 khz if we find a phone that supports it).

For actual music, you need to use the A2DP profile, e.g. in the a2dp_sink_demo.

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/26dcb29b-4ba7-45d7-82fa-1dcfa31217edn%40googlegroups.com.

Dhruv Menon

unread,
Sep 10, 2024, 5:31:05 AM9/10/24
to btstack-dev

Dear Matthias Ringwald,


Thank you for clarifying the issue. Please correct me if I am mistaken, but it seems that we need to support both the HFP and A2DP profiles to enable access to both call and media functions. This approach would allow seamless switching between the two, that could align with the features offered by other headphone vendors.


Kind regards,

Dhruv Menon



Matthias Ringwald

unread,
Sep 13, 2024, 11:10:19 AM9/13/24
to btsta...@googlegroups.com
Hi Dhruv

You're correct: to cover both calls and music playback, you'll need to support both HFP HF and A2DP Sink, which is common in headphones.

Best regards
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/77e379ff-efde-4680-85ea-e89a18d0bca6n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages