# **Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)** This guide will help you connect your Sony WH-1000XM4 headset to Ubuntu 22.04 using Bluetooth. Once connected, you'll be able to listen to music and use the microphone on apps like Microsoft Teams. ## **1. Connect to Bluetooth Headset** ### **Steps**: 1. Open a terminal and launch `bluetoothctl`: ```bash bluetoothctl ``` 2. Initialize the agent and set it as the default: ``` agent on default-agent ``` 3. Scan for Bluetooth devices: ``` scan on ``` Look for the MAC address of your Sony WH-1000XM4 headset. 4. Stop the scanning process: ``` scan off ``` 5. Pair, trust, and connect to the headset using its MAC address: ``` pair XX:XX:XX:XX:XX:XX trust XX:XX:XX:XX:XX:XX connect XX:XX:XX:XX:XX:XX ``` (Replace `XX:XX:XX:XX:XX:XX` with the MAC address of your headset.) 6. Exit `bluetoothctl`: ``` exit ``` --- ## **2. Enable PipeWire for Better Audio Handling** Ubuntu 22.04 partially uses PipeWire by default. To fully utilize it for audio and Bluetooth, follow these steps: ### **Installation**: 1. Install and start WirePlumber: ```bash sudo apt install pipewire-media-session- wireplumber systemctl --user --now enable wireplumber.service ``` ### **Configuration**: - **For ALSA**: ```bash sudo apt install pipewire-audio-client-libraries sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/ ``` - **For Bluetooth**: ```bash sudo apt install libldacbt-{abr,enc}2 libspa-0.2-bluetooth pulseaudio-module-bluetooth- ``` ### **Validation**: After rebooting your system, you can check if PipeWire is active by running: ```bash LANG=C pactl info | grep '^Server Name' ``` ### Switch Audio Profile using CLI ![image](https://user-images.githubusercontent.com/869/278867175-3050ff50-1ffc-47df-b7f6-3316af402841.png) ```bash mkdir -p ~/.audio/bin && cd ~/.audio/bin wget https://gist.githubusercontent.com/peters/26315cd7a8a31e3d192ed05ef9a79ba7/raw/9466f91da19b53d01cac862898cfdfcb18e3137e/wh1000xm4-audio-profile.sh chmod +x wh1000xm4-audio-profile.sh ./wh1000xm4-audio-profile.sh ``` For microphone testing, [click here to visit the microphone test site](https://brianpeiris.github.io/mic-test)