Evens out audio across modes and stations, and moves ambed's settings into
a config file so levels can be tuned without a rebuild or restart.
Audio chain:
- Every path now runs decode -> <MODE>_TO_PCM -> bandpass filter -> AGC ->
PCM_TO_<MODE> -> encode, including M17 <-> P25.
- One decode and one encode gain per mode replace the per-path gains.
- Signal processing is rebuilt for each stream, so a stream starts clean and
doesn't inherit the previous station's gain.
- The bandpass filter clamps its output to the short range.
AGC:
- Levels the speaker, not the syllable. It works like the AGC on an HF
receiver: fast down, hold through gaps, then up, faster the further a
station is below the target.
- Follows speech peaks, moving the gain between syllables and leaving the
shape of the speech alone for the vocoders.
- Pauses and noise below AGC_GATE leave the gain where it is.
- The gain ramps across each frame, so a change can't click.
- A peak limiter leaves room for the highest encode gain, so a boost can't
clip an encoder.
ambed.ini:
- The command line is now ambed [ambed.ini], and main.h holds the defaults.
The old ambed <ip> form is refused, so it can't bind to the wrong address.
- Holds the listen IP and port, DSCP marking, stream timeout, logging, gains,
AGC and filter settings. USE_AGC and USE_BANDPASSFILTER are now runtime
options.
- Checked every 3 minutes. Most changes apply from the next stream, DSCP
changes at once, and the listen IP and port need a restart. xlxd's
TRANSCODER_PORT must match LISTEN_PORT.
- A setting left out uses its default. A bad value is logged and the value
in use stays.
- make install copies the sample only if there is no ambed.ini, and the run
script and systemd service pass its path.
Tuning log: when a stream closes, ambed logs voice level, peak and clipping
after decode, after the decode gain, after the AGC and after each encode
gain, plus the speech peaks, AGC gain and limiter activity. With
AGC_CLAMPING=0 the audio is untouched and the levels are still logged.
TUNING_LOG turns the log on or off.
The readme is now README.md, rewritten to cover the audio chain, every
setting, how to tune and an example systemd unit.