ca1e0bbd

By: Ammar <ammar.nanjiani@gmail.com>

fix(steammachine): apply Valve's BlueZ fix for the Switch Pro Controller

The Nintendo Switch Pro Controller (057e:2009) drops its Bluetooth link on
the Steam Machine. Valve fixes this on SteamOS with a downstream BlueZ patch
that is not upstream and never will be: it was proposed as bluez/bluez#2480
and closed unmerged, so no BlueZ release carries it and no upgrade can
deliver it.

The patch adds BT_IO_OPT_FORCE_ACTIVE and, for this one controller's interrupt
channel, sets BT_POWER_FORCE_ACTIVE_OFF. It stops forcing the link out of
sniff mode on every outgoing packet, which is what Valve's own upstream
proposal names as the cause of the disconnects.

Valve writes it against 5.83 but all 15 hunks apply to the 5.87 source that
nixpkgs pins, with zero fuzz. It is fetched and extracted from Valve's source
archive rather than vendored so the provenance stays visible; btio compiles
into bluetoothd and not into libbluetooth, so it is daemon-side only and
changes no ABI.

hardware.bluetooth.package is pinned to the overlaid derivation so a later
override of that option cannot silently drop the patch.

Not verified against hardware yet: this is a plausible mechanism applied
cleanly, not a tested fix.

Total

1h00m45s

Time to Start Worker time Duration Time to finish Idle
Config 0s 3s 3s 4s 0s
Eval 4s 2m35s 2m35s 2m39s 0s
Build 2m39s 1h17m05s 58m05s 1h00m45s 37m07s
Suite 0s 1h19m44s 1h00m45s 1h00m45s 37m08s

Timeline

Config Eval Build Failed Retried
0s1m2m3m4m5m6m7m8m9m10m11m12m13m14m15m16m17m18m19m20m21m22m23m24m25m26m27m28m29m30m31m32m33m34m35m36m37m38m39m40m41m42m43m44m45m46m47m48m49m50m51m52m53m54m55m56m57m58m59m1h0m