···2727 pulse.enable = true;
2828 jack.enable = true;
2929 };
3030+3131+ # WirePlumber's bluez monitor calls node:activate() on the result of
3232+ # LocalNode(), which is nil when the adapter factory refuses the node. The
3333+ # WH-1000XM5 triggers that whenever its audio transport dies ("spa.bluez5:
3434+ # Failure in Bluetooth audio transport", then "mod.adapter: can't get
3535+ # format: Invalid argument"): the Lua hook throws, its AsyncEventHook
3636+ # transition never completes, and the event dispatcher stalls for good --
3737+ # after which no node ever activates again, the ALSA sinks sit in SUSPENDED,
3838+ # and every player (including herdr's notification pings) blocks until
3939+ # wireplumber is restarted by hand. Fail the transition instead.
4040+ services.pipewire.wireplumber.package = pkgs.wireplumber.overrideAttrs (old: {
4141+ postPatch = (old.postPatch or "") + ''
4242+ substituteInPlace src/scripts/monitors/bluez/create-node.lua \
4343+ --replace-fail \
4444+ 'local node = LocalNode("adapter", properties)' \
4545+ 'local node = LocalNode("adapter", properties)
4646+ if node == nil then
4747+ transition:return_error ("Failed to create BT node " .. tostring (properties["node.name"]))
4848+ return
4949+ end'
5050+ '';
5151+ });
3052}