# /etc/udev/rules.d/99-midi.rules # USB MIDI device hotplug rules for Raspberry Pi RT Audio Mixer # # These rules: # 1. Give the 'audio' group read/write access to USB MIDI devices # 2. Create a persistent symlink for known controllers # 3. Trigger systemd service reload on hotplug # 4. Set nice/rtprio for MIDI processing threads # # Install: sudo cp config/99-midi.rules /etc/udev/rules.d/ # Reload: sudo udevadm control --reload-rules && sudo udevadm trigger # ── Generic USB MIDI class devices (class-compliant) ──────────────────────── # USB Audio Class MIDI Streaming (subclass 0x03) SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ GROUP="audio", MODE="0660", \ TAG+="systemd", ENV{SYSTEMD_WANTS}+="midi-hotplug@$devpath.service" # ── Known controllers — persistent symlinks by VID:PID ────────────────────── # Behringer X-Touch Compact SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="1397", ATTRS{idProduct}=="00b4", \ SYMLINK+="midi/xtouch-compact", \ ENV{MIDI_CONTROLLER}="Behringer X-Touch Compact" # Behringer X-Touch (MCU mode) SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="1397", ATTRS{idProduct}=="00b5", \ SYMLINK+="midi/xtouch", \ ENV{MIDI_CONTROLLER}="Behringer X-Touch" # FaderFox UC4 SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0d27", \ SYMLINK+="midi/faderfox-uc4", \ ENV{MIDI_CONTROLLER}="FaderFox UC4" # Akai MIDImix SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="09e8", ATTRS{idProduct}=="0031", \ SYMLINK+="midi/midimix", \ ENV{MIDI_CONTROLLER}="Akai MIDImix" # Arturia BeatStep SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="1c75", ATTRS{idProduct}=="0208", \ SYMLINK+="midi/beatstep", \ ENV{MIDI_CONTROLLER}="Arturia BeatStep" # Novation Launch Control XL SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="1235", ATTRS{idProduct}=="0061", \ SYMLINK+="midi/launchcontrol-xl", \ ENV{MIDI_CONTROLLER}="Novation Launch Control XL" # Korg nanoKONTROL2 SUBSYSTEM=="sound", ACTION=="add", KERNEL=="midi*", \ ATTRS{idVendor}=="0944", ATTRS{idProduct}=="0117", \ SYMLINK+="midi/nanokontrol2", \ ENV{MIDI_CONTROLLER}="Korg nanoKONTROL2" # ── Cleanup on removal ────────────────────────────────────────────────────── SUBSYSTEM=="sound", ACTION=="remove", KERNEL=="midi*", \ RUN+="/usr/bin/systemctl stop midi-hotplug@$devpath.service || true"