18 Commits

Author SHA1 Message Date
shawn 3f7257aa23 RT performance tuning: IRQ affinity, chrt, xrun tracking, reference doc
CI / test (push) Has been cancelled
- Add USB audio IRQ affinity pinning to core 3 in main.py
- Add enable_xrun_tracking() to AudioSystem for kernel-level diagnostics
- Wrap Python process with chrt -f 80 in systemd service template
- Add LimitSIGPENDING=128 for signal queue depth
- Create scripts/rt-tune.sh — comprehensive RT tuning startup script
  (IRQ affinity, CPU governor, C-states, ALSA limits, xrun_debug)
- Create docs/rt-performance-tuning.md — reference doc with all
  tuning knobs, measurement tools, and systematic procedure

Targets: <12ms RT latency (8ms ideal), zero xruns, CPU <40% at 512/48k
2026-06-20 15:58:59 -04:00
shawn 2558306e78 fix: code review batch 2 — multi-channel, thread safety, DSP reset, MIDI, hotspot, NAM, docs/CI, code quality
CI / test (push) Has been cancelled
2026-06-17 22:38:30 -04:00
shawn 42d0592856 Add factory presets for Keys, Vocals, and Backing Tracks channels
3 banks per channel (9 total, 36 presets):
- Keys: Piano & Electric (bank 21), Synth Pads & Leads (22), Organ & Vintage Keys (23)
- Vocals: Lead Vocals (24), Harmony & Backing (25), Vocal FX (26)
- Backing Tracks: Mix Ready (27), Click & Guide (28), Ambient Pads (29)

Appropriate FX chains per channel — de-esser, HPF/LPF, shimmer_reverb,
stereo_widener, rotary_speaker for vocals and keys; master bus chain
for backing tracks. No IR cab blocks on vocal/backing presets.

Generated by scripts/generate_channel_presets.py
2026-06-13 10:09:25 -04:00
shawn 5c51b3db28 feat(nam): download 10 new A2 models for bass, orange, and other missing categories
Bank 7 — Bass: Ampeg PF20T, Aguilar Tone Hammer 500, GK 800RB (Gallien-Krueger), Aguilar DB751
Bank 7 — Orange: Orange Rocker 30 Dirty + Natural
Bank 7 — Others: Fender Bassman dimed, Hiwatt DR103 Bright + Cornish, Supro Black Magick M3

All SlimmableContainer v0.7.0, ~287-295 KB, verified JSON.
Also fixed Bank 2 Tone3000 storage keys to include .nam extension (Tone3000 changed URL format).
Inventory updated: 54 → 64 total models.
2026-06-13 02:09:56 -04:00
shawn 77a757cee6 R1: Dashboard 500 fix, Phase 2/7 uncommitted changes
- Fix dashboard 500 when deps disconnected — _gather_state() now returns
  full defaults instead of bare {'connected': False}
- Phase 2: FX param schemas aligned with DSP implementations
- Phase 7: Pipeline routing, preset manager improvements
- Factory presets: cleanup and normalization

Fixes dashboard crash on disconnected state (dogfood issue #1)
2026-06-12 14:02:13 -04:00
shawn b4237f2f1d Add Network + Bluetooth config in Web UI
- src/system/network.py: WiFi scan/connect/hotspot via nmcli + iwlist fallback
- src/system/bluetooth.py: BT scan/pair/connect/MIDI via bluetoothctl
- REST endpoints: /api/wifi/* and /api/bluetooth/* (16 endpoints)
- Web UI: tabbed settings with Network + Bluetooth panels
- network.js: WiFi scan, connect modal, saved nets, hotspot
- bluetooth.js: BT scan, pair/unpair, connect, MIDI service
- style.css: tabs, network list, BT device list, signal indicators
- scripts/setup-bt-midi.sh: BT MIDI systemd bridge service
- tests/test_network.py: 22 tests (nmcli/iwlist, fallback, hotspot)
- tests/test_bt.py: 24 tests (status, scan, pair, MIDI, edge cases)
- _gather_state includes wifi + bluetooth sub-objects
- All 93 tests pass
2026-06-09 01:14:41 -04:00
shawn c73b1ffa6c feat: Bluetooth MIDI setup script (discoverable, pairable, systemd service) 2026-06-09 01:02:23 -04:00
shawn ac16d211de feat: WiFi access point setup script + README hotspot instructions 2026-06-09 00:56:58 -04:00
shawn 1c5b728e8b Build: Web UI + mDNS (pedal.local)
FastAPI web server with REST + WebSocket, 5 Jinja2 HTML pages,
mobile-friendly dark theme CSS, page-specific JS controllers,
and Avahi mDNS service advertisement for pedal.local.

Files:
  src/web/server.py          — FastAPI app with 17 REST endpoints + /ws WebSocket
  src/web/__init__.py         — Package init with WebServer, WebServerDeps exports
  src/web/templates/*.html    — Dashboard, Presets, Models, IRs, Settings (base)
  src/web/static/style.css    — Dark mobile-first CSS (80-82% max-width)
  src/web/static/websocket.js — Auto-reconnecting WebSocket manager
  src/web/static/app.js       — Dashboard live updates + REST helpers
  src/web/static/presets.js   — Bank/preset CRUD modal UI
  src/web/static/models.js    — NAM model list/load/upload
  src/web/static/irs.js       — IR file list/load/upload
  etc/avahi/pi-multifx-pedal.service — Avahi service advertisement
  scripts/setup-mdns.sh       — One-shot mDNS setup (avahi, hostname, restart)
  main.py                     — Wire WebServer into boot/shutdown
  requirements.txt            — Add fastapi, uvicorn, jinja2, python-multipart
  tests/test_web.py           — 36 tests (pages, REST, WebSocket, errors)

All 36 tests pass.
2026-06-08 00:57:26 -04:00
shawn b7f5488efd Keep Avahi for pedal.local mDNS, add web UI task 2026-06-08 00:38:37 -04:00
shawn 9e6f23cdb0 Fix minimize script: keep bluetooth+wifi, update baseline doc 2026-06-08 00:23:01 -04:00
shawn 39bac0b0cd Build: DietPi OS minimization
- dietpi-postinstall.sh: first-boot setup from DietPi minimal with only
  needed packages (Python, JACK, cmake, GPIO libs, I2C tools)
- minimize.sh: removes unused packages, systemd services, and kernel
  modules with --dry-run and --aggressive modes; saves before/after profiles
- build-minimal-image.sh: produces flashable SD card image from scratch
  (download DietPi + provision) or from a running SD card device
- baseline-footprint.md: documents before/after RAM, disk, boot time
  targets and verification checklist

Closes t_38b86d31 — DietPi OS minimization
2026-06-08 00:12:40 -04:00
shawn 0ae2ca6e8e feat: PCM1808+PCM5102 I2S HAT design files
Custom I2S HAT for Pi Multi-FX Pedal — full hardware package:

- KiCad project: schematic (kicad_sch), PCB layout (kicad_pcb), project file
- Custom DT overlay: pcm1808-pcm5102-overlay.dts (no upstream overlay exists for PCM1808)
- docs/hardware-bom.md: BOM (9.25 HAT + 1.75 with enclosure), wiring diagram, PCB design notes
- docs/config-audio.md: DT overlay build, ALSA config, JACK integration, troubleshooting
- scripts/install_hat.sh: One-command install + test suite (6 tests)
- hardware/gerber/: JLCPCB fab instructions and assembly notes

Circuit: Guitar input → TL072 preamp (gain ~20dB) → PCM1808 ADC → RPi I2S
  → PCM5102 DAC → RC filter → output jack
I2S: BCLK/GPIO18, LRCLK/GPIO19, DIN/GPIO20, DOUT/GPIO21
Stacking header passes all 40 GPIO pins for footswitches/LEDs/display
2026-06-07 23:52:13 -04:00
shawn 0e77adb4c3 Build IR convolution engine
- Full FFT overlap-add IR convolution in IRLoader (process(), set_mix(), toggle)
- Lazy FFT computation — IR FFT padded to correct block+ir size on first process()
- Wet/dry mix control, enabled/disabled toggle with tail clearing
- Fixed pipeline._apply_ir_cab() to delegate to IRLoader.process() instead of
  poking internals (old code had array-size mismatch bug: IR FFT at ir_len vs
  block FFT at conv_size)
- 46 tests: loading, convolution correctness, overlap-add state, mix, toggle,
  directory listing, performance budget (all <5ms even at 8192 taps), edge cases
- scripts/download_irs.sh: free IR pack downloader (God's Cab, Seacow)
2026-06-07 23:46:02 -04:00
shawn c38a7b0fd8 Add main entry point + systemd services + integration tests
New files:
  main.py                   - PedalApp: boots all subsystems in order,
                              wires MIDI/footswitch callbacks, graceful
                              teardown reverses boot order
  src/system/config.py      - YAML config loader with deep-merge
                              (separated to avoid hardware deps)
  src/system/services.py    - systemd unit generator for pedal.service
                              + multi-fx-pedal.target
  scripts/install_service.sh - copies project, creates venv, installs
                              + enables service units
  tests/test_integration.py - 41 tests: boot, routing, display sync,
                              teardown, systemd content, CLI, edge cases

Modified:
  tests/conftest.py         - add project root to sys.path
2026-06-07 23:39:50 -04:00
shawn d9682f3bea Build all FX blocks: gate, comp, boost/od/dist/fuzz, eq, mod (chorus/flanger/phaser/tremolo/vibrato), delay, reverb (Schroeder), volume
- 15 FX blocks implemented with per-block state isolation
- All blocks <500us per 256-sample block (reverb closest at 465us on x86)
- 57 unit tests all passing (per-effect, chain, bypass, state isolation)
- Benchmark script at scripts/benchmark_fx.py
- Vectorised delay reads via read_block_varying()
- scipy.lfilter for EQ (3-band RBJ) and reverb damping
- Fixed _DelayLine.write_block wraparound crash for large blocks
- Comb/Allpass buffers sized to BLOCK_SIZE * 2 minimum
2026-06-07 23:32:28 -04:00
shawn ce06a4360d Build: hardware UI layer — footswitch debounce, RGB LEDs, OLED display
- footswitch.py: GPIO debounce engine (20ms window), long-press detection
  (500ms), threaded poll loop with virtual pin support for testing
- leds.py: WS2812B/APA102 RGB LED controller with bypass indicator
  (red/green), preset navigation scan animation, tap tempo blip,
  configurable brightness (0.0-1.0)
- display.py: SSD1306 128x64 OLED renderer with preset mode (bank +
  preset name + FX chain), tuner mode (note + cents bar), FX edit
  (parameter bar), settings mode, boot splash
- __init__.py: Public API re-exports for all 3 modules
- tests/test_ui.py: 37 tests — debounce engine, GPIO simulation,
  short/long press boundary, LED pixel control, bypass colors,
  display mode rendering (preset/tuner/fx_edit/settings)
- scripts/ui_test.py: standalone test tool (python scripts/ui_test.py
  --all or --interactive)
2026-06-07 23:26:44 -04:00
shawn ed29748a62 Initial scaffold: Pi Multi-FX Pedal with NAM A2, IR cab, multi-FX, MIDI, stomp UI 2026-06-07 23:22:43 -04:00