Нет описания

Johan Le Baut 83fb0a79f6 add link repair 2 недель назад
config 9ad4db3ca6 check diff 2 недель назад
scripts 83fb0a79f6 add link repair 2 недель назад
tests 83fb0a79f6 add link repair 2 недель назад
.gitignore 5a7cbdfa6a config mix 2 недель назад
AGENTS.md 83fb0a79f6 add link repair 2 недель назад
README.md 83fb0a79f6 add link repair 2 недель назад

README.md

Rigforge

Scope

Rigforge is a standalone Raspberry Pi audio pedalboard. The desired routing is described in config/desired-state.yaml. Hardware-specific ports and operational settings remain provisional until tested on the target.

Current target observations

The current target reports Debian GNU/Linux 13.7, AArch64, and a Behringer UMC404HD 192k. ALSA advertises four capture and four playback channels. PipeWire 1.4.2 and WirePlumber are active in the logged-in jojo user session, with Linger=no.

PipeWire exposed four capture channels named capture_AUX0 through capture_AUX3 and four playback channels named playback_AUX0 through playback_AUX3. A four-channel 48 kHz recording was completed, with the guitar on physical input 1 appearing on capture_AUX0 and the microphone on physical input 3 appearing on capture_AUX2; the other channels were at noise floor during that test. A temporary PipeWire link from capture_AUX0 to playback_AUX0 produced audible guitar. The target owner reports that playback_AUX0 feeds output 1L and that Main Out L receives 1L with MIX set to PB and MONITOR set to A. The owner then added capture_AUX2 and confirmed hearing both guitar and microphone with a 128-frame quantum at 48 kHz; this is an initial successful low-latency listening test, not yet a sustained dropout or headroom measurement. Monitoring duplication, clipping headroom under summed sources and loop returns, and MIDI/OSC behavior have not yet been tested.

The target has aconnect, amidi, and oscsend; ALSA lists the UMC404HD MIDI port. This does not yet verify FCB1010 messages or SooperLooper OSC availability. amixer -D hw:2 scontents showed capture and playback controls at 0 dB; no mixer settings have been changed.

Target preparation recorded so far

Before collecting the target observations, the following commands were run on the current Raspberry Pi OS Lite installation:

sudo apt update
sudo apt upgrade
sudo apt install --no-install-recommends \\
  rtkit pipewire pipewire-jack wireplumber \\
  libspa-0.2-modules liblo-tools git

This records the preparation already performed on rigforge and is a starting point for documenting a second Pi. It is not yet a verified, version-pinned rebuild procedure: package versions, additional runtime dependencies, audio configuration, and service setup still need to be confirmed before reusing it as a complete deployment recipe.

Repository layout

  • config/desired-state.yaml: versioned desired audio topology and provisional target mapping.
  • config/pipewire/filter-chain.conf.d/rigforge-direct-mix.conf: tested filter-chain node configuration for the four-input mono direct mixer.
  • config/sooperlooper/fcb1010.slb: supplied FCB1010 binding file, pending on-target verification.
  • build/sooperlooper/: reserved for the later ARM64 Docker build definition.
  • scripts/validate_desired_state.py: validates topology and routing invariants without changing the target.
  • scripts/observe_pipewire.py: read-only comparison for explicitly declared UMC AUX ports and links.
  • tests/: unit tests for desired-state validation and the PipeWire observer.
  • artifacts/sooperlooper/arm64/: reserved for an artifact and its provenance, subject to repository hosting limits and redistribution terms.

The YAML describes desired state; a control surface is not a second source of truth. The initial audio profile declares 48 kHz and a quantum of 128 frames, which was reported to sound good during a temporary target test. At 48 kHz, 128 frames is about 2.7 ms per period, not the end-to-end latency. This runtime value has not yet been made persistent or measured under sustained load; apply it temporarily on the target with pw-metadata -n settings 0 clock.force-quantum 128 and return to automatic selection with pw-metadata -n settings 0 clock.force-quantum 0. Concrete PipeWire ports, buffer settings, package names, services, and artifact installation path will only be recorded as verified after target tests.

Validate the desired-state file on the development PC with:

python3 scripts/validate_desired_state.py
python3 -m unittest discover -s tests -v

The validator checks that there are four distinct physical inputs, one four-channel looper with each source assigned once, a declared mix output, and no active or planned route from looper returns back to looper inputs. It is read-only and does not connect audio ports or modify the target.

For an initial read-only graph observation on a system with pw-link, run:

python3 scripts/observe_pipewire.py

The observer reads pw-link -l and compares only connections whose endpoints are explicitly listed under routing.managed_ports; expected edges go in routing.managed_links. The current YAML lists the three tested guitar/microphone mixer links and only those exact observed UMC and filter-chain ports. WirePlumber's hardware links remain outside project management. The default command only reports missing or unexpected project links and never changes the graph.

An explicit one-shot mode can create missing declared links, after checking that the source and destination ports currently exist:

python3 scripts/observe_pipewire.py --reconcile-once

This mode never removes links, changes undeclared connections, or restarts services. It makes one attempt per missing managed link, then re-reads the graph and reports remaining differences. Use it only during a safe test window: a repaired link can immediately make audio audible. Do not disconnect a working link just to test repair during live use. If all desired links are already present, this mode is a no-op. This command has unit tests with simulated pw-link results, but has not yet been exercised on rigforge.

Candidate direct mix test

config/pipewire/filter-chain.conf.d/rigforge-direct-mix.conf defines a PipeWire builtin mixer with four mono inputs, a single mono output, and an initial gain of 0.2 per input. It was loaded on rigforge; its input and output nodes appeared in the graph. Manual links from capture AUX0 and AUX2 through mixer input ports AUX0 and AUX2 to playback AUX0 produced audible guitar and microphone together. Inputs 2 and 4 are provisioned but remain untested with instruments.

The installed PipeWire example documents loading fragments from ~/.config/pipewire/filter-chain.conf.d/ with pipewire -c filter-chain.conf, which is the command used by the current user service. The fragment was installed and tested in that user configuration without editing /etc or the packaged config:

target="$HOME/.config/pipewire/filter-chain.conf.d/rigforge-direct-mix.conf"
backup="$target.before-rigforge-test"
mkdir -p "$(dirname "$target")"
if test -e "$target"; then
    cp -a "$target" "$backup"
fi
install -m 0644 config/pipewire/filter-chain.conf.d/rigforge-direct-mix.conf "$target"
systemctl --user restart filter-chain.service

The test has already been performed on rigforge: filter-chain.service was active and exposed input ports rigforge.direct-mix.input:playback_AUX0 through playback_AUX3 and output port rigforge.direct-mix.output:capture_FL. The three links now declared in YAML were connected manually with pw-link; guitar on input 1 and microphone on input 3 were heard together through the mixer. Existing WirePlumber hardware links were left untouched.

Rollback the fragment and reload the filter service after the test:

if test -e "$backup"; then
    mv "$backup" "$target"
else
    rm -f "$target"
fi
systemctl --user restart filter-chain.service

This restarts only filter-chain.service, not the main PipeWire daemon. The fragment and three links have passed an initial target listening test, but the test is not a sustained load, dropout, four-instrument, or headroom test. If activation or sound behaves unexpectedly, first remove the test links, perform the rollback, verify the filter service is active, and do not repeatedly restart it. Repository tests check channel/gain declarations and observer comparisons; they do not replace target runtime measurements.

Development PC

The development host is Ubuntu AMD64 with Docker. The SooperLooper source under evaluation is https://github.com/abarker/sooperlooper-mods. The Docker build procedure is intentionally not yet provided: first select a tag and inspect that tag's build instructions and licensing. The eventual build command must take an explicit tag, resolve and record its exact commit, build for ARM64, and record artifact architecture, runtime dependencies, provenance, and checksum. The container is for building only; SooperLooper will run natively on the Raspberry Pi.

No SooperLooper artifact or Dockerfile is included at this stage.

rigforge target

The filter-chain fragment is installed in the user configuration on rigforge, and filter-chain.service was restarted to load it. The user confirmed guitar and microphone are audible together through the filter. Three manual links are currently active and declared in routing.managed_links for observation only. This is an initial listening check, not a sustained load, dropout, four-instrument, or headroom test.

The next target checks are:

  1. Run the read-only PipeWire observer on rigforge; the expected result is no differences while the three test links remain active.
  2. Later, test inputs 2 and 4 with sources when available; they are included in the mixer but not verified with instruments.
  3. Measure sustained stability and headroom at 48 kHz / 128 frames with all active sources; the current ERR = 0 observation was brief.
  4. Inspect the user service session and resource limits before defining autonomous startup. Linger=no currently means the running audio session is associated with the active login; unattended startup is not established.
  5. Verify FCB1010 MIDI messages and the supplied bindings with the eventual SooperLooper build. Verify OSC port readiness and the effect and persistence of discrete_prefader 0 separately.

Do not treat planned packages, commands, ports, or service settings as target-validated until these checks have been performed.

Deployment and rollback

Deployment is manual: inspect and test a change, then use git pull on rigforge only when the change is ready. No CI/CD or auto-pull is configured. Service installation, activation, logs, diagnostics, and rollback commands will be documented after their units and target paths have been tested. Keep the last known working revision available; do not apply unverified audio or service changes during live use.