Skip to content

LV2 measurers: dB readings use omx-dsp's omx_lin_to_db_d (#87) - #88

Draft
linuxnow wants to merge 3 commits into
mainfrom
fix/87-lib-db
Draft

linuxnow wants to merge 3 commits into
mainfrom
fix/87-lib-db

Conversation

@linuxnow

Copy link
Copy Markdown
Contributor

Closes #87 (the dB conversions; the one pow stays, see below).

The LV2 measurer and the host probe wrote 20 * log10(x) by hand. omx-dsp has it as omx_lin_to_db_d, whose body is 20 * log10(lin > floor ? lin : floor). Three commits, in the order they must land: the omx-dsp floor (0.21.0: spec, debian/control, the version make deps fetches), the six sites in native/lv2-measure.c, and the one in native/lv2-host-probe.c. The Makefile gives the two programs omx-dsp's include path.

Checked on r1 in the worker image with omx-dsp at the 0.21.0 release commit (omx-dsp#166): everything under native/ builds. lv2_measure was run old and new on four installed plugins, soak (2 s) and the normal run: the printed records are identical once timings and memory figures are left out, including the -999 guard values. For the host probe, 20 million drawn magnitudes and the floor's neighbours give 0 differing bit patterns between the old expression and omx_lin_to_db_d(mag, 1e-12).

One difference, so it is in its own commit and can be dropped: a NaN magnitude in the host probe read NaN before and reads the floor, -240 dB, now. The measurer's sites are inside > 0 guards and never see one.

Left alone: native/lv2-host-probe.c:67, pow(10.0, HOT_EXCESS_DB / 20.0). The library only has omx_db_to_lin in float; it is not bit-identical. It needs either an omx_db_to_lin_d in omx-dsp or an allowlist entry.

The deps fetch needs the v0.21.0 tag of omx-dsp. Not merged, no release.

The spec's BuildRequires, debian/control and the version make deps fetches. Paired with the commit that switches the LV2
measurer's dB readings to omx-dsp's omx_lin_to_db_d and the one after it for the host probe.
The six 20.0 * log10(...) of the measurer (the soak's silent-window test and its four readings, the sweep's
rms_out) become omx_lin_to_db_d(x, 0.0), the library's 20.0 * log10(lin > floor ? lin : floor), inside the same
> 0 guards, so nothing the guard rejects reaches it. The Makefile gives the measurer omx-dsp's include path
(installed, else the headers make deps fetches). Paired with the floor commit before it.
20.0 * log10(mag < 1e-12 ? 1e-12 : mag) is omx_lin_to_db_d(mag, 1e-12), bit for bit for every finite magnitude (20 million
drawn magnitudes plus the floor's neighbours, 0 differing bit patterns). One case differs: a NaN magnitude read NaN
before and reads the floor, -240 dB, now. Kept in its own commit so it can be dropped alone. The line-67 pow(10, x / 20)
stays: the library has no double-precision twin. The probe's build gets omx-dsp's and omx-contract's include paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant