Skip to content

Use omx-dsp 0.21.0 instead of private copies of omx_lin_to_db_d and omx_db_to_lin #87

Open

Description

@linuxnow

The LV2 measurers convert levels to dB with their own 20 * log10(...) and one dB-to-linear pow, where omx-dsp has the functions and plugin-qualify already builds against it (omx-dsp >= 0.18.0). Operator rule, 2026-10-16: "If it is in the lib we should use it in plugins and every dependency."

Found by a sweep of every FreeMixer repo against omx-dsp main (0f23bed), plugin-qualify main 6198927.

The copies

where replace with bit-identical?
native/lv2-measure.c:880, :898, :899, :900, :901, :1124: 20.0 * log10(rms...) omx_lin_to_db_d(x, 0.0) (<omxdsp/omx_units.h>), inside the existing > 0 ? ... : -999.0 guards yes: the library's body is 20.0 * log10(lin > floor ? lin : floor)
native/lv2-host-probe.c:88: 20.0 * log10(mag < 1e-12 ? 1e-12 : mag) omx_lin_to_db_d(mag, 1e-12) yes for every finite mag; a NaN differs (the library floors it, the copy keeps NaN)
native/lv2-host-probe.c:66: pow(10.0, HOT_EXCESS_DB / 20.0) omx_db_to_lin no, only equivalent: the library is float, powf(10, db * 0.05f), and has no double twin. Replacing it moves the probe's stimulus by float rounding. Decision for the operator: either omx-dsp adds omx_db_to_lin_d and this line takes it verbatim, or the line stays and goes on the allowlist. Do not switch it in the verbatim commit.

Not copies: native/fixtures/synth.c (MIDI note to Hz, no library twin), level_db_at in lv2-host-probe.c (a single-bin DFT; the library has the full FFT only), tools/benchmark.py (Python).

Acceptance

  • One change set: the call switch, the deletion of the inline conversions, and the floor raised to omx-dsp >= 0.21.0 (packaging/plugin-qualify.spec BuildRequires, debian/control, the version make deps fetches). Same batch, each commit naming the others.
  • Verbatim: no rename, no cleanup, no behaviour change in the replacing commit; improvements are separate commits after.
  • Proof that nothing moved: the measurer's printed readings on the qualification corpus are byte-identical before and after; oracles and goldens green at the nine rates (32 to 192 kHz).
  • A grep proof in the change: git grep -n 'log10\|pow(10' native/*.c prints only lines that are on the allowlist with a reason.

Full sweep: ~/.local/share/omx/third/dsp-copies/sweep.md (r1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important — fix this month

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions