UI for 120Pedal
A temporary repository to experiment with building a TUI for 120Pedal from ratatui
This repository has been archived on 2026年05月18日 . You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
|
|
||
|---|---|---|
| notes/display-rotation | first commit | |
| src | first commit | |
| tests | first commit | |
| 120Pedal.md | first commit | |
| Cargo.lock | first commit | |
| Cargo.toml | first commit | |
| README.md | first commit | |
| SPEC.md | first commit | |
| touch_inject.c | first commit | |
120Pedal 🎸🧠
A guitar pedal system running on a Raspberry Pi, controlled through a terminal UI.
- Language: Rust
- UI: ratatui terminal interface
- Audio: ALSA / cpAL
- Platform: Raspberry Pi 5 with Touch Display 2
Quick start
cargo build
cargo run
See SPEC.md for architecture details, 120Pedal.md for the work log.
Display setup (RPi 5 + Touch Display 2)
If the display output is portrait and needs rotation, add this to /boot/firmware/config.txt:
dtoverlay=vc4-kms-dsi-ili9881-7inch,rotation=270,dsi0=1
Full setup guide in notes/display-rotation/SUMMARY.md.
Running on the Pi (puppy@120pedal.local)
The Pi runs the TUI on its physical console (tty2), not inside a desktop or tmux session. This gives direct framebuffer access for the ratatui interface and evdev touch input.
Deploy & launch
# 1. Build release binary (on the dev machine — same aarch64 arch)
cargo build --release
# 2. Copy to the Pi
rsync -vz target/release/pedal-120 puppy:/home/puppy/120Pedal/pedal-120
# 3. Launch on the physical display (tty2)
ssh puppy \
'sudo openvt -c 2 -s -f -- /home/puppy/120Pedal/pedal-120'
Touch coordinate mapping
By default the Pi uses Rotated mapping — the kernel handles the 270° rotation of the Touch Display 2. If touch coordinates are wrong, switch to Native mapping (software rotation):
ssh puppy \
'sudo env PEDAL_TOUCH_MAPPING=native openvt -c 2 -s -f -- /home/puppy/120Pedal/pedal-120'
Hot-reload after a rebuild
# Kill the old instance, rebuild, copy, launch — all in one
ssh puppy 'sudo pkill -f pedal-120 || true' && \
cargo build --release && \
rsync -vz target/release/pedal-120 puppy:/home/puppy/120Pedal/pedal-120 && \
ssh puppy 'sudo openvt -c 2 -s -f -- /home/puppy/120Pedal/pedal-120'
Debugging
- View the display remotely:
ssh puppy 'sudo chvt 2'thensudo chvt 1to return - Check logs:
ssh puppy 'sudo journalctl -u pedal-120'(if running as a service) - Framebuffer screenshot:
ssh puppy 'sudo fbcat /dev/fb0 > /tmp/fb.raw'then transfer and convert on the dev machine - Touch device detection: the app logs to stderr (visible if launched
without
openvtviassh -t puppy ~/120Pedal/pedal-120)
Requirements on the Pi
- Raspberry Pi 5 running Debian Trixie (aarch64)
- Touch Display 2 with
dtoverlay=vc4-kms-dsi-ili9881-7inch,rotation=270,dsi0=1in/boot/firmware/config.txt - GPM disabled — GPM translates absolute touch to relative mouse events
which breaks evdev touch input:
ssh puppy 'sudo systemctl stop gpm && sudo systemctl disable gpm' - User
puppywith sudo rights and the binary at~/120Pedal/pedal-120
Key bindings
| Key | Action |
|---|---|
q |
Quit |
Touch on a volume slider → select and drag to adjust.