Skip to content
asydPublic

About

Test tones, noise and sweeps to hear what your EQ does, and check the sample rate your DAC really gets

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

tonefork

A tiny test-signal generator to hear what your EQ and Bass/Treble settings actually do, even without a trained ear.

It plays steady tones, bands of noise, pink noise and sweeps at a controlled, matched loudness, so you can switch a setting on and off and hear the difference. Made as a companion to rmediy-rs (a terminal remote control for the RME ADI-2 DAC), but it works with any audio device.

It can also show, and force, the sample rate your hardware really receives: handy to check what a DAC gets through PipeWire (see Sample rate).

Download

A Linux amd64 binary of the latest commit on main is published as the latest pre-release. It is rebuilt at every push (not a versioned release), on Debian 12, so it runs on Debian 12+, Ubuntu 22.04+ and most recent distributions. It needs the ALSA runtime library (libasound2 on Debian/Ubuntu).

gh release download latest --repo asyd/tonefork    # or download the archive from the release page
sha256sum -c tonefork-linux-amd64.tar.gz.sha256
tar xzf tonefork-linux-amd64.tar.gz && ./tonefork list

Or build it yourself, as described below.

Quick start

git clone https://github.com/asyd/tonefork && cd tonefork
cargo build --release          # binary: target/release/tonefork

tonefork list                   # output devices
tonefork noise                  # pink noise, -40 dBFS (quiet), Ctrl-C to stop

Start with your DAC / amplifier volume low, then raise it.

Requirements: Rust 1.85+, and on Debian/Ubuntu libasound2-dev and pkg-config to build. Linux with PipeWire or PulseAudio is the tested setup (--force-clock also needs the pw-metadata command).

Modes

Command What it plays
tonefork noise Pink noise. Sounds "flat", so any boost or cut is easy to notice: best for the overall tonal balance.
tonefork band 85 An octave-wide band of noise around 85 Hz. Easier to judge than a sine.
tonefork tone 1000 A continuous sine.
tonefork sweep A logarithmic sweep, 20 Hz to 20 kHz by default (--from, --to), repeated.
tonefork steps Walks through the ten octave bands (31.5 Hz to 16 kHz), 4 s each, printing the frequency.
tonefork stereo [hz] Left only, right only, then the middle, 3 s each, at the same level (pink noise, or a sine at hz). See below.
tonefork pan [hz] A bell struck repeatedly, moving from the left speaker to the right one and back (bell pitch hz, default 440).
tonefork list Lists the output devices.

Every mode is scaled to the same RMS level, so switching between them does not change the perceived loudness much. Sound fades in over 1 s and fades out on Ctrl-C, so there are no clicks.

Options

Option Meaning
--level <dBFS> RMS level. Default -40, hard maximum -12.
--secs <n> Seconds per step (steps, default 4) or per sweep (default 12).
--freqs <a,b,c> Frequencies for steps, e.g. --freqs 85,250,1000,6500.
--noise steps with band noise instead of sine tones.
--device <text> Output device whose name contains <text>. Default: the session's default sink.
--host <alsa|pulse> Audio backend. Default: PipeWire/PulseAudio when available, else ALSA.
--from <Hz>, --to <Hz> Range of sweep (default 20 to 20000).
--preset <name> voice (with steps) or crossover (with sweep), see below.
--buffer-ms <ms> Audio buffer, default 200. Smaller: the printed frequencies and Ctrl-C follow the sound more closely. Larger: safer on a busy machine.
--polarity With stereo: add a fourth step that inverts the right channel, to check the wiring polarity.
--rate <Hz> Request a sample rate for the stream.
--force-clock With --rate: set PipeWire's clock to that rate while playing, then restore it.

A listening recipe

  1. Start with the volume low. The default level is deliberately quiet.
  2. Play tonefork noise and switch your EQ or Bass/Treble on and off: you should hear the tonal balance change.
  3. To hear one setting precisely, play tonefork band <freq> at the frequency you are adjusting and move only that band's gain.
  4. Use tonefork steps --noise to walk across the spectrum and find which regions a setting affects.

Why noise rather than sines? Low and very high sine tones are hard to hear at low level (the ear is much less sensitive there), and sines excite room resonances. A band of noise is easier to judge.

Checking the stereo image

tonefork stereo               # left, right, middle (pink noise)
tonefork stereo 1000 --polarity
tonefork pan                  # a bell moving from left to right and back

stereo plays the left speaker alone, then the right one alone, then the middle, each at the same RMS level. The middle plays both channels at -3 dB each, so that it has the same power as one channel alone (the usual pan law). What to check:

  • Left / right: each sound must come from its own speaker only, and be as loud as the other.
  • Middle: the sound must appear midway between the speakers, not stuck in one of them.
  • --polarity: a fourth step plays the middle with the right channel inverted. It should sound diffuse and thin in the bass. If it sounds better than the normal middle step, one speaker is wired in reverse polarity.

pan strikes a synthetic bell (additive synthesis after Jean-Claude Risset's bell) every 0.8 s and moves it across the stereo field with an equal-power pan law; each strike prints a small map of its position. The path should be smooth, with no jump or hole in the middle. It is a synthetic bell, not a recording: it does not reproduce any particular record.

Checking the voice range

tonefork --preset voice steps

Plays octave-wide bands of noise at 125, 250, 500, 1000, 2000, 3000, 4000 and 6000 Hz, 5 s each, printing what each region tends to reveal (chest, warmth, "honky", vowels, presence, intelligibility, edge, sibilance). Use it to put a name on the region you are adjusting: a voice that "lacks mids" usually means roughly 300 Hz to 4 kHz.

To judge an EQ change on real material, compare at equal loudness (a boost makes things louder, and louder sounds better), with small gains (+2 to +3 dB). Speech (a podcast, a radio recording) is a cleaner test than a mixed song, because an EQ acts on the whole mix and cannot isolate one voice.

Checking a subwoofer / speaker handover

tonefork --preset crossover sweep

A sine sweep from 50 to 150 Hz over 20 s, repeated, printing the frequency every 5 Hz and marking the usual landmarks of an active subwoofer (the ADAM Sub8's Frequency knob range, its 85 Hz satellite filter). Listen for a dip or a bump around the handover; try the subwoofer's Phase switch (0° / 180°) and its Frequency knob, and keep the setting where the bass is the most even.

Be realistic about what this shows: in a room, the bass modes create peaks and dips of their own in this very range, so a sweep reveals the room at least as much as the crossover. Compare settings of the same sweep (phase 0° vs 180°, filter on vs off) rather than judging one sweep in isolation. See docs/audio-path.md for how a subwoofer sits in the chain.

Sample rate

A PipeWire desktop resamples everything to its own clock (48 kHz by default), whatever an application asks for. tonefork prints the rate the hardware is really running at, 1.5 s after starting:

Stream : 192000 Hz, 2 ch, f32             <- what tonefork asked for
Hardware running now (what the DAC actually receives):
  DAC59920464 (card4): 192000 Hz, S32_LE  <- what reached the DAC
tonefork --rate 192000 --force-clock noise

This forces PipeWire's clock for the duration of the run and restores it afterwards. It affects the whole desktop and the DAC may click when the rate changes, so lower the volume first. Details, alternatives and caveats: docs/sample-rates.md.

Documentation

  • docs/audio-path.md: the layers between tonefork and the speakers (cpal, PipeWire, ALSA, USB, the DAC, an optional active subwoofer), with a diagram.
  • docs/sample-rates.md: playing at a high sample rate on Linux, and checking what the DAC receives.

The audio path, from the application to the speakers (click for the details):

Audio path: tonefork, PipeWire, ALSA, USB, DAC, subwoofer and speakers

Safety

Test signals can be loud and sustained. --level refuses anything above -12 dBFS RMS, but the real loudness also depends on the sound server's volume, the DAC's volume and what is connected. Start low, and do not use headphones while changing the sample rate.

License

MIT, see LICENSE.

About

Test tones, noise and sweeps to hear what your EQ does, and check the sample rate your DAC really gets

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages