omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Bluetooth Audio Devices Doesn't Work

Open matheorism opened this issue 1 year ago • 24 comments

System details

AMD Ryzen 9 PRO 7940HS, AMD Radeon RX 6550M, Omarchy 3.0.1, Hyprland 0.51.0,

What's wrong?

OS: Omarchy v3.0.1 Kernel: Linux 6.16.7-arch1-1 Hyprlan: 0.51.0

Both my wireless headphones (Sony XM5) and AirPods Pro 2 started not working when I upgraded to Omarchy v3.0.1. My headphones are showing as connected.

Image Image

But it's not showing on my Output and Input Devices list

Image Image

matheorism avatar Sep 19 '25 21:09 matheorism

same issue AMD Ryzen AI 9 HX PRO 37, AMD Radeon 890M, Omarchy 3.0.1, Hyprland 0.51.0,

cnharrison avatar Sep 19 '25 22:09 cnharrison

Edit My new workaround is to go to Update > Hardware > Audio That'll somehow do a reset and it would work properly again. I prefer this over restarting my machine because it's a lot faster.

I have similar issue. The only difference is that I do see my headphone showing on my Output and Input Devices list, but no audio. When I play something on YouTube, it shows the loading spinning circle for about 10 seconds and displays a line says

"If playback doesn't begin shortly, try restarting your device."

My current workaround is to restart my machine and everything works again.

Chase78712002 avatar Sep 25 '25 01:09 Chase78712002

I had the similar experience with Sony headphones, OS restart fixed it.

landsman avatar Sep 29 '25 12:09 landsman

I was facing the same issue with AirPods Pro 2 and Sennheiser Momentum 4. I removed both devices and re-paired them. They're consistently working now.

ariejan avatar Sep 29 '25 13:09 ariejan

#1734

d3vw avatar Oct 04 '25 10:10 d3vw

Getting similar issue with Sony WF-1000XM5. Will pair and then connect for a few seconds then lose connection and have to re-pair. I was getting this on fedora sway as well, may be an issue with bluetoothctl and the same headphones.

X870E AORUS ELITE WIFI7 6.17.2-arch1-1 Hyprland 0.51.1

swany88 avatar Oct 17 '25 20:10 swany88

Faced with this issue as well. My workaround is manually selecting "Headset Unit" in Configuration panel.

Image

Not sure what those values really are.

SabuhiYusif avatar Oct 20 '25 18:10 SabuhiYusif

Basically there are some configs that are missing. I'm trying to get this to work on my omarchy laptop. On my nixos desktop, i have these settings below. Some of these would need to be different depending on:

  • your hardware
  • I think the underlying bluetooth services that are set up on omarchy, which also seem to be different for me (see my relevant nix module at the end.)

When you add a bluetooth device, it's type/capabilities are recognized as having audio (e.g. similar checks can also have wireplumber manage the audio graph for a PS4 controller: see alyraffauf/nixcfg ./modules/nixos/profiles/gaming/default.nix, which is more of a wireplumber configuration).

Anyways, whatever handles the bluetooth needs to then create pipewire audio graph nodes. These should be visible to wireplumber if you run wpctl status. If they're not, bluetooth isn't modifying the pipewire graph.

Whatever handles bluetooth that needs to know to ask wireplumber to:

  • set up some audio devices
  • the settings for which wireplumber will source from pipewire (will reference things like bitrate, clockrate)

pipewire then needs to have a "Main-Output" and "Main-Input" configuration. This could be installed via an AUR package, but i'm not sure if the device-specific values for configuration prevent this from being an installable default (i.e. whether Omarchy could add a PKGBUILD that auto-configures the Main-Output and Main-Input

{ pkgs, ... }:
{
  services.pipewire = {
    enable = true;
    alsa = {
      enable = true;
      support32Bit = true;
    };

    pulse.enable = true;
    jack.enable = true;

    extraConfig.pipewire."91-null-sinks" = {
      "context.objects" = [
        # pipewire seems to already have a dummy driver
        #
        # {
        #   factory = "spa-node-factory";
        #   args = {
        #     "factory.name" = "support.node.driver";
        #     "node.name" = "Dummy-Driver";
        #     "priority.driver" = 8000;
        #   };
        # }
        {
          factory = "adapter";
          args = {
            "factory.name" = "support.null-audio-sink";
            "node.name" = "Microphone-Proxy";
            "node.description" = "Microphone";
            "media.class" = "Audio/Source/Virtual";
            "audio.position" = "MONO";
          };
        }
        {
          factory = "adapter";
          args = {
            "factory.name" = "support.null-audio-sink";
            "node.name" = "Main-Output-Proxy";
            "node.description" = "Main Output";
            "media.class" = "Audio/Sink";
            "audio.position" = "FL,FR";
          };
        }
      ];
    };

    # low-latency settings
    extraConfig.pipewire."92-low-latency" = {
      "context.properties" = {
        "default.clock.rate" = 48000;
        # quantum: buffer size
        "default.clock.quantum" = 256;
        "default.clock.min-quantum" = 256;
        "default.clock.max-quantum" = 256;
      };
    };
    extraConfig.pipewire-pulse."92-low-latency" = {
      context.modules = [
        {
          name = "libpipewire-module-protocol-pulse";
          args = {
            pulse.min.req = "256/48000";
            pulse.default.req = "256/48000";
            pulse.max.req = "256/48000";
            pulse.min.quantum = "256/48000";
            pulse.max.quantum = "256/48000";
          };
        }
      ];
    };

    # bluez5 roles:
    # hsp_hs/ag: headset, audio gateway
    # hfp_hf/ag: hands-free, audio gateway
    # a2dp_sink/source
    # LE Audio BAP: Basic Audio Profile
    # bap_sink/source: BAP Sink/Source
    wireplumber.extraConfig.bluetoothEnhancements = {
      "monitor.bluez.properties" = {
        "bluez5.enable-sbc-xq" = true; # high-quality SBC Codec (A2DP; wp bluez default)
        "bluez5.enable-msbc" = true; # mSBC wideband speech codec (HFP/HSP; wp bluez default)
        "bluez5.enable-hw-volume" = true;
        "bluez5.roles" = [
          "a2dp_sink"
          "a2dp_source"
          "hsp_hs"
          "hsp_ag"
          "hfp_hf"
          "hfp_ag"
        ]; # bap_sink bap_source
      };
    };
  };

  # NOTE: realtime audio setup
  security = {
    rtkit.enable = true;
    # requires rtkit and adding user to realtime group
    pam.loginLimits = [
      { domain = "@audio"; item = "memlock"; type = "-"; value = "unlimited"; }
      { domain = "@audio"; item = "rtprio"; type = "-"; value = "99"; }
      { domain = "@audio"; item = "nofile"; type = "soft"; value = "99999"; }
      { domain = "@audio"; item = "nofile"; type = "hard"; value = "99999"; }
      { domain = "@audio"; item = "nice"; type = "-"; value = "-15"; }
    ];
  };
}

dcunited001 avatar Nov 06 '25 19:11 dcunited001

TLDR: the problem is somewhat related to the user-level bluetooth device management and somewhat related to missing the dummy pipewire devices (main-output, main-input). If those devices are appearing in the pipewire-pulse configuration tools (like the TUI in the screenshot), then the bluetooth is doing something extra for you -- I'm not seeing that.

I have some notes on here on processing pw-dump output with jq queries . The content is somewhat nixos-specific, but not the pw-dump and jq queries. Nixos is a bit of a rabbit hole. With omarchy, you benefit a lot from a group of developers who are publishing updates through package configurations and through the scripts used by the hyprland config and the installer/updater.

dcunited001 avatar Nov 06 '25 19:11 dcunited001

helvum is another app that can help troubleshoot the pipewire and wireplumber issues. on my nixos desktop, i have the blueman applet set up for my user. however, installing this on arch may lead to problems -- just a warning. i don't think it would, but i haven't actually installed it yet, as I'm looking for appropriately simple omarchy-centric solution to this problem. I haven't dug into the bluetooth configuration enough to figure it out yet.

dcunited001 avatar Nov 06 '25 19:11 dcunited001

The TUI app is wiremix

There is also this PR #2072

dcunited001 avatar Nov 06 '25 21:11 dcunited001

For me, after pairing with blueberry, the device wasn't trusted. I usually use blueman-tray to configure bluetooth. After setting that up, I noticed the error Connection Failed: br-connection-key-missing. This means that the initial device setup wasn't done correctly for some reason. For me, even after pairing my headphones, that device had a "disconnected" status in the blueberry tool.

On discord, users advise to setup devices using bluetoothctl, but for me that command wasn't availlable until after i installed the bluez-utils package. I've done this before, but it can be a bit involved. I prefer GUI over TUI for most things, but idk, it depends. If the audio profiles aren't being added when you pair the device, try another tool.

To get audio from my headphones:

  • pacman -Syu bluez-utils
  • pacman -Fl bluez-utils | grep '/bin' these commands get installed, which includes bluetoothctl
  • pacman -Syu blueman i'm not sure how the tray app gets run, but its command is blueman-tray
  • sudo systemctl daemon reload or reboot (probably wait until after enabling the blueman services)
  • sudo systemctl enable --now blueman-mechanism.service. this service is also d-bus activated, but for the --user services, running enable warns you that they're not meant to be enabled.
  • pacman -Fl blueman-utils | grep 'systemd' these are the systemd service files
  • systemctl cat 'blueman-*' to check them and systemctl --user cat 'blueman-*' for the user services.
  • Run blueman-tray. This interface proceeds through d-bus (the command ends early because it needs a singleton process to register as the d-bus event handler). IDK whether this would happen if

Now, after removing the device, then re-pairing under the blueman-applet UI, I don't get the br-connection-key-missing warning. I needed to trust the device. This causes it to automatically pair (I think).

Then, check the audio profiles and select one. I believe these are retained. This is how bluetooth knows what to ask wireplumber or pipewire to set up. I went with SBC-XQ because it's higher quality and HSP/HSF creates mono (eww)

At this point, running wpctl status shows the Sinks

Image

dcunited001 avatar Nov 06 '25 22:11 dcunited001

This still doesn't set up the "Main Output" or "Main Input" dummy devices, but i think that's coming with the PR that I referenced.

It's possible to get wireplumber to automatically reselect outputs, but managing those devices requires graph traversal so in my experience, most tools just don't get it right anyways. There are just a lot of edge cases

  • most monitors have HDMI audio profiles ... for some reason, even though basically none have decent soundcards
  • the network can provide endpoints to stream to, so that can dynamically change as well

I'm hoping that Linux gets a GUI+CLI tool with declarative configuration for objects in wpctl status that makes it easy to manage state of the entire graph. pipewire/wireplumber with filters gives you what's potentially a DAW in linux, built in at the system level. Being able to reliably set this up in order to simplify configuration of OBS streaming setups would be a killer feature IMO.

dcunited001 avatar Nov 06 '25 22:11 dcunited001

Same issue here, any updates?

RenanOSX avatar Mar 05 '26 22:03 RenanOSX

I'm on a Framework 13 w/AMD and have a variation of this issue after updating to Omarchy 3.4. Once paired my Bluetooth headphones connect but sometimes won't become primary. When selected manually they are not connected to the main volume control. After a reboot this works as expected but if disconnect the headphones and reconnect later the issue persists. Restarting hardware -> audio also works most of the time.

This worked perfectly before Omarchy 3.4.

cpanderson avatar Mar 10 '26 13:03 cpanderson

Similair issue, first didn't found the sound after connecting with bluetooth, then ive run hardware update, but the sound is really bad

Edit: after restarting it seems much better

AndrijaSkontra avatar Mar 18 '26 13:03 AndrijaSkontra

Neither of the following worked:

  • Restarting my computer

  • Update > Hardware > Audio | Bluetooth

Anyone else having this same issue?

Image

trevornei avatar Mar 24 '26 16:03 trevornei

Facing the same issue, having to switch manually back and forth from either the laptop audio or bluetooth audio, it is not working automatically

Yug3ne avatar Mar 26 '26 06:03 Yug3ne

Facing the same issue, having to switch manually back and forth from either the laptop audio or bluetooth audio, it is not working automatically

Yes, seems to be the only work around!

trevornei avatar Mar 26 '26 14:03 trevornei

  1. Create config file: ~/.config/wireplumber/wireplumber.conf.d/10-bluez-force-a2dp-sink.conf
monitor.bluez.properties = {
  bluez5.roles = [ a2dp_source ]
  bluez5.auto-connect = [ a2dp_source ]
}
wireplumber.settings = {
  bluetooth.autoswitch-to-headset-profile = false
  device.restore-profile = false
}
  1. Restart audio stack:
systemctl --user restart wireplumber pipewire pipewire-pulse
  1. Get your device MAC:
bluetoothctl devices
# or:
bluetoothctl devices Paired
# or:
bluetoothctl devices Connected

Output format: Device 4) Reconnect device:

bluetoothctl disconnect <MAC>
bluetoothctl connect <MAC>

Verify

pactl list cards | rg -n "bluez_card|Active Profile|a2dp"
pactl list short sinks
wpctl status

Expected:

  • Bluetooth card active profile becomes a2dp-sink
  • A sink like bluez_output..1 appears
  • App streams route to Bluetooth sink Optional: set Bluetooth as default output
pactl set-default-sink <bluetooth_sink_name>

CraftsMan-Labs avatar Apr 01 '26 11:04 CraftsMan-Labs