From 70b47e741a07183b8ca0d78bfc9197e110939e51 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 14 Oct 2018 19:45:31 +0200 Subject: [PATCH] Detach kernel driver if needed --- nocturn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nocturn.c b/nocturn.c index a313b49..e4d0af6 100644 --- a/nocturn.c +++ b/nocturn.c @@ -394,6 +394,9 @@ static void noct_connect(struct main_timer *t) if ((err = libusb_open(found_dev, &usb_dev)) < 0) return noct_error(err, "libusb_open failed"); + // In newer kernels, Nocturn is claimed by snd-usb-audio. Tell it to surrender the device. + libusb_detach_kernel_driver(usb_dev, 0); + // There exist configurations 1 (high brightness) and 2 (power-save) if ((err = libusb_set_configuration(usb_dev, 2)) < 0) return noct_error(err, "libusb_set_configuration failed"); -- 2.39.2