Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make A2DP and HSP work simultaneously

I have a bluetooth headset. When connecting it to Windows 10, it installs two profiles in Playback devices list:

  1. Hands-Free. (HSP profile)

  2. Stereo. (A2DP profile)

The Second one (Stereo) is set to be the "Default Device" and the "Default Communication Device" on the system.

When I start any program that uses the mic (recorder, chat, VoIP Calls, gaming, etc.) The sound suddenly stops working And I can only use the mic until I stop the recorder or the call.

To enable the sound again I need to make the Hands-Free (HSP) profile handle both input and output (sound and mic). Unfortunately, HSP gives really poor sound quality.

I want to know If there is a way, using code, I can change Bluetooth behavior so the two profiles work simultaneously. One handles the sound and one handles the mic so I can have high quality sound and use the mic at the same time.

like image 247
onlyforthis Avatar asked Dec 03 '16 18:12

onlyforthis


People also ask

What is HFP and A2DP?

A2DP (Advanced Audio Distribution Profile) - high-quality audio playback, appropriate for e.g. listening to music. HSP (HeadSet Profile) - phone-quality audio playback and recording, appropriate for phone calls. HFP (Hands-Free Profile) - same as HSP, but with additional functionality for managing phone calls.

Is A2DP bidirectional?

A2DP is not a bidirectional profile. So it will not get bi-directional audio.

What is HSP profile in Bluetooth?

A Bluetooth profile that enables wireless connection between a phone and a Bluetooth headset. It supports simultaneous two-way audio but not stereo. It is one of the most common profiles with only a small number of phones supporting only the similar Handsfree profile.

What is A2DP Avrcp?

Perhaps the most common use case for A2DP and AVRCP is the wireless headset with simple remote control capabilities: playing, pausing and volume control. The A2DP Sink enables audio streaming from an audio source, whereas AVRCP Controller facilitates over-the-air control of the audio stream.


1 Answers

You will probably never find a solution. I had the same problem (I was trying to create a walkie talkie with 2 headsets connected to the same smartphone). On Windows (but also on Android) you can't access directly to a BT-microphone or BT-speaker because it is automatically detected as BT headset and the OS take the control of the device. Your app can then access the OS-device and not directly the hardware device. The only OS able to do that was Symbian I think which had the most BT-protocols. On Windows you will probably never be able to do that and on Android you have to write your own A2DP-protocol if you want to access the device directly without OS interference.

So sad...

like image 68
Adriano Avatar answered Oct 20 '22 00:10

Adriano