The answer here doesn't go over HOW to enable AptX if you have a compatible AptX dongle.
11 Answer
Since I can not mark this as a duplicate:
The accepted answer to the linked question added the answer to this "question" as well. The linked github project adds support to pulseaudio for aac, aptx, aptx hd and ldac codecs.
Due to licensing issues, it can not be merged upstream. However, an Ubuntu ppa is supplied:
For future reference:
First the PPA needs to be installed. This can be done with the following for Ubuntu 18.04, 18.10, 19.04:
sudo add-apt-repository ppa:eh5/pulseaudio-a2dp
sudo apt-get update
sudo apt-get install libavcodec58 libldac pulseaudio-modules-btIf you have newer Ubuntu versions, instead, the correct code is the following:
sudo add-apt-repository ppa:berglh/pulseaudio-a2dp
sudo apt update
sudo apt install pulseaudio-modules-bt libldacNow you need to restart pulseaudio:
pulseaudio -k
pulseaudio --startI then had to reconnect my headphones (Sennheiser HD 4.50 BTNC), and set them as audio sink. In the sound settings, AptX was already displayed. Selecting AAC/AptXHD/LDAC didn't change what was used (due to my headphones only supporting AptX). To check on the shell:
pactl list sources | grep a2dp_codecThe above has no output when used without the custom modules!