RKAVM License 授权导入
使用新版本 librkavm.so 后,RKAVM 需要先完成 License 校验。旧版本库可能不需要 License 校验,因此旧版本 demo 可以直接运行;换成新库后,如果没有导入 License,rk_avm_test 会在初始化阶段报错。
常见日志如下:
neardi@LPA3588:~/AVM-2026/rk_avm_demo/install/rk_avm_test$ ./rk_avm_test
RKAutoCalib: [rkavm_function_enter][329]: Debug: enter
RKAutoCalib: [rkavm_control_init][1518]: Error: The verify license was not checked, plz using rkavm_auth_verify func to try verify the license
RKAutoCalib: [rkavm_startProcess][920]: Error: The verify license was not checked, plz using rkavm_auth_verify func to try verify the license
dlopen libdrm.so.2 success
drm init success
RKAutoCalib: [AvmAlgoBufferPrepare][1287]: Error: AvmAlgoBufferPrepare(1287): process thread is not ready
RKAutoCalib: [rkavm_setDisplay_import][1106]: Error: rkavm_setDisplay_import(1106): display thread is not already
RKAutoCalib: [rkavm_setSurround3dType][1231]: Error: rkavm_setSurround3dType(1231): process thread is not ready
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.5) /data/chifred/git/UtilsLib/opencv/modules/imgproc/src/color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
Aborted (core dumped)
处理方法就是:用 Rockchip RKAUTH 工具生成授权文件,把授权文件放到板端,然后在 AVM 程序启动 RKAVM 前调用 rkavm_auth_verify()。
授权信息
先准备授权信息:
| 项目 | 示例 |
|---|---|
| 授权账户 | shldkj |
| 密码 | 使用实际密码 |
| 授权模块 | RKAVM |
| 授权数量 | 按实际购买数量填写 |
提示
配套授权工具获取路径:
git clone http://git.neardi.com/rockchip/tools/rkauth_tool
准备工具
将 rkauth_tool 放到 LPA3588 板端。本文示例目录为:
~/license/rkauth_tool_v2.0.0rc5_20250625
LPA3588 Ubuntu 系统使用 Linux aarch64 工具:
cd ~/license
./rkauth_tool_v2.0.0rc5_20250625/bin/Linux/aarch64/rkauth_tool_bin --help
常用的三个工具是:
rkdevice_info
rkauth_tool_bin
rkauth_verify_licence
获取设备信息
在板端生成 device.inf:
cd ~/license
./rkauth_tool_v2.0.0rc5_20250625/bin/Linux/aarch64/rkdevice_info ./device.inf
cat ./device.inf
示例输出:
success save device info to ./device.inf
3588:b750573f9236a39b
这个文件后面生成 License 会用到,License 和这台设备信息绑定。
生成 License
使用 rkauth_tool_bin 联网生成授权文件,输出到 /data/key.lic:
sudo ./rkauth_tool_v2.0.0rc5_20250625/bin/Linux/aarch64/rkauth_tool_bin \
--module RKAVM \
--user "shldkj" \
--passwd "your_password" \
--device_info ./device.inf \
--type 0 \
--action 0 \
--comment 0 \
--output /data/key.lic
这里要用 --output,不是 --license。如果写 /data/key.lic 提示权限不足,就加 sudo 执行。
确认文件已经生成:
ls /data/key.lic
校验 License
执行:
./rkauth_tool_v2.0.0rc5_20250625/bin/Linux/aarch64/rkauth_verify_licence \
--module RKAVM \
--device_info ./device.inf \
--lic /data/key.lic \
--lic_type 0
预期返回:
0
返回 0 表示 RKAUTH_OK,License 校验通过。
在 AVM 程序中导入 License
进入 AVM demo 源码目录,先查一下 rkavm_auth_verify:
cd ~/AVM-2026/rk_avm_demo
grep -irn "rkavm_auth_verify" ./
示例结果:
./src/RkAvm.h:203:int rkavm_auth_verify(const char* key_path);
./src/main.cpp:112: //rkavm_auth_verify("/data/key.lic");
打开 src/main.cpp,在 RKAVM 初始化前打开 License 校验:
rkavm_auth_verify("/data/key.lic");
然后重新编译:
./build.sh
重新运行 Demo
执行:
cd ~/AVM-2026/rk_avm_demo/install/rk_avm_test
./rk_avm_test
License 导入正常后,日志里会看到校验成功:
auto gen json file: {"license_path": "/data/key.lic"}
RKAutoCalib: [rkavm_function_enter][329]: Debug: enter
RKAutoCalib: [rkavm_control_init][1534]: Debug: check success
RKAutoCalib: [rkavm_control_init][1551]: Debug: init rkavm thread ok
RKAutoCalib: [rkavm_function_exit][334]: Debug: exit
RKAutoCalib: [process][1354]: Debug: process(1354): receive CMD_PROCESS_START
RKAutoCalib: [initSurround3d][854]: Debug: setting /data/AppData_rk/NVP6188-AHD/avm_settings.xml ,start init Surround
RKAutoCalib: [egl_init][1470]: Debug: egl_init1470: run success
RKAutoCalib: [rk_avm_init][448]: Debug: rk_avm_init:448 avm_api version: 1.3.1_[10]
RKAutoCalib: [rk_avm_init][452]: Debug: Render init success
RKAutoCalib: [initSurround3d][861]: Debug: surround3d init success
dlopen libdrm.so.2 success
drm init success
RKAutoCalib: [process][1373]: Debug: process(1373): receive CMD_PROCESS_BUF_IPT_EXT
rga_api version 1.10.1_[4]
RKAutoCalib: [EvsImportBuffer][359]: Debug: EvsImportBuffer359:RKAVM:CAMERA 0 import buffer handle 270 success
RKAutoCalib: [EvsImportBuffer][359]: Debug: EvsImportBuffer359:RKAVM:CAMERA 1 import buffer handle 271 success
RKAutoCalib: [EvsImportBuffer][359]: Debug: EvsImportBuffer359:RKAVM:CAMERA 2 import buffer handle 272 success
RKAutoCalib: [EvsImportBuffer][359]: Debug: EvsImportBuffer359:RKAVM:CAMERA 3 import buffer handle 273 success
capfmt = v4l2src device=/dev/video12 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! appsink name=sink sync=false max-buffers=2 drop=true
capfmt = v4l2src device=/dev/video11 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! appsink name=sink sync=false max-buffers=2 drop=true
capfmt = v4l2src device=/dev/video13 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! appsink name=sink sync=false max-buffers=2 drop=true
capfmt = v4l2src device=/dev/video14 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! appsink name=sink sync=false max-buffers=2 drop=true
Using mplane plugin for capture
camera 0 /dev/video11 rows=1620 cols=1920 channels=1 type=0
camera 1 /dev/video12 rows=1620 cols=1920 channels=1 type=0
camera 2 /dev/video13 rows=1620 cols=1920 channels=1 type=0
camera 3 /dev/video14 rows=1620 cols=1920 channels=1 type=0
如果仍然看到 The verify license was not checked,优先确认 /data/key.lic 是否存在,以及重新编译后的程序里是否真的调用了 rkavm_auth_verify("/data/key.lic")。