Support for Razer Barracuda X 2022 bluetooth headphones on Ubuntu 22 with microphone as default input. After steps below headphones shoud be set as default input device - Headphones with microphone Razer Barracuda X (BT)
Steps:
- Check card name and profile name
pactl list
It should be like Name: bluez_card.<bluetooth_address> in Card section and handsfree_head_unit in Profiles section 2. Create script /home/<user_name>/.config/auto-pactl.sh
#!/bin/bash
sleep 2 # wait for the headset to fully connect
sudo -u '#1000' XDG_RUNTIME_DIR=/run/user/1000 \
pactl set-card-profile <card_name> handsfree_head_unit
logger "Switched BarracudaX 2022 headset to HFP profile"
- Set permissions for /home/<user_name>/.config/auto-pactl.sh
chmod a+x /home/<user_name>/.config/auto-pactl.sh
- Create rules file
sudo nano /etc/udev/rules.d/52-barracuda-x-headset.rules
- Put this line with proper bluetooth_address and user_name
ACTION=="add", SUBSYSTEM=="input", ATTR{phys}=="<bluetooth_address>", ATTR{id/vendor}=="0000", ATTR{id/product}=="0000", RUN+="/home/<user_name>/.config/auto-pactl.sh"
- Reload rules without reboot
sudo su
udevadm control --reload-rules && udevadm trigger