P1-R3: Initial project infrastructure

- Project directory structure: docs/, src/, build/, recipes/, scripts/, wiki/
- README.md with project overview and status
- .editorconfig for consistent code style
- .gitignore for Python, C/C++, kernel, and build artifacts
- docs/research/: system research report + base OS decision
- docs/audio-stack-config.md: audio stack configuration notes
- config/: JACK, ALSA, CPU performance configs
- Preserved research from P1-R1 and P1-R2 tasks
This commit is contained in:
2026-05-19 19:06:12 -04:00
commit 96a6b96b7e
20 changed files with 2141 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
# Realtime audio group limits
# Members of the 'audio' group get realtime scheduling and unlimited memory lock
@audio - rtprio 99
@audio - memlock unlimited
@audio - nice -20
@audio - priority 99
+7
View File
@@ -0,0 +1,7 @@
# USB audio buffer tuning
# Low-latency USB audio configuration
# nrpacks=1: disable implicit feedback sync buffering
# Reduces USB transfer latency at cost of slightly higher CPU
options snd-usb-audio nrpacks=1
+1
View File
@@ -0,0 +1 @@
console=serial0,115200 console=tty1 root=PARTUUID=xxxxxxxx-02 rootfstype=ext4 fsck.repair=yes rootwait isolcpus=1-3 nohz_full=1-3 rcu_nocbs=1-3 threadirqs irqaffinity=0 quiet
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Set CPU governor to performance
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
+43
View File
@@ -0,0 +1,43 @@
[Unit]
Description=JACK2 Audio Server
After=sound.target network.target
Wants=sound.target
[Service]
Type=simple
User=pi
Group=audio
Environment=JACK_NO_AUDIO_RESERVATION=1
Environment=JACK_PROMISCUOUS_SERVER=1
# Real-time scheduling
LimitRTPRIO=99
LimitMEMLOCK=infinity
LimitNICE=-20
# CPU affinity — pin JACK server to audio cores 1-3
CPUAffinity=1-3
# I/O scheduling — realtime class
IOSchedulingClass=realtime
IOSchedulingPriority=0
# JACK daemon command
ExecStart=/usr/bin/jackd \
-P 70 \
-t 2000 \
-d alsa \
-d hw:USB \
-r 48000 \
-p 128 \
-n 3 \
-M \
-X seq \
-S
# Restart on crash (but not on clean shutdown)
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target
+2
View File
@@ -0,0 +1,2 @@
# /etc/jackdrc — system-wide JACK2 default settings
/usr/bin/jackd -P 70 -t 2000 -d alsa -d hw:USB -r 48000 -p 128 -n 3 -M -X seq
+16
View File
@@ -0,0 +1,16 @@
# /etc/default/rtirq — realtime IRQ thread priority tuning
# List of IRQ thread names to boost (space-separated regex patterns)
RTIRQ_NAME_LIST="xhci_hcd snd usb"
# Highest priority for listed threads
RTIRQ_PRIO_HIGH=95
# Decrement priority per subsequent match
RTIRQ_PRIO_DECR=1
# Lowest priority for unlisted threads
RTIRQ_PRIO_LOW=50
# Reset IRQ thread priorities before applying (0=no, 1=yes)
RTIRQ_RESET_IRQ=0