Failed to load Vendor Allocator Library - VIM3 HW Codec2

Hi Khadas team, @tenk.wang, @jasonl, @goenjoy

While trying to run C2 HW codec in VIM3/Android12, we hit the same error that we hit in Android 11 which says it is unable to load the vendor allocator library. The Vendor Allocator header file (~/v4l2_codec2/plugin_store/include/v4l2_codec2/plugin_store/VendorAllocatorLoader.h) says that
// This class is for loading the vendor-specific C2Allocator implementations.
// The vendor should implement the shared library “libv4l2_codec2_vendor_allocator.so”
// and expose the function “C2Allocator* CreateAllocator(C2Allocator::id_t allocatorId);”.

The error log is below.
12-23 16:18:24.341 513 2047 I VendorAllocatorLoader: Create(): Failed to load library: libv4l2_codec2_vendor_allocator.so
12-23 16:18:24.342 513 2047 I V4L2PluginStore: createAllocator(): Fallback to create C2AllocatorGralloc(id=21)
12-23 16:18:24.342 513 2047 I V4L2PluginStore: createAllocator(): Fallback to create C2AllocatorGralloc(id=20)
12-23 16:18:24.342 513 2047 D CCodecBufferChannel: [c2.v4l2.avc.decoder#490] Configured output block pool ids 1 => OK
12-23 16:18:24.342 513 2047 D Codec2-OutputBufferQueue: remote graphic buffer migration 0/0
12-23 16:18:24.342 513 2047 D Codec2Client: setOutputSurface – failed to set consumer usage (6/BAD_INDEX)
12-23 16:18:24.343 513 2047 D Codec2Client: setOutputSurface – generation=525313 consumer usage=0x900
12-23 16:18:24.344 513 2047 D Codec2Client: Surface configure completed
12-23 16:18:24.344 513 2046 W ResourceManagerService: Ignoring request to add new resource entry with value <= 0
12-23 16:18:24.615 513 1535 D CCodecBufferChannel: [c2.v4l2.avc.decoder#490] Ignoring stale input buffer done callback: last flush index = 0, frameIndex = 0
12-23 16:18:25.227 513 1535 D CCodec : Component “c2.v4l2.avc.decoder” returned error: 0xe
12-23 16:18:25.227 513 2046 E MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 6/STARTED
12-23 16:18:25.228 513 2046 D SurfaceUtils: disconnecting from surface 0xe3a03278, reason disconnectFromSurface
12-23 16:18:25.232 513 2045 E NuPlayerDecoder: Decoder (video) reported error : 0x80000000
12-23 16:18:25.233 513 2039 E NuPlayer: received error(0x80000000) from video decoder, flushing(0), now shutting down

Can you please let us know if there is an implementation for creating - libv4l2_codec2_vendor_allocator.so or share a working library.

Thanks,
Anoop G

@Anoop Unfortunately, no. But there is an ongoing effort from BayLibre to make this work.
See: Sign in - Google Accounts