Skip to content

fix: rebuild linux-arm64 LibJpegWrap.so with decoder#1

Merged
DanielKow merged 1 commit into
masterfrom
fix/arm64-libjpegwrap-decoder
Jun 2, 2026
Merged

fix: rebuild linux-arm64 LibJpegWrap.so with decoder#1
DanielKow merged 1 commit into
masterfrom
fix/arm64-libjpegwrap-decoder

Conversation

@DanielKow

Copy link
Copy Markdown
Contributor

Problem

On arm64 deployments (e.g. Neuron hardware), any server-side JPEG decode path throws at startup:

System.EntryPointNotFoundException: Unable to find an entry point named 'CreateDecoder' in shared library 'LibJpegWrap'.
   at ModelingEvolution.Mjpeg.JpegCodec..ctor()

The committed runtimes/linux-arm64/native/LibJpegWrap.so was a stale encoder-only build — it exported only Create and Encode, with no decoder, even though LibJpegWrap.cpp and the linux-x64/win binaries already had the full decoder API. It also linked the older libjpeg.so.62 ABI, while x64 links libjpeg.so.8.

Net effect: everything worked on x64 dev boxes and broke only on arm64 — MjpegProvider.TryGetFrame() could never construct its JpegCodec, so consumers that grab decoded frames (e.g. RocketWelder calibration camera snapshot, adaptive-point capture) failed hard.

Fix

Rebuilt runtimes/linux-arm64/native/LibJpegWrap.so from the current source in an Ubuntu 22.04 arm64 environment, linking libjpeg-turbo8-dev (libjpeg.so.8).

Before → after exports:

Before After
arm64 Create, Encode Create, Encode, CreateDecoder, DecodeJpegToGray, DecodeJpegToI420, DecoderDecodeGray, DecoderDecodeI420, EncodeGray8ToJpeg, CreateBgraDecoder, DecoderDecodeBGRA
NEEDED libjpeg.so.62 libjpeg.so.8

The arm64 binary now matches the x64 binary in both API surface and libjpeg ABI.

Why linking libjpeg.so.8 matters

The previous arm64 binary needed libjpeg.so.62, which isn't present in the standard runtime images (they ship libjpeg-turbo8 / libjpeg.so.8). Linking libjpeg.so.8 means no extra OS package is required in downstream images — this single change resolves both the missing-decoder error and the missing-libjpeg62 dependency.

Verification

  • nm -D on the rebuilt .so confirms the full decoder symbol set above.
  • objdump -p confirms NEEDED libjpeg.so.8.
  • Built natively for aarch64 (emulated Ubuntu 22.04 arm64), matching the deployment base image.

Follow-up

  • A 1.4.1 release (via release.sh) is needed so consumers can pick up the fixed package.
  • Consider having CI build the native libs per-RID instead of committing prebuilt binaries, to prevent the arm64/x64 drift that caused this.

@DanielKow DanielKow merged commit 58b0e83 into master Jun 2, 2026
0 of 2 checks passed
@DanielKow DanielKow deleted the fix/arm64-libjpegwrap-decoder branch June 2, 2026 18:31
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