Short answer

On Ubuntu 24.04 LTS and newer, LDAC and aptX already work. The sound system, PipeWire, picks the best codec both sides support. To choose one yourself, use the Configuration tab of PulseAudio Volume Control (pavucontrol). On Ubuntu 22.04, install gstreamer1.0-plugins-bad first.

What LDAC and aptX are

A codec decides how sound is compressed on its way over Bluetooth. Every Bluetooth headphone supports the basic one, SBC.

LDAC

From Sony

The highest bit rate. Found on many Sony and other high-end headphones. It adapts its quality to the connection.

aptX and aptX HD

From Qualcomm

Common on many earbuds and speakers.

SBC

Every headphone

The basic codec. Ubuntu falls back to it when nothing better is shared.

Your headphones must support the codec: Ubuntu can’t add LDAC to headphones that don’t have it.

Ubuntu 24.04 and newer: choose the codec

The Bluetooth sound support (libspa-0.2-bluetooth) includes the LDAC and aptX encoders and is installed by default.

  1. Connect your headphones in Settings Bluetooth.
  2. Install the volume control tool: sudo apt install pavucontrol
  3. Open PulseAudio Volume Control and click the Configuration tab.
  4. Next to your headphones, open the Profile list. Choose High Fidelity Playback (A2DP Sink, codec LDAC) or the aptX one. Only codecs your headphones support are listed.

Check which codec is in use: choose the headphones under Output Device in Settings Sound, then run wpctl inspect @DEFAULT_AUDIO_SINK@ | grep codec. You should see a line like api.bluez5.codec = "ldac".

Sound cuts out? LDAC at its highest quality needs a strong signal. Keep the computer close. aptX or SBC is more stable at a distance.

Ubuntu 22.04

Ubuntu 22.04 uses PulseAudio. Its Bluetooth module can use LDAC and aptX, but the encoders come from a GStreamer package that isn’t always installed.

  1. Run sudo apt install gstreamer1.0-plugins-bad
  2. Run pulseaudio -k to restart PulseAudio (it starts again by itself).
  3. Turn the headphones off and on, or reconnect them in Settings Bluetooth.
  4. PulseAudio now picks the best codec both sides support.

To check it, run pactl list sinks | grep -i codec. Still SBC? Check that your headphones support LDAC or aptX. Upgrading to Ubuntu 24.04 LTS or newer gives you PipeWire and the codec choice above.

Problems with Bluetooth headphones?

Test it now

Headphone test

It plays sound in the left and right ear, one at a time. If you hear each on its own side, left and right play correctly. The command above shows the codec.

Open the headphone test

Not connecting, cutting out or stuck in poor quality? See fixing Bluetooth in Ubuntu.