Skip to content

goke-osdrv-gk7205v200: ship the VQE engines the microphone path loads by dlopen - #2362

Draft
openipc-ai wants to merge 1 commit into
masterfrom
audio-vqe-engines-goke
Draft

goke-osdrv-gk7205v200: ship the VQE engines the microphone path loads by dlopen#2362
openipc-ai wants to merge 1 commit into
masterfrom
audio-vqe-engines-goke

Conversation

@openipc-ai

Copy link
Copy Markdown
Collaborator

The Goke half of #2361, split out because it is the only part that adds binaries and the only part with no hardware to validate it on.

Do not merge until someone runs it on a GK7205V200. Opened as a draft so the work is not lost and is ready the moment a board is available.

What it does

Identical mechanism to the HiSilicon side. libupvqe.so is only the framework — it dlopens one shared object per DSP stage when HI_MPI_AI_EnableVqe() runs, resolving names from a lib%s_%s.so template, and prints dlopen libvqe_common.so/libsecurec.so or %s failed when they are missing. Goke names them libvqe_* where HiSilicon names them libhive_*.

Installs only the stages majestic can switch on — libvqe_hpf, libvqe_anr, libvqe_agc, libvqe_common (a NEEDED of the last two, not a stage), and libvqe_record for the 48 kHz path. AEC and EQ are not exposed; the resampler is compiled into libupvqe.so itself (RES_ReSampler_* are defined there), so libvqe_res.so is never loaded.

Gated ifeq ($(OPENIPC_MAJESTIC),ultimate), and placed in files/vqe/ rather than files/lib/ because this package installs files/lib/* wholesale and there is no other way to keep 360 KB out of a lite image.

Provenance

The five libraries come from the GK7205V200 vendor SDK drop — the same drop the twenty libraries already in files/lib/ came from. Before copying these five I verified every one of those twenty is byte-identical to a file in that drop, libupvqe.so (the loader that will dlopen these) among them.

That satisfies the checklist's success criterion as written — "traces to a vendor SDK release or to a source tree the build system compiles" — but provenance is not runtime validation, which is the open question below.

What is missing

No GK7205V200 on the bench. Matching provenance and an identical dlopen mechanism are not the same as watching the enable call succeed on the part, and I am not willing to claim otherwise.

What needs running on a real board, on an ultimate image built from this branch:

  1. Start majestic with audio.enabled: true, audio.srate: "8000", audio.vqe: true.
  2. Confirm the log shows talk VQE on at 8000 Hz with no dlopen ... failed or create vqe fail on the console.
  3. Capture http://<cam>/audio.pcm with vqe: false and again with vqe: true, same room, and compare energy in 20–80 Hz against 300–1000 Hz. The high-pass filter should cut the former by an order of magnitude and leave the latter alone.

For reference, that test on the two HiSilicon boards in #2361 gave:

board 20–80 Hz (stopband) 300–1000 Hz (speech)
hi3516ev300 (3516E200) 0.03x 0.98x
hi3516av300 (3516C500) 0.01x 1.38x

If any engine turns out to be ABI-incompatible with the shipped Goke userspace, the fix is to take the binaries from whichever SDK drop matches libupvqe.so in files/lib/ — but that is already the drop these came from.

… by dlopen

The Goke half of the change that installs the voice quality enhancement
engines for OpenIPC/majestic#287. The HiSilicon side landed separately; this
is kept apart because it is the only part that adds binaries to the tree and
the only part with no hardware here to run it on.

Same mechanism as HiSilicon. libupvqe.so is only the framework: it dlopen()s
one shared object per DSP stage when HI_MPI_AI_EnableVqe runs, resolving names
from a "lib%s_%s.so" template, and it prints

  dlopen libvqe_common.so/libsecurec.so or %s failed

when they are absent. Goke names them libvqe_* where HiSilicon names them
libhive_*. Only the stages majestic can switch on are installed: the high-pass
filter, noise reduction and automatic gain control of the 8/16 kHz talk
engine, libvqe_common.so which is a NEEDED of the last two, and the 48 kHz
record engine. Echo cancellation and the equaliser are not exposed, and the
resampler is compiled into libupvqe.so itself (RES_ReSampler_* are defined
there), so libvqe_res.so is never loaded.

They sit in files/vqe/ rather than files/lib/ because this package installs
files/lib/* wholesale, and there is no other way to keep 360 KB out of a lite
image where majestic has no VQE compiled in to load them.

Provenance: the five libraries come from the GK7205V200 vendor SDK drop, the
same drop the twenty libraries already in files/lib/ came from. Each of those
twenty was checked byte-identical to a file in that drop before these five
were copied from it, and libupvqe.so -- the loader that will dlopen them --
is one of the twenty.

Not validated on hardware. There is no GK7205V200 on the bench, and matching
provenance and an identical dlopen mechanism are not the same as watching the
enable call succeed on the part. Holding this until someone can run it.
@openipc-ai
openipc-ai force-pushed the audio-vqe-engines-goke branch from c4723a4 to 2aa1583 Compare September 4, 2026 17:35
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.

1 participant