This is just a small python program that pokes pulseaudio to set the profile of my bluetooth headset to a2dp and also to remind me how to fix it.
venv just creates a virtual env and enters it.
venv create --py3 pulseaudio pip install pulsectl
headset-setup a2dp
There are loads of bugs and askubuntu questions and things that mention pulseaudio not able to set up a2dp.
My big aha! moment was realizing if i pushed the 'pause' button on my headset that all of a sudden i could then change the input to a2dp.