Bluetooth randomly stopped working

So basically, I am on cachyos minimal installation and I have installed hyprland pre-made dotfiles (prasanthrangan dotfiles) in it. Everything was working fine and I was using this setup since a week with no issues, but suddenly, yestarday, I couldn’t connect to my bluetooth headphones. When I connect it, it disconnects after around 30 secs and even when its connected, there is no audio if I play something. and yes the headphone itself is fine it works from my other devices. Sometimes, it didn’t even let me connect and showed br-connection-refused error and sometimes unknown error.

I am using pipewire if that matters and I tried reinstalling bluetz-utils yet no success. Also tried deleting /var/lib/bluetooth and restarting pc as suggested by a forum, but it didn’t work either.

Output of journalctl -f -u bluetooth while connecting my device:

Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_1
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_0
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/faststream
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/faststream_duplex
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSink/opus_05
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/opus_05
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSink/opus_05_duplex
Feb 19 23:13:42 cachyos bluetoothd[8910]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/opus_05_duplex
Feb 19 23:14:16 cachyos bluetoothd[8910]: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Function not implemented
Feb 19 23:14:21 cachyos bluetoothd[8910]: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/sep1/fd1: fd(29) ready

Output of sudo cachyos-bugreport.sh:

P.S. I am still a beginner so I apologise in advanced if something I wrote doesn’t make any sense. Also, I don’t think it has something to do with the dotfiles as I had this same setup few months ago as well for a long time and it was working well and even now, it was working with no problems when I installed it last week.

Any help will be appreciated. Thanks in advanced!

Nevermind, after lots of efforts, I finally fixed it.
In case anyone faced similar issue, this is what I did: (I do not know which step fixed the issue but I believe it was a combination of those steps)

  • reinstalled linux firmware: sudo pacman -Syu --noconfirm linux-firmware This fixed the connectivity issue but now headphones were connecting in HSP mode and audio was crappy. Changing to A2DP profile didn’t work as audio was completely gone.
  • Removed /var/lib/bluetooth and edited /etc/bluetooth/main.conf and added Disable=headset at the last line and then restarted bluetooth service. (I doubt this fixed anything)
  • Installed a2ps sudo pacman -S a2ps and then restarted my pc and just like that, it worked. (I found this on a debian forum: [Solved] Bluetooth Headphones stuck in HSP/HFP - Debian User Forums)