Headphone volume button to control ubuntu volume?

Solution 1:

This Feature is called "absolute volume". Windows brought it in it's April 2018 Update [1]

For PulseAudio¹, this seems to be a work in progress. [2] [3]

¹ PulseAudio is the default sound-server on almost every major linux-distribution including ubuntu. It manages volume-control and audio-transmission to bluetooth-devices.

[1] https://mspoweruser.com/the-windows-10-april-2018-update-is-a-massive-upgrade-for-bluetooth-in-windows-10/
[2] https://patchwork.freedesktop.org/patch/76558/
[3] https://patchwork.freedesktop.org/patch/257674/

Update 2021-01-25: There is a MR[4] in the meanwhile. It seems that there is still a lot of work but it's in active development.

[4] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/239

Update 2021-09-07: PipeWire has it! I couldn't become it working under ubuntu 20.04, even with pipewire from [5], I think bluez is too old :(. But it works fine on fedora 34 :)

[5] https://pipewire-debian.github.io/pipewire-debian/