Bluetooth Audio Profile?


I am trying to understand what kind of Bluetooth profile do I need for a wireless speaker in order to only let the speakers control the volume not the phone, opposite to what people ask on the links below.

I don’t need any kind of track, play/pause control on the speakers, only volume. The reason for that is that I want the highest volume setting being sent from the phone and let the user control the volume on the speakers. I think is not possible as it is normally the opposite what you will want. I cant think of any device that does that, maybe with HMDI I might have seen the audio volume control greyed out on my macbook.

Thank you,

I haven’t personally implemented this, just played with the systems a lot, so maybe someone else has better info, but:

A2DP is the stereo audio profile that includes both the audio itself, and the control channel for volume/skip/play pause (maybe other stuff? I don’t think so though).

When you’ve got a speaker that controls its own volume but doesn’t impact the source’s, that’s easy enough to implement - simply implement a volume control on your product that never notifies the bluetooth stack of what it’s doing, and ignores any volume signals coming the other direction.

It sounds like maybe the same strategy would work for you? I’m not clear on your ask, but it sounds like you’re trying to implement a bluetooth speaker that just ramps the source’s volume up all the way, then handles its own amplification factor separately to that. If that’s the case, it’d be easy enough to implement but maybe a bit finnickey. For instance, do the same thing above, but on connection, send the “volume up” command a bunch of times to get the device loud, then do whatever you do for speaker-side volume control. I THINK A2DP does give you the source volume in % so you can synchronize appropriately. If so, you could use that to raise the volume to max upon connection, then stop. The question is what do you do from then on? Do you process “volume down” messages and send the opposite, so the user’s phone fights them trying to lower the volume? Do you periodically check the current source volume and send volume-up messages to max it again?

There’s another consideration here too: some sources “overdrive” at maximum volume and actually send a clipped, distorted signal over bluetooth when at 100%. If I have an option (like in a car), I typically set the phone volume to max then come down two notches so that I know the source is digitially maximum without clipping, then the car amplifier can do its best work.

I think these foibles and edge cases are why most modern devices just synchronize - that lets the user control volume predictably from either end, and takes the guesswork out of clipping/distortion/getting blasted by sound/getting no sound despite tapping + over and over on the speaker, etc.

1 Like

Someone else going to do the coding on this project but I need to understand it, initially I assumed it was something very trivial.

Thanks for taking the time to answer my question, I have more to investigate.

I was able to implement a BT A2DP audio player using this sample code from Espressif:

In there is a function hook for volume adjustments – the demo auto adjusts the volume from the ESP32 side:

Look for volume_change_simulation(void *arg)