Only reload snd_usb_audio if 1824c not initialised

This commit is contained in:
Jordan Holt 2024-05-04 13:08:09 +01:00
parent 2b8f9c4ae7
commit 352db47931
Signed by: jordan
GPG Key ID: B8CFFF61F1CCF520

View File

@ -36,8 +36,11 @@ in {
kmod
];
script = ''
rmmod snd_usb_audio
insmod /run/booted-system/kernel-modules/lib/modules/$(uname -r)/extra/snd-usb-audio.ko.xz
# Only reload if device hasn't been initialised
if ! cat /proc/asound/card*/usbmixer | grep -q "Mute Main Out Switch"; then
rmmod snd_usb_audio
insmod /run/booted-system/kernel-modules/lib/modules/$(uname -r)/extra/snd-usb-audio.ko.xz
fi
'';
};