ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
8d419f
From 41d06ed98ecbe4f65cfffc3877fbe4c87fadc6b4 Mon Sep 17 00:00:00 2001
8d419f
From: Be <be@mixxx.org>
8d419f
Date: Fri, 27 Aug 2021 22:30:50 -0500
8d419f
Subject: [PATCH] Add AV production controllers to hwdb and add uaccess
8d419f
8d419f
This adds support for AV production controller devices, such
8d419f
as DJ tables, music-oriented key pads, and others.
8d419f
8d419f
The USB vendor and product IDs come from Mixxx, Ctlra, and
8d419f
Ardour.
8d419f
8d419f
Fixes #20533
8d419f
8d419f
Co-developed-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
8d419f
(cherry picked from commit f2c36c0e2445fa95ba109017d4b768b2fd825c43)
8d419f
8d419f
Related: #2087778
8d419f
---
8d419f
 hwdb.d/70-av-production.hwdb  | 123 ++++++++++++++++++++++++++++++++++
8d419f
 hwdb.d/meson.build            |   1 +
8d419f
 hwdb.d/parse_hwdb.py          |   1 +
8d419f
 src/login/70-uaccess.rules.in |   9 +++
8d419f
 4 files changed, 134 insertions(+)
8d419f
 create mode 100644 hwdb.d/70-av-production.hwdb
8d419f
8d419f
diff --git a/hwdb.d/70-av-production.hwdb b/hwdb.d/70-av-production.hwdb
8d419f
new file mode 100644
8d419f
index 0000000000..17ac1b4fb6
8d419f
--- /dev/null
8d419f
+++ b/hwdb.d/70-av-production.hwdb
8d419f
@@ -0,0 +1,123 @@
8d419f
+# This file is part of systemd.
8d419f
+#
8d419f
+# Database for AV production controllers that should be accessible to the seat owner.
8d419f
+#
8d419f
+# This covers DJ tables, and music-oriented key pads
8d419f
+#
8d419f
+# To add local entries, copy this file to
8d419f
+#   /etc/udev/hwdb.d/
8d419f
+# and add your rules there. To load the new rules execute (as root):
8d419f
+#   systemd-hwdb update
8d419f
+#   udevadm trigger
8d419f
+
8d419f
+################
8d419f
+# Ableton
8d419f
+################
8d419f
+# Push 2
8d419f
+usb:v2982p1967*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+################
8d419f
+# Eks
8d419f
+################
8d419f
+# Otus
8d419f
+usb:v1157p0300*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+#############################
8d419f
+# Hercules (Guillemot Corp)
8d419f
+#############################
8d419f
+# DJ Console MP3e2
8d419f
+usb:v06F8pB105*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# DJ Console MP3 LE / Glow
8d419f
+usb:v06F8pB120*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# DJ Console Mk2
8d419f
+usb:v06F8pB100*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# DJ Console Mk4
8d419f
+usb:v06F8pB107*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+#####################
8d419f
+# Native Instruments
8d419f
+#####################
8d419f
+
8d419f
+# Maschine 2
8d419f
+usb:v17CCp1140*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Maschine 2 Mikro
8d419f
+usb:v17CCp1110*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Maschine 2 Studio
8d419f
+usb:v17CCp1300*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Maschine Jam
8d419f
+usb:v17CCp1500*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Maschine 3
8d419f
+usb:v17CCp1600*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol D2
8d419f
+usb:v17CCp1400*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol F1
8d419f
+usb:v17CCp1120*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S2 Mk2
8d419f
+usb:v17CCp1320*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S2 Mk3
8d419f
+usb:v17CCp1710*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S3
8d419f
+usb:v17CCp1900*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S4 Mk2
8d419f
+usb:v17CCp1310*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S4 Mk3
8d419f
+usb:v17CCp1720*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S5
8d419f
+usb:v17CCp1420*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol S8
8d419f
+usb:v17CCp1370*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol X1 Mk2
8d419f
+usb:v17CCp1220*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol Z1
8d419f
+usb:v17CCp1210*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+# Traktor Kontrol Z2
8d419f
+usb:v17CCp1130*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
+
8d419f
+####################
8d419f
+# Pioneer
8d419f
+####################
8d419f
+# CDJ 2000 NXS 2
8d419f
+usb:v2B73p0005*
8d419f
+ ID_AV_PRODUCTION_CONTROLLER=1
8d419f
diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build
8d419f
index fc72ebb2bd..8f6a8a4486 100644
8d419f
--- a/hwdb.d/meson.build
8d419f
+++ b/hwdb.d/meson.build
8d419f
@@ -28,6 +28,7 @@ hwdb_files_test = files('''
8d419f
         60-seat.hwdb
8d419f
         60-sensor.hwdb
8d419f
         70-analyzers.hwdb
8d419f
+        70-av-production.hwdb
8d419f
         70-cameras.hwdb
8d419f
         70-joystick.hwdb
8d419f
         70-mouse.hwdb
8d419f
diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py
8d419f
index 194a71ac08..93179b675c 100755
8d419f
--- a/hwdb.d/parse_hwdb.py
8d419f
+++ b/hwdb.d/parse_hwdb.py
8d419f
@@ -135,6 +135,7 @@ def property_grammar():
8d419f
              ('MOUSE_WHEEL_CLICK_COUNT', INTEGER),
8d419f
              ('MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL', INTEGER),
8d419f
              ('ID_AUTOSUSPEND', Or((Literal('0'), Literal('1')))),
8d419f
+             ('ID_AV_PRODUCTION_CONTROLLER', Or((Literal('0'), Literal('1')))),
8d419f
              ('ID_PERSIST', Or((Literal('0'), Literal('1')))),
8d419f
              ('ID_PDA', Or((Literal('0'), Literal('1')))),
8d419f
              ('ID_INPUT', Or((Literal('0'), Literal('1')))),
8d419f
diff --git a/src/login/70-uaccess.rules.in b/src/login/70-uaccess.rules.in
8d419f
index 052194b6c9..a3301be1bc 100644
8d419f
--- a/src/login/70-uaccess.rules.in
8d419f
+++ b/src/login/70-uaccess.rules.in
8d419f
@@ -87,4 +87,13 @@ ENV{ID_SIGNAL_ANALYZER}=="?*", ENV{DEVTYPE}=="usb_device", TAG+="uaccess"
8d419f
 # rfkill / radio killswitches
8d419f
 KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess"
8d419f
 
8d419f
+# AV production controllers
8d419f
+# Most of these devices use HID for the knobs, faders, buttons, encoders, and jog wheels.
8d419f
+SUBSYSTEM=="hidraw", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
8d419f
+
8d419f
+# Some devices use vendor defined protocols on USB Bulk endpoints for controllers.
8d419f
+# Other devices transfer graphics to screens on the device through USB Bulk endpoints.
8d419f
+# This also allows accessing HID devices with the libusb backend of hidapi.
8d419f
+SUBSYSTEM=="usb", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
8d419f
+
8d419f
 LABEL="uaccess_end"