Skip to content

Instantly share code, notes, and snippets.

@leodutra
Last active April 16, 2024 09:57
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leodutra/4403a2964697c7e78fb7290ac6d64d02 to your computer and use it in GitHub Desktop.
Save leodutra/4403a2964697c7e78fb7290ac6d64d02 to your computer and use it in GitHub Desktop.
Bluetooth headset/ headphone Ubuntu 20.04 - tested with Sony WH-1000XM4 - shell script
#!/bin/sh
# sudo add-apt-repository ppa:eh5/pulseaudio-a2dp (NOT NEEDED ANYMORE)
sudo apt update
sudo apt install libldac \
libavcodec-extra58 \
pulseaudio \
pulseaudio-module-bluetooth \
blueman
# bluez is installed as dependency
# NOTE: pulseaudio 15.0 inclues LDAC, AptX and others (AAC?)
# NOTE: for Sony WH-1000XM4, start blueman and activate XM4 bluetooth search (phone shortcut or using mobile app in 2 connected devices mode). Works with LDAC and HFP/HSP (first is preferred for quality, second is NEEDED for mic input, degrading output)
# Ubuntu 22.04
# 1. Purge everything related to bluetooth : sudo apt purge pulseaudio-module-bluetooth bluetooth "bluez-*" bluez
# 2. Delete /var/lib/blueman and /var/lib/bluetooth
# 3. Reinstall : sudo apt install blueman bluez pulseaudio-module-bluetooth --install-suggests
# NOTE: only HFP/HSP supports both sound and mic at same time the other profile does not support mic at all. Yes, it will degrade output due to duplex connection (in/out)
sudo apt purge pulseaudio-module-bluetooth bluetooth "bluez-*" bluez
sudo rm -rf /var/lib/blueman
sudo rm -rf /var/lib/bluetooth
sudo apt install blueman bluez pulseaudio-module-bluetooth --install-suggests
@AdrianPrados
Copy link

It works also for SONY WF-C700N.

Thank you very much @leodutra

@azlomec
Copy link

azlomec commented Apr 10, 2024

SONY WF-C700N kubuntu 23.10, 23.04 ???

@Kelvur
Copy link

Kelvur commented Apr 16, 2024

Thanks! this fix my problem. But I had to edit the install command as apt says libldac doesn't exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment