Add Blue Yeti USB reset service for cold-boot fix

The Blue Yeti mic initializes audio endpoints in a broken state on cold boot
because snd-usb-audio loads after device enumeration. This systemd service
toggles USB authorization to force a clean rebind.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christopher Mühl 2026-02-18 01:50:47 +01:00
parent 09a71afe84
commit 2073876eaf
No known key found for this signature in database
GPG key ID: 925AC7D69955293F

View file

@ -198,6 +198,31 @@
# systemd.packages = [pkgs.lact];
# systemd.services.lactd.wantedBy = ["multi-user.target"];
# Blue Yeti (046d:0ab7) initializes its audio endpoints in a broken state on cold boot
# because snd-usb-audio loads ~2s after the device enumerates. Toggling authorized
# forces a USB rebind on a clean device, mimicking unplug/replug.
systemd.services.blue-yeti-reset = {
description = "Reset Blue Yeti USB mic to fix cold-boot initialization";
after = ["systemd-udev-settle.service"];
wantedBy = ["multi-user.target"];
serviceConfig = {
Type = "oneshot";
ExecStart = pkgs.writeShellScript "blue-yeti-reset" ''
for dev in /sys/bus/usb/devices/*/; do
[ -f "$dev/idVendor" ] || continue
vendor=$(cat "$dev/idVendor" 2>/dev/null)
product=$(cat "$dev/idProduct" 2>/dev/null)
if [ "$vendor" = "046d" ] && [ "$product" = "0ab7" ]; then
echo 0 > "$dev/authorized"
sleep 0.5
echo 1 > "$dev/authorized"
break
fi
done
'';
};
};
hardware = {
amdgpu = {
opencl.enable = true;