Open rageworx opened 5 years ago
just try like this.
./mpi_enc_test -f 4 -w 2456 -h 2054 -t 8 -o test.jpg -n 1 -d 1
mpi_enc_test will filling a dummy raw file for encoder.
Dear @sliver-chen It's same with your dummy testing code.
linaro@linaro-alip ~/Projects/mpp/build/test release
> ./mpi_enc_test -f 4 -w 2456 -h 2054 -t 8 -o test.jpg -n 1 -d 1
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name:
mpi_enc_test: output file name: test.jpg
mpi_enc_test: width : 2456
mpi_enc_test: height : 2054
mpi_enc_test: format : 4
mpi_enc_test: type : 8
mpi_enc_test: debug flag : 1
mpi_enc_test: mpi_enc_test start
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test: mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp_create enter ctx 0x55a86061a8 mpi 0x55a86061b0
mpi: mpp version: 2dc830f0 author: sliver.chen [vp8e]: add vpu1 and vpu2 vp8e supprt.
mpi: mpp_create leave ret 0 ctx 0x55a8607340 mpi 0x7f92437720
mpi: mpp_init enter ctx 0x55a8607340 type 1 coding 8
mpi: mpp_init leave ret 0
mpi: mpi_control enter ctx 0x55a8607340 cmd 320003 parm 0x55a86061b8
mpi: mpi_control leave ret 0
mpi_enc_test: mpi_enc_test bps 18917340 fps 30 gop 60
mpi: mpi_control enter ctx 0x55a8607340 cmd 320005 parm 0x55a8606204
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55a8607340 cmd 320007 parm 0x55a860623c
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55a8607340 cmd 32000f parm 0x55a8606cd0
mpi: mpi_control leave ret 0
mpi: mpi_encode_put_frame enter ctx 0x55a8607340 frame 0x55a860b1a0
jpege_api: jpege: hardware return error status 40
mpi: mpi_encode_put_frame leave ret 0
mpi: mpi_encode_get_packet enter ctx 0x55a8607340 packet 0x7ff70cca98
mpi: mpi_encode_get_packet leave ret 0
mpi_enc_test: test_mpp_run encoded frame 0 size 631116
mpi_enc_test: test_mpp_run encode max 1 frames
mpi: mpi_reset enter ctx 0x55a8607340
mpi: mpi_reset leave ret 0
mpi: mpp_destroy enter ctx 0x55a8607340
mpi: mpp_destroy leave ret 0
mpi_enc_test: mpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
Any solution to solve this issue ? Regards, Raph.
Is the output test.jpg correct or not?
Dear @HermanChen Dummy result opens in any graphic editor, but there's nothing, just 0x808080 contains. I'm trying to use right source, and wanna know what is error code 40. Should I can use RGB888 or YUV with single gray image ? Let me know. Regards, Raph.
emm, code 40 is irq for timeout. It seems encoder has error on reading frame or writing stream.
It does not happend on my Android platform. What is your kernel platform and verison?
Dear @HermanChen I'm not using Android, now on bebian-linux kernel 4.4 from 96board - rock960b model. You can refer other issue on same problem as you know, it belong to same kernel source and same service.
Dear, latest commits still in error by "jpege_api: jpege: hardware return error status 40", and still result jpeg cannot read by any viewer because nothing contains inside file except JPEG tags.
Here's test log:
> ./mpi_enc_test -f 4 -w 2456 -h 2054 -t 8 -i conv_01.yuv -o test.jpg -n 1 -d 1
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name: conv_01.yuv
mpi_enc_test: output file name: test.jpg
mpi_enc_test: width : 2456
mpi_enc_test: height : 2054
mpi_enc_test: format : 4
mpi_enc_test: type : 8
mpi_enc_test: debug flag : 1
mpi_enc_test: mpi_enc_test start
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test: mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp_create enter ctx 0x55c016d1a8 mpi 0x55c016d1b0
mpi: mpp version: da0f013b author: Johnson Ding [jpegd]: Fix vpu1 encoder problem
mpi: mpp_create leave ret 0 ctx 0x55c016e5c0 mpi 0x7f79c3f768
mpi: mpp_init enter ctx 0x55c016e5c0 type 1 coding 8
mpi: mpp_init leave ret 0
mpi: mpi_control enter ctx 0x55c016e5c0 cmd 320003 parm 0x55c016d1b8
mpi: mpi_control leave ret 0
mpi_enc_test: mpi_enc_test bps 18917340 fps 30 gop 60
mpi: mpi_control enter ctx 0x55c016e5c0 cmd 320005 parm 0x55c016d204
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55c016e5c0 cmd 320007 parm 0x55c016d23c
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x55c016e5c0 cmd 32000f parm 0x55c016dcd0
mpi: mpi_control leave ret 0
mpi: mpi_encode_put_frame enter ctx 0x55c016e5c0 frame 0x55c0173420
jpege_api: jpege: hardware return error status 40
mpi: mpi_encode_put_frame leave ret 0
mpi: mpi_encode_get_packet enter ctx 0x55c016e5c0 packet 0x7feb0cf8e8
mpi: mpi_encode_get_packet leave ret 0
mpi_enc_test: test_mpp_run encoded frame 0 size 631116
mpi_enc_test: test_mpp_run encode max 1 frames
mpi: mpi_reset enter ctx 0x55c016e5c0
mpi: mpi_reset leave ret 0
mpi: mpp_destroy enter ctx 0x55c016e5c0
mpi: mpp_destroy leave ret 0
mpi_enc_test: mpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
and also, your non-source testing way ( ./mpi_enc_test -f 4 -w 2456 -h 2054 -t 8 -o test.jpg -n 1 -d 1 ) not works, same error result.
here a link contains source image and results with some info. https://mega.nz/#!x59kHSaa!nurg8QOTONsWx6g_O9d31N5nRdXJqUuhNI7JEceFRsk
Are you sure that the "conv_01.yuv" file you provided is really a yuv file? I opened it in Vooya, but I saw a mess of dots, not an normal image. Besides, can you provide the kernel log when encoder failed with error code 40. If you don't have Vooya installed, you can open your yuv file on this site
I am now came back to continue do testing this again, I will make a new code for testing image from other source ( not YUV ), can I test with RGB source to JPEG ? Anyone has example to encode JPEG (q10, less loss) encode from RGB array, or Y (gray) only?
RGB is supported. use -f option in mpi_enc_test to specify color format. See MppFrameFormat in mpp_frame.h for color format values. It seems that Y (gray) only is not support directly. You can have a try. If it is not working properly, try to convert grey scale to other color formats, for example, YUV420SP.
I have the same issue (jpege_api: jpege: hardware return error status 40) on the same test example. I use ubuntu: "rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt". Kernel: "Linux linux 4.4.154-59-rockchip-g5e70f14 #4 SMP Fri Dec 14 20:55:41 CST 2018 aarch64 aarch64 aarch64 GNU/Linux".
Dear qvoid, I have tested trying encode RGB888 to JPEG, but encode_get_packet returns zero length.
linaro@linaro-alip ~/Projects/rkmpptest
> bin/rkmpptest imgs/grab_L\ 0.bmp
source : imgs/grab_L 0.bmp
output : imgs/grab_L 0.jpg
mpi_enc_test start
loading source ... size : 2456x2054 --> strided : 2464x2064
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
#Phase: MPP initialize.
#Phase: MPP set up.
mpi_enc_test bps 18917340 fps 30 gop 60
Configuring encoder ...
#Phase: MPP encoding.
-- mpp_frame_init
-- mpp_frame_set_xxx ...
-- encode_put_frame
-- encode_get_packet
encoded frame 0, but size is zero!
found last packet
encode max 1 framesmpi_enc_test success total frame 1 bps 0
mpp_buffer: ~MppBufferService cleaning misc group
I've modified mpi_enc_test to reads Windows BMP source, and encoding only for JPEG with FLTK for reading BMP. Here what I did:
106 width = img->w();
107 height = img->h();
108 hor_stride = MPP_ALIGN( width, 16 );
109 ver_stride = MPP_ALIGN( height, 16 );
110
111 // Convert image to MPP_FMT_RGB888
112 unsigned imgsz = width * height;
113 unsigned bufsz = hor_stride * ver_stride;
114
115 buf = new RK_U8[ bufsz * 3 ];
116 if ( buf != NULL )
117 {
118 memset( buf, 0, bufsz );
119
120 RK_U8* rbuff = (RK_U8*)img->data()[0];
121
122 for( unsigned cnt=0; cnt<height; cnt++ )
123 {
124 unsigned w_pos = ( cnt * hor_stride * 3 );
125 unsigned r_pos = ( cnt * width * 3 );
126
127 memcpy( &buf[w_pos], &rbuff[r_pos], width * 3 );
128 }
129 }
130
Update, I've been fixed a code mpp_frame_set_buffer() as mpp_frame_set_buffer( frame, p->frm_buf ); and now it returns some packet but problem is there's nothing inside except a header with error return 40.
> bin/rkmpptest imgs/grab_L\ 0.bmp
source : imgs/grab_L 0.bmp
output : imgs/grab_L 0.jpg
mpi_enc_test start
loading source ... size : 2456x2054 --> strided : 2464x2064
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
#Phase: MPP initialize.
#Phase: MPP set up.
mpi_enc_test bps 18917340 fps 30 gop 60
Configuring encoder ...
#Phase: MPP encoding.
-- mpp_frame_init
-- mpp_frame_set_xxx ...
-- encode_put_frame
HAL_JPEGE_VDPU2: hal_jpege_vepu2_set_extra_info other format(65542)
jpege_api: jpege: hardware return error status 40
-- encode_get_packet
encoded frame 0 size 631116
encode max 1 framesmpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
encoding code is here:
MPP_RET test_mpp_run(MpiEncTestData *p)
{
MPP_RET ret;
MppApi *mpi;
MppCtx ctx;
if (NULL == p)
return MPP_ERR_NULL_PTR;
mpi = p->mpi;
ctx = p->ctx;
while (!p->pkt_eos)
{
MppFrame frame = NULL;
MppPacket packet = NULL;
void *buf = mpp_buffer_get_ptr( p->frm_buf );
if ( p->srcbuff != NULL )
{
memcpy( buf, p->srcbuff, p->hor_stride * p->ver_stride * 3 );
//p->frm_eos = 1;
}
else
{
goto RET;
}
mpp_log("-- mpp_frame_init\n");
ret = mpp_frame_init(&frame);
if (ret) {
mpp_err_f("mpp_frame_init failed\n");
goto RET;
}
mpp_log("-- mpp_frame_set_xxx ...\n");
mpp_frame_set_width(frame, p->width);
mpp_frame_set_height(frame, p->height);
mpp_frame_set_hor_stride(frame, p->hor_stride);
mpp_frame_set_ver_stride(frame, p->ver_stride);
mpp_frame_set_fmt(frame, p->fmt);
mpp_frame_set_eos(frame, p->frm_eos);
mpp_frame_set_buffer( frame, p->frm_buf );
mpp_log("-- encode_put_frame\n");
ret = mpi->encode_put_frame(ctx, frame);
if (ret) {
mpp_err("mpp encode put frame failed\n");
goto RET;
}
mpp_log("-- encode_get_packet\n");
ret = mpi->encode_get_packet(ctx, &packet);
if (ret) {
mpp_err("mpp encode get packet failed\n");
goto RET;
}
if (packet) {
// write packet to file here
void *ptr = mpp_packet_get_pos(packet);
size_t len = mpp_packet_get_length(packet);
p->pkt_eos = mpp_packet_get_eos(packet);
if ( ( p->fp_output ) && ( len > 0 ) )
fwrite(ptr, 1, len, p->fp_output);
mpp_packet_deinit(&packet);
if ( len > 0 )
{
mpp_log_f("encoded frame %d size %d\n",
p->frame_count,
len);
}
else
{
mpp_log_f("encoded frame %d, but size is zero!\n",
p->frame_count );
}
p->stream_size += len;
p->frame_count++;
if (p->pkt_eos) {
mpp_log("found last packet\n");
mpp_assert(p->frm_eos);
}
}
if (p->num_frames && p->frame_count >= p->num_frames) {
mpp_log_f("encode max %d frames", p->frame_count);
break;
}
if (p->frm_eos && p->pkt_eos)
break;
}
RET:
return ret;
}
Dear, I can see an error message of "HAL_JPEGE_VDPU2: hal_jpege_vepu2_set_extra_info other format(65542)" in advanced code.
source : imgs/grab_L 0.bmp
output : imgs/grab_L 0.jpg
mpi_enc_test start
loading source ... size : 2456x2054 --> strided : 2464x2064
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
#Phase: MPP initialize.
#Phase: MPP set up.
mpi_enc_test bps 18917340 fps 30 gop 60
Configuring encoder ...
#Phase: MPP encoding.
-- mpp_frame_init
-- mpp_frame_set_xxx ...
-- encode_put_frame
HAL_JPEGE_VDPU2: hal_jpege_vepu2_set_extra_info other format(65542)
jpege_api: jpege: hardware return error status 40
-- encode_get_packet
encoded frame 0 size 631116
encode max 1 framesmpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
Is meant be "need to use other format" ? Let me knows.
Now I've been tested YUV420SP ( for only Y channels, we don't use color source ) and result is same.
> bin/rkmpptest imgs/grab_L\ 0.bmp
source : imgs/grab_L 0.bmp
output : imgs/grab_L 0.jpg
mpi_enc_test start
loading source ...
write buff pos : 5058592 / 7628544 .... size : 2456x2054 --> strided : 2464x2064
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
#Phase: MPP initialize.
#Phase: MPP set up.
mpi_enc_test bps 18917340 fps 30 gop 60
Configuring encoder ...
#Phase: MPP encoding.
-- mpp_frame_init
-- mpp_frame_set_xxx ...
-- encode_put_frame
jpege_api: jpege: hardware return error status 40
-- encode_get_packet
encoded frame 0 size 631116
encode max 1 framesmpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
result is still contains nothing, just zeroes except header. converted image ( YUV420SP ) was tested in your noticed web page(http://rawpixels.net/) to checked to can see well.
Any idea to solve this issue ? Regards, Raph.
Plus, I also tested my YUV420SP image on your test binary, and seems to exactly same.
> mpi_enc_test -i testdump.yuv420sp -o test.jpg -w 2456 -h 2054 -f 0 -t 8 -n 1 -d 1
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name: testdump.yuv420sp
mpi_enc_test: output file name: test.jpg
mpi_enc_test: width : 2456
mpi_enc_test: height : 2054
mpi_enc_test: format : 0
mpi_enc_test: type : 8
mpi_enc_test: debug flag : 1
mpi_enc_test: mpi_enc_test start
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test: mpi_enc_test encoder test start w 2456 h 2054 type 8
mpi: mpp_create enter ctx 0x559cb111a8 mpi 0x559cb111b0
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
mpi: mpp_create leave ret 0 ctx 0x559cb125c0 mpi 0x7f8d7bd118
mpi: mpp_init enter ctx 0x559cb125c0 type 1 coding 8
mpi: mpp_init leave ret 0
mpi: mpi_control enter ctx 0x559cb125c0 cmd 320003 parm 0x559cb111b8
mpi: mpi_control leave ret 0
mpi_enc_test: mpi_enc_test bps 18917340 fps 30 gop 60
mpi: mpi_control enter ctx 0x559cb125c0 cmd 320005 parm 0x559cb11204
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x559cb125c0 cmd 320007 parm 0x559cb1123c
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x559cb125c0 cmd 32000f parm 0x559cb11cd0
mpi: mpi_control leave ret 0
mpi: mpi_encode_put_frame enter ctx 0x559cb125c0 frame 0x559cb174a0
jpege_api: jpege: hardware return error status 40
mpi: mpi_encode_put_frame leave ret 0
mpi: mpi_encode_get_packet enter ctx 0x559cb125c0 packet 0x7fc3abc8f8
mpi: mpi_encode_get_packet leave ret 0
mpi_enc_test: test_mpp_run encoded frame 0 size 631116
mpi_enc_test: test_mpp_run encode max 1 frames
mpi: mpi_reset enter ctx 0x559cb125c0
mpi: mpi_reset leave ret 0
mpi: mpp_destroy enter ctx 0x559cb125c0
mpi: mpp_destroy leave ret 0
mpi_enc_test: mpi_enc_test success total frame 1 bps 151467840
mpp_buffer: ~MppBufferService cleaning misc group
And here a converted file for YUV420SP.
Plus, dmesg log here when trying encode JPEG.
[92799.132341] rk_vcodec: vpu_service_ioctl:1875: error: unknown vpu service ioctl cmd 40086c01
[92799.141011] rk_iommu ff650800.iommu: Page fault at 0x0000000000007380 of type read
[92799.141694] rk_iommu ff650800.iommu: iova = 0x0000000000007380: dte_index: 0x0 pte_index: 0x7 page_offset: 0x380
[92799.142594] rk_iommu ff650800.iommu: mmu_dte_addr: 0x00000000eed9d000 dte@0x00000000eed9d000: 0x000000 valid: 0 pte@0x0000000000000000: 0x000000 valid: 0 page@0x0000000000000000 flags: 0x0
[92799.144062] rk-vcodec ff650000.vpu_service: vcodec, fault addr 0x00007380 status 4b
[92799.144732] rk-vcodec ff650000.vpu_service: no memory region mapped
[92799.145286] rk-vcodec ff650000.vpu_service: dumping enc register set:
[92799.145853] rk-vcodec ff650000.vpu_service: reg[00] 00000000
[92799.146351] rk-vcodec ff650000.vpu_service: reg[01] 00000000
[92799.146849] rk-vcodec ff650000.vpu_service: reg[02] 04050a0e
[92799.147347] rk-vcodec ff650000.vpu_service: reg[03] 04070d12
[92799.147845] rk-vcodec ff650000.vpu_service: reg[04] 02030304
[92799.148343] rk-vcodec ff650000.vpu_service: reg[05] 03040506
[92799.148841] rk-vcodec ff650000.vpu_service: reg[06] 070b1013
[92799.149339] rk-vcodec ff650000.vpu_service: reg[07] 0b0d1114
[92799.149837] rk-vcodec ff650000.vpu_service: reg[08] 0505080a
[92799.150335] rk-vcodec ff650000.vpu_service: reg[09] 080c0b11
[92799.150833] rk-vcodec ff650000.vpu_service: reg[10] 0e101516
[92799.151332] rk-vcodec ff650000.vpu_service: reg[11] 16151814
[92799.151829] rk-vcodec ff650000.vpu_service: reg[12] 0a0c0e10
[92799.152328] rk-vcodec ff650000.vpu_service: reg[13] 0c0b0b0c
[92799.152826] rk-vcodec ff650000.vpu_service: reg[14] 15171815
[92799.153324] rk-vcodec ff650000.vpu_service: reg[15] 0f121414
[92799.153822] rk-vcodec ff650000.vpu_service: reg[16] 03040509
[92799.154320] rk-vcodec ff650000.vpu_service: reg[17] 0404050d
[92799.154819] rk-vcodec ff650000.vpu_service: reg[18] 14141414
[92799.155317] rk-vcodec ff650000.vpu_service: reg[19] 14141414
[92799.155815] rk-vcodec ff650000.vpu_service: reg[20] 05050b14
[92799.156312] rk-vcodec ff650000.vpu_service: reg[21] 090d1414
[92799.156811] rk-vcodec ff650000.vpu_service: reg[22] 14141414
[92799.157309] rk-vcodec ff650000.vpu_service: reg[23] 14141414
[92799.157807] rk-vcodec ff650000.vpu_service: reg[24] 14141414
[92799.158305] rk-vcodec ff650000.vpu_service: reg[25] 14141414
[92799.158803] rk-vcodec ff650000.vpu_service: reg[26] 14141414
[92799.159301] rk-vcodec ff650000.vpu_service: reg[27] 14141414
[92799.159798] rk-vcodec ff650000.vpu_service: reg[28] 14141414
[92799.160296] rk-vcodec ff650000.vpu_service: reg[29] 14141414
[92799.160794] rk-vcodec ff650000.vpu_service: reg[30] 14141414
[92799.161293] rk-vcodec ff650000.vpu_service: reg[31] 14141414
[92799.161791] rk-vcodec ff650000.vpu_service: reg[32] 00000000
[92799.162288] rk-vcodec ff650000.vpu_service: reg[33] 00000000
[92799.162786] rk-vcodec ff650000.vpu_service: reg[34] 00000000
[92799.163284] rk-vcodec ff650000.vpu_service: reg[35] 00000000
[92799.163782] rk-vcodec ff650000.vpu_service: reg[36] 00000000
[92799.164280] rk-vcodec ff650000.vpu_service: reg[37] 00000000
[92799.164778] rk-vcodec ff650000.vpu_service: reg[38] 00000000
[92799.165276] rk-vcodec ff650000.vpu_service: reg[39] 00000000
[92799.165774] rk-vcodec ff650000.vpu_service: reg[40] 00000000
[92799.166271] rk-vcodec ff650000.vpu_service: reg[41] 00000000
[92799.166769] rk-vcodec ff650000.vpu_service: reg[42] 00000000
[92799.167267] rk-vcodec ff650000.vpu_service: reg[43] 00000000
[92799.167765] rk-vcodec ff650000.vpu_service: reg[44] 00000000
[92799.168263] rk-vcodec ff650000.vpu_service: reg[45] 00000000
[92799.168761] rk-vcodec ff650000.vpu_service: reg[46] 00000000
[92799.169259] rk-vcodec ff650000.vpu_service: reg[47] 00000000
[92799.169757] rk-vcodec ff650000.vpu_service: reg[48] 00000000
[92799.170255] rk-vcodec ff650000.vpu_service: reg[49] 004d9a00
[92799.170753] rk-vcodec ff650000.vpu_service: reg[50] 004d9a00
[92799.171250] rk-vcodec ff650000.vpu_service: reg[51] 02110311
[92799.171748] rk-vcodec ff650000.vpu_service: reg[52] 003f0000
[92799.172246] rk-vcodec ff650000.vpu_service: reg[53] 004cf721
[92799.172744] rk-vcodec ff650000.vpu_service: reg[54] 01011000
[92799.173242] rk-vcodec ff650000.vpu_service: reg[55] 00000000
[92799.173740] rk-vcodec ff650000.vpu_service: reg[56] 00000000
[92799.174238] rk-vcodec ff650000.vpu_service: reg[57] 00000000
[92799.174736] rk-vcodec ff650000.vpu_service: reg[58] 00000000
[92799.175234] rk-vcodec ff650000.vpu_service: reg[59] 00000000
[92799.175732] rk-vcodec ff650000.vpu_service: reg[60] 0038002a
[92799.176230] rk-vcodec ff650000.vpu_service: reg[61] 000009a0
[92799.176727] rk-vcodec ff650000.vpu_service: reg[62] 00000000
[92799.177225] rk-vcodec ff650000.vpu_service: reg[63] 00000000
[92799.177723] rk-vcodec ff650000.vpu_service: reg[64] 00000000
[92799.178221] rk-vcodec ff650000.vpu_service: reg[65] 00000000
[92799.178719] rk-vcodec ff650000.vpu_service: reg[66] 00000000
[92799.179217] rk-vcodec ff650000.vpu_service: reg[67] 00000000
[92799.179715] rk-vcodec ff650000.vpu_service: reg[68] 00000000
[92799.180213] rk-vcodec ff650000.vpu_service: reg[69] 00000000
[92799.180711] rk-vcodec ff650000.vpu_service: reg[70] 00000000
[92799.181209] rk-vcodec ff650000.vpu_service: reg[71] 00000000
[92799.181706] rk-vcodec ff650000.vpu_service: reg[72] 00000000
[92799.182204] rk-vcodec ff650000.vpu_service: reg[73] 00000000
[92799.182702] rk-vcodec ff650000.vpu_service: reg[74] 00000010
[92799.183200] rk-vcodec ff650000.vpu_service: reg[75] 00000000
[92799.183698] rk-vcodec ff650000.vpu_service: reg[76] 00000000
[92799.184196] rk-vcodec ff650000.vpu_service: reg[77] 0009bc00
[92799.184694] rk-vcodec ff650000.vpu_service: reg[78] 00000000
[92799.185192] rk-vcodec ff650000.vpu_service: reg[79] 00000000
[92799.185690] rk-vcodec ff650000.vpu_service: reg[80] 00000000
[92799.186188] rk-vcodec ff650000.vpu_service: reg[81] 00000000
[92799.186686] rk-vcodec ff650000.vpu_service: reg[82] 00000000
[92799.187184] rk-vcodec ff650000.vpu_service: reg[83] 00000000
[92799.187682] rk-vcodec ff650000.vpu_service: reg[84] 00000000
[92799.188180] rk-vcodec ff650000.vpu_service: reg[85] 00000000
[92799.188678] rk-vcodec ff650000.vpu_service: reg[86] 00000000
[92799.189175] rk-vcodec ff650000.vpu_service: reg[87] 00000000
[92799.189673] rk-vcodec ff650000.vpu_service: reg[88] 00000000
[92799.190171] rk-vcodec ff650000.vpu_service: reg[89] 00000000
[92799.190669] rk-vcodec ff650000.vpu_service: reg[90] 00000000
[92799.191167] rk-vcodec ff650000.vpu_service: reg[91] 00000000
[92799.191665] rk-vcodec ff650000.vpu_service: reg[92] 00000000
[92799.192163] rk-vcodec ff650000.vpu_service: reg[93] 00000000
[92799.192661] rk-vcodec ff650000.vpu_service: reg[94] 00000000
[92799.193160] rk-vcodec ff650000.vpu_service: reg[95] 962b4c85
[92799.193658] rk-vcodec ff650000.vpu_service: reg[96] 90901d50
[92799.194155] rk-vcodec ff650000.vpu_service: reg[97] 0000b694
[92799.194653] rk-vcodec ff650000.vpu_service: reg[98] 00000000
[92799.195151] rk-vcodec ff650000.vpu_service: reg[99] 00000000
[92799.195649] rk-vcodec ff650000.vpu_service: reg[100] 00000000
[92799.196159] rk-vcodec ff650000.vpu_service: reg[101] 1f522780
[92799.196667] rk-vcodec ff650000.vpu_service: reg[102] 00000000
[92799.197177] rk-vcodec ff650000.vpu_service: reg[103] 08109a60
[92799.197686] rk-vcodec ff650000.vpu_service: reg[104] 00000000
[92799.198195] rk-vcodec ff650000.vpu_service: reg[105] fc000000
[92799.198704] rk-vcodec ff650000.vpu_service: reg[106] 00000000
[92799.199213] rk-vcodec ff650000.vpu_service: reg[107] 00000000
[92799.199721] rk-vcodec ff650000.vpu_service: reg[108] 00000000
[92799.200231] rk-vcodec ff650000.vpu_service: reg[109] 00001441
[92799.200740] rk-vcodec ff650000.vpu_service: reg[110] 3a122158
[92799.201249] rk-vcodec ff650000.vpu_service: reg[111] 00000000
[92799.201758] rk-vcodec ff650000.vpu_service: reg[112] 00000000
[92799.202267] rk-vcodec ff650000.vpu_service: reg[113] 00000000
[92799.202776] rk-vcodec ff650000.vpu_se
Anyone knows this issue ? Any additional firmware required for doing this ?
@rageworx I test your YUV420SP file in my RK3399 board with the command below:
mpi_enc_test -i ./testdump.yuv420sp.yuv -w 2464 -h 2064 -t 8 -o ./test.jpg
Things work fine, both 32-bit library and 64-bit library. And the output image is:
Kernel version of my board:
rk3399_mid:/ # uname -a
Linux localhost 4.4.167 #4 SMP PREEMPT Mon Mar 11 08:51:05 CST 2019 aarch64
There is a Page Fault at your kernel log, It may has something to do with the wrong with and height parameters since the yuv file you provided is 2456x2064。
Dear @qvoid , I've been test with your shell input string,
./mpi_enc_test -i ./testdump.yuv420sp.yuv -w 2464 -h 2064 -t 8 -o ./test.jpg
and prints these lines -
> ./mpi_enc_test -i ./testdump.yuv420sp.yuv -w 2464 -h 2064 -t 8 -o ./test.jpg
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name: ./testdump.yuv420sp.yuv
mpi_enc_test: output file name: ./test.jpg
mpi_enc_test: width : 2464
mpi_enc_test: height : 2064
mpi_enc_test: format : 0
mpi_enc_test: type : 8
mpi_enc_test: debug flag : 0
mpi_enc_test: mpi_enc_test start
mpi_enc_test: failed to open input file ./testdump.yuv420sp.yuv
mpi_enc_test: create default yuv image for test
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test: mpi_enc_test encoder test start w 2464 h 2064 type 8
mpi: mpp version: 66b140ee author: Johnson Ding [h264d]: Fix unused parameter warning
mpi_enc_test: mpi_enc_test bps 19071360 fps 30 gop 60
jpege_api: jpege: hardware return error status 40
mpi_enc_test: test_mpp_run encoded frame 0 size 636250
mpi_enc_test: test_mpp_run encode max 1 frames
mpi_enc_test: mpi_enc_test success total frame 1 bps 152700000
mpp_buffer: ~MppBufferService cleaning misc group
Result test.jpg size is 636250, filled with 0x00 in data area. dmesg printed as like this:
[107945.044431] rk_vcodec: vpu_service_ioctl:1875: error: unknown vpu service ioctl cmd 40086c01
[107945.315056] rk_iommu ff650800.iommu: Page fault at 0x0000000000007380 of type read
[107945.315771] rk_iommu ff650800.iommu: iova = 0x0000000000007380: dte_index: 0x0 pte_index: 0x7 page_offset: 0x380
[107945.316696] rk_iommu ff650800.iommu: mmu_dte_addr: 0x00000000ee14a000 dte@0x00000000ee14a000: 0x000000 valid: 0 pte@0x0000000000000000: 0x000000 valid: 0 page@0x0000000000000000 flags: 0x0
[107945.318179] rk-vcodec ff650000.vpu_service: vcodec, fault addr 0x00007380 status 4b
[107945.318870] rk-vcodec ff650000.vpu_service: no memory region mapped
[107945.319444] rk-vcodec ff650000.vpu_service: dumping enc register set:
[107945.320032] rk-vcodec ff650000.vpu_service: reg[00] 00000000
[107945.320550] rk-vcodec ff650000.vpu_service: reg[01] 00000000
[107945.321068] rk-vcodec ff650000.vpu_service: reg[02] 01010101
[107945.321585] rk-vcodec ff650000.vpu_service: reg[03] 01010101
[107945.322102] rk-vcodec ff650000.vpu_service: reg[04] 01010101
[107945.322620] rk-vcodec ff650000.vpu_service: reg[05] 01010101
[107945.323137] rk-vcodec ff650000.vpu_service: reg[06] 01010101
[107945.323654] rk-vcodec ff650000.vpu_service: reg[07] 01010101
[107945.324172] rk-vcodec ff650000.vpu_service: reg[08] 01010101
[107945.324689] rk-vcodec ff650000.vpu_service: reg[09] 01010101
[107945.325207] rk-vcodec ff650000.vpu_service: reg[10] 01010101
[107945.325724] rk-vcodec ff650000.vpu_service: reg[11] 01010101
[107945.326241] rk-vcodec ff650000.vpu_service: reg[12] 01010101
[107945.326759] rk-vcodec ff650000.vpu_service: reg[13] 01010101
[107945.327276] rk-vcodec ff650000.vpu_service: reg[14] 01010101
[107945.327794] rk-vcodec ff650000.vpu_service: reg[15] 01010101
[107945.328311] rk-vcodec ff650000.vpu_service: reg[16] 01010101
[107945.328828] rk-vcodec ff650000.vpu_service: reg[17] 01010101
[107945.329345] rk-vcodec ff650000.vpu_service: reg[18] 01010101
[107945.329863] rk-vcodec ff650000.vpu_service: reg[19] 01010101
[107945.330381] rk-vcodec ff650000.vpu_service: reg[20] 01010101
[107945.330898] rk-vcodec ff650000.vpu_service: reg[21] 01010101
[107945.331416] rk-vcodec ff650000.vpu_service: reg[22] 01010101
[107945.331934] rk-vcodec ff650000.vpu_service: reg[23] 01010101
[107945.332451] rk-vcodec ff650000.vpu_service: reg[24] 01010101
[107945.332969] rk-vcodec ff650000.vpu_service: reg[25] 01010101
[107945.333486] rk-vcodec ff650000.vpu_service: reg[26] 01010101
[107945.334004] rk-vcodec ff650000.vpu_service: reg[27] 01010101
[107945.334522] rk-vcodec ff650000.vpu_service: reg[28] 01010101
[107945.335040] rk-vcodec ff650000.vpu_service: reg[29] 01010101
[107945.335558] rk-vcodec ff650000.vpu_service: reg[30] 01010101
[107945.336075] rk-vcodec ff650000.vpu_service: reg[31] 01010101
[107945.336592] rk-vcodec ff650000.vpu_service: reg[32] 00000000
[107945.337110] rk-vcodec ff650000.vpu_service: reg[33] 00000000
[107945.337627] rk-vcodec ff650000.vpu_service: reg[34] 00000000
[107945.338144] rk-vcodec ff650000.vpu_service: reg[35] 00000000
[107945.338661] rk-vcodec ff650000.vpu_service: reg[36] 00000000
[107945.339179] rk-vcodec ff650000.vpu_service: reg[37] 00000000
[107945.339696] rk-vcodec ff650000.vpu_service: reg[38] 00000000
[107945.340213] rk-vcodec ff650000.vpu_service: reg[39] 00000000
[107945.340730] rk-vcodec ff650000.vpu_service: reg[40] 00000000
[107945.341248] rk-vcodec ff650000.vpu_service: reg[41] 00000000
[107945.341765] rk-vcodec ff650000.vpu_service: reg[42] 00000000
[107945.342283] rk-vcodec ff650000.vpu_service: reg[43] 00000000
[107945.342800] rk-vcodec ff650000.vpu_service: reg[44] 00000000
[107945.343318] rk-vcodec ff650000.vpu_service: reg[45] 00000000
[107945.343835] rk-vcodec ff650000.vpu_service: reg[46] 00000000
[107945.344352] rk-vcodec ff650000.vpu_service: reg[47] 00000000
[107945.344870] rk-vcodec ff650000.vpu_service: reg[48] 00000000
[107945.345387] rk-vcodec ff650000.vpu_service: reg[49] 004d9a00
[107945.345904] rk-vcodec ff650000.vpu_service: reg[50] 004d9a00
[107945.346422] rk-vcodec ff650000.vpu_service: reg[51] 02110311
[107945.346939] rk-vcodec ff650000.vpu_service: reg[52] 003f0000
[107945.347456] rk-vcodec ff650000.vpu_service: reg[53] 004d9791
[107945.347974] rk-vcodec ff650000.vpu_service: reg[54] 01011000
[107945.348491] rk-vcodec ff650000.vpu_service: reg[55] 00000000
[107945.349008] rk-vcodec ff650000.vpu_service: reg[56] 00000000
[107945.349525] rk-vcodec ff650000.vpu_service: reg[57] 00000000
[107945.350042] rk-vcodec ff650000.vpu_service: reg[58] 00000000
[107945.350559] rk-vcodec ff650000.vpu_service: reg[59] 00000000
[107945.351076] rk-vcodec ff650000.vpu_service: reg[60] 00380000
[107945.351594] rk-vcodec ff650000.vpu_service: reg[61] 000009a0
[107945.351708] dwmmc_rockchip fe310000.dwmmc: Unexpected interrupt latency
[107945.352707] rk-vcodec ff650000.vpu_service: reg[62] 00000000
[107945.353225] rk-vcodec ff650000.vpu_service: reg[63] 00000000
[107945.353742] rk-vcodec ff650000.vpu_service: reg[64] 00000000
[107945.354259] rk-vcodec ff650000.vpu_service: reg[65] 00000000
[107945.354776] rk-vcodec ff650000.vpu_service: reg[66] 00000000
[107945.355293] rk-vcodec ff650000.vpu_service: reg[67] 00000000
[107945.355811] rk-vcodec ff650000.vpu_service: reg[68] 00000000
[107945.356328] rk-vcodec ff650000.vpu_service: reg[69] 00000000
[107945.356845] rk-vcodec ff650000.vpu_service: reg[70] 00000000
[107945.357363] rk-vcodec ff650000.vpu_service: reg[71] 00000000
[107945.357880] rk-vcodec ff650000.vpu_service: reg[72] 00000000
[107945.358397] rk-vcodec ff650000.vpu_service: reg[73] 00000000
[107945.358914] rk-vcodec ff650000.vpu_service: reg[74] 00000010
[107945.359431] rk-vcodec ff650000.vpu_service: reg[75] 00000000
[107945.359948] rk-vcodec ff650000.vpu_service: reg[76] 00000000
[107945.360466] rk-vcodec ff650000.vpu_service: reg[77] 0009bc00
[107945.360983] rk-vcodec ff650000.vpu_service: reg[78] 00000000
[107945.361500] rk-vcodec ff650000.vpu_service: reg[79] 00000000
[107945.362017] rk-vcodec ff650000.vpu_service: reg[80] 00000000
[107945.362535] rk-vcodec ff650000.vpu_service: reg[81] 00000000
[107945.363052] rk-vcodec ff650000.vpu_service: reg[82] 00000000
[107945.363569] rk-vcodec ff650000.vpu_service: reg[83] 00000000
[107945.364086] rk-vcodec ff650000.vpu_service: reg[84] 00000000
[107945.364603] rk-vcodec ff650000.vpu_service: reg[85] 00000000
[107945.365120] rk-vcodec ff650000.vpu_service: reg[86] 00000000
[107945.365637] rk-vcodec ff650000.vpu_service: reg[87] 00000000
[107945.366154] rk-vcodec ff650000.vpu_service: reg[88] 00000000
[107945.366671] rk-vcodec ff650000.vpu_service: reg[89] 00000000
[107945.367189] rk-vcodec ff650000.vpu_service: reg[90] 00000000
[107945.367706] rk-vcodec ff650000.vpu_service: reg[91] 00000000
[107945.368223] rk-vcodec ff650000.vpu_service: reg[92] 00000000
[107945.368740] rk-vcodec ff650000.vpu_service: reg[93] 00000000
[107945.369257] rk-vcodec ff650000.vpu_service: reg[94] 00000000
[107945.369774] rk-vcodec ff650000.vpu_service: reg[95] 962b4c85
[107945.370292] rk-vcodec ff650000.vpu_service: reg[96] 90901d50
[107945.370809] rk-vcodec ff650000.vpu_service: reg[97] 0000b694
[107945.371326] rk-vcodec ff650000.vpu_service: reg[98] 00000000
[107945.371844] rk-vcodec ff650000.vpu_service: reg[99] 00000000
[107945.372361] rk-vcodec ff650000.vpu_service: reg[100] 00000000
[107945.372889] rk-vcodec ff650000.vpu_service: reg[101] 1f522780
[107945.373418] rk-vcodec ff650000.vpu_service: reg[102] 00000000
[107945.373947] rk-vcodec ff650000.vpu_service: reg[103] 08109a60
[107945.374475] rk-vcodec ff650000.vpu_service: reg[104] 00000000
[107945.375004] rk-vcodec ff650000.vpu_service: reg[105] fc000000
[107945.375532] rk-vcodec ff650000.vpu_service: reg[106] 00000000
[107945.376060] rk-vcodec ff650000.vpu_service: reg[107] 00000000
[107945.376589] rk-vcodec ff650000.vpu_service: reg[108] 00000000
[107945.377118] rk-vcodec ff650000.vpu_service: reg[109] 00001441
[107945.377646] rk-vcodec ff650000.vpu_service: reg[110] 3a122158
[107945.378175] rk-vcodec ff650000.vpu_service: reg[111] 00000000
[107945.378704] rk-vcodec ff650000.vpu_service: reg[112] 00000000
[107945
I am running on debian-stretch-aarch64, Rock960B 4GB/32GB revision 1.3. Kernel is
Linux linaro-alip 4.4.154 #34 SMP Mon Jun 10 18:19:17 KST 2019 aarch64 GNU/Linux
I can see "/dev/vpu_service" existed.
May I something missed ? Some kind of kernel configuration need to be changed ?
Regards, Raph.K.
I have checked kernel config for MPP, and I can see these options are enabled ( =y ).
CONFIG_HAS_IOMEM=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_RK_VCODEC=y
CONFIG_ROCKCHIP_MPP_SERVICE=y
CONFIG_ROCKCHIP_MPP_DEVICE=y
Hmm .. Am I need different kernel ?
And I have been tested on Sapphire Excavator board too. Same environment, same codes ( from your repo ). Same result. Different kernel ( Linux linaro-alip 4.4.167 #21 SMP Tue May 14 10:39:25 KST 2019 aarch64 GNU/Linux ) And here dmesg
[ 0.292089] rk-vcodec ff650000.vpu_service: Looking up vcodec-supply from device tree
[ 0.292101] rk-vcodec ff650000.vpu_service: Looking up vcodec-supply property in node /vpu_service@ff650000 failed
[ 0.292114] rk-vcodec ff650000.vpu_service: no regulator for vcodec
[ 0.292947] rk-vcodec ff650000.vpu_service: probe device
[ 0.293666] rk-vcodec ff650000.vpu_service: drm allocator with mmu enabled
[ 0.294853] rk-vcodec ff650000.vpu_service: could not find power_model node
[ 0.295523] rk-vcodec ff650000.vpu_service: init success
....
[ 340.101366] rk_vcodec: vpu_service_ioctl:1890: error: unknown vpu service ioctl cmd 40086c01
[ 340.136623] rk_iommu ff650800.iommu: Page fault at 0x0000000000006040 of type read
[ 340.136642] rk_iommu ff650800.iommu: iova = 0x0000000000006040: dte_index: 0x0 pte_index: 0x6 page_offset: 0x40
[ 340.136653] rk_iommu ff650800.iommu: mmu_dte_addr: 0x00000000f205c000 dte@0x00000000f205c000: 0x000000 valid: 0 pte@0x0000000000000000: 0x000000 valid: 0 page@0x0000000000000000 flags: 0x0
[ 340.136663] rk-vcodec ff650000.vpu_service: vcodec, fault addr 0x00006040 status 4b
[ 340.136670] rk-vcodec ff650000.vpu_service: no memory region mapped
[ 340.136676] rk-vcodec ff650000.vpu_service: dumping enc register set:
[ 340.136684] rk-vcodec ff650000.vpu_service: reg[00] 00000000
[ 340.136691] rk-vcodec ff650000.vpu_service: reg[01] 00000000
[ 340.136698] rk-vcodec ff650000.vpu_service: reg[02] 01010101
[ 340.136705] rk-vcodec ff650000.vpu_service: reg[03] 01010101
[ 340.136712] rk-vcodec ff650000.vpu_service: reg[04] 01010101
[ 340.136719] rk-vcodec ff650000.vpu_service: reg[05] 01010101
[ 340.136727] rk-vcodec ff650000.vpu_service: reg[06] 01010101
[ 340.136734] rk-vcodec ff650000.vpu_service: reg[07] 01010101
[ 340.136741] rk-vcodec ff650000.vpu_service: reg[08] 01010101
[ 340.136748] rk-vcodec ff650000.vpu_service: reg[09] 01010101
[ 340.136755] rk-vcodec ff650000.vpu_service: reg[10] 01010101
[ 340.136762] rk-vcodec ff650000.vpu_service: reg[11] 01010101
[ 340.136769] rk-vcodec ff650000.vpu_service: reg[12] 01010101
[ 340.136776] rk-vcodec ff650000.vpu_service: reg[13] 01010101
[ 340.136783] rk-vcodec ff650000.vpu_service: reg[14] 01010101
[ 340.136790] rk-vcodec ff650000.vpu_service: reg[15] 01010101
[ 340.136797] rk-vcodec ff650000.vpu_service: reg[16] 01010101
[ 340.136804] rk-vcodec ff650000.vpu_service: reg[17] 01010101
[ 340.136811] rk-vcodec ff650000.vpu_service: reg[18] 01010101
[ 340.136818] rk-vcodec ff650000.vpu_service: reg[19] 01010101
[ 340.136825] rk-vcodec ff650000.vpu_service: reg[20] 01010101
[ 340.136832] rk-vcodec ff650000.vpu_service: reg[21] 01010101
[ 340.136839] rk-vcodec ff650000.vpu_service: reg[22] 01010101
[ 340.136846] rk-vcodec ff650000.vpu_service: reg[23] 01010101
[ 340.136853] rk-vcodec ff650000.vpu_service: reg[24] 01010101
[ 340.136860] rk-vcodec ff650000.vpu_service: reg[25] 01010101
[ 340.136867] rk-vcodec ff650000.vpu_service: reg[26] 01010101
[ 340.136874] rk-vcodec ff650000.vpu_service: reg[27] 01010101
[ 340.136881] rk-vcodec ff650000.vpu_service: reg[28] 01010101
[ 340.136888] rk-vcodec ff650000.vpu_service: reg[29] 01010101
[ 340.136895] rk-vcodec ff650000.vpu_service: reg[30] 01010101
[ 340.136902] rk-vcodec ff650000.vpu_service: reg[31] 01010101
[ 340.136909] rk-vcodec ff650000.vpu_service: reg[32] 00000000
[ 340.136916] rk-vcodec ff650000.vpu_service: reg[33] 00000000
[ 340.136923] rk-vcodec ff650000.vpu_service: reg[34] 00000000
[ 340.136930] rk-vcodec ff650000.vpu_service: reg[35] 00000000
[ 340.136937] rk-vcodec ff650000.vpu_service: reg[36] 00000000
[ 340.136945] rk-vcodec ff650000.vpu_service: reg[37] 00000000
[ 340.136952] rk-vcodec ff650000.vpu_service: reg[38] 00000000
[ 340.136958] rk-vcodec ff650000.vpu_service: reg[39] 00000000
[ 340.136965] rk-vcodec ff650000.vpu_service: reg[40] 00000000
[ 340.136972] rk-vcodec ff650000.vpu_service: reg[41] 00000000
[ 340.136979] rk-vcodec ff650000.vpu_service: reg[42] 00000000
[ 340.136986] rk-vcodec ff650000.vpu_service: reg[43] 00000000
[ 340.136993] rk-vcodec ff650000.vpu_service: reg[44] 00000000
[ 340.137000] rk-vcodec ff650000.vpu_service: reg[45] 00000000
[ 340.137008] rk-vcodec ff650000.vpu_service: reg[46] 00000000
[ 340.137015] rk-vcodec ff650000.vpu_service: reg[47] 00000000
[ 340.137022] rk-vcodec ff650000.vpu_service: reg[48] 00000000
[ 340.137029] rk-vcodec ff650000.vpu_service: reg[49] 004d9a00
[ 340.137036] rk-vcodec ff650000.vpu_service: reg[50] 004d9a00
[ 340.137043] rk-vcodec ff650000.vpu_service: reg[51] 02110311
[ 340.137050] rk-vcodec ff650000.vpu_service: reg[52] 003f0000
[ 340.137057] rk-vcodec ff650000.vpu_service: reg[53] 004d9791
[ 340.137064] rk-vcodec ff650000.vpu_service: reg[54] 01011000
[ 340.137071] rk-vcodec ff650000.vpu_service: reg[55] 00000000
[ 340.137078] rk-vcodec ff650000.vpu_service: reg[56] 00000000
[ 340.137085] rk-vcodec ff650000.vpu_service: reg[57] 00000000
[ 340.137092] rk-vcodec ff650000.vpu_service: reg[58] 00000000
[ 340.137099] rk-vcodec ff650000.vpu_service: reg[59] 00000000
[ 340.137106] rk-vcodec ff650000.vpu_service: reg[60] 00380000
[ 340.137113] rk-vcodec ff650000.vpu_service: reg[61] 000009a0
[ 340.137120] rk-vcodec ff650000.vpu_service: reg[62] 00000000
[ 340.137127] rk-vcodec ff650000.vpu_service: reg[63] 00000000
[ 340.137134] rk-vcodec ff650000.vpu_service: reg[64] 00000000
[ 340.137141] rk-vcodec ff650000.vpu_service: reg[65] 00000000
[ 340.137148] rk-vcodec ff650000.vpu_service: reg[66] 00000000
[ 340.137155] rk-vcodec ff650000.vpu_service: reg[67] 00000000
[ 340.137162] rk-vcodec ff650000.vpu_service: reg[68] 00000000
[ 340.137169] rk-vcodec ff650000.vpu_service: reg[69] 00000000
[ 340.137176] rk-vcodec ff650000.vpu_service: reg[70] 00000000
[ 340.137183] rk-vcodec ff650000.vpu_service: reg[71] 00000000
[ 340.137190] rk-vcodec ff650000.vpu_service: reg[72] 00000000
[ 340.137197] rk-vcodec ff650000.vpu_service: reg[73] 00000000
[ 340.137204] rk-vcodec ff650000.vpu_service: reg[74] 00000010
[ 340.137211] rk-vcodec ff650000.vpu_service: reg[75] 00000000
[ 340.137218] rk-vcodec ff650000.vpu_service: reg[76] 00000000
[ 340.137225] rk-vcodec ff650000.vpu_service: reg[77] 0009bc00
[ 340.137232] rk-vcodec ff650000.vpu_service: reg[78] 00000000
[ 340.137239] rk-vcodec ff650000.vpu_service: reg[79] 00000000
[ 340.137246] rk-vcodec ff650000.vpu_service: reg[80] 00000000
[ 340.137253] rk-vcodec ff650000.vpu_service: reg[81] 00000000
[ 340.137260] rk-vcodec ff650000.vpu_service: reg[82] 00000000
[ 340.137267] rk-vcodec ff650000.vpu_service: reg[83] 00000000
[ 340.137274] rk-vcodec ff650000.vpu_service: reg[84] 00000000
[ 340.137281] rk-vcodec ff650000.vpu_service: reg[85] 00000000
[ 340.137288] rk-vcodec ff650000.vpu_service: reg[86] 00000000
[ 340.137295] rk-vcodec ff650000.vpu_service: reg[87] 00000000
[ 340.137302] rk-vcodec ff650000.vpu_service: reg[88] 00000000
[ 340.137309] rk-vcodec ff650000.vpu_service: reg[89] 00000000
[ 340.137316] rk-vcodec ff650000.vpu_service: reg[90] 00000000
[ 340.137323] rk-vcodec ff650000.vpu_service: reg[91] 00000000
[ 340.137330] rk-vcodec ff650000.vpu_service: reg[92] 00000000
[ 340.137337] rk-vcodec ff650000.vpu_service: reg[93] 00000000
[ 340.137344] rk-vcodec ff650000.vpu_service: reg[94] 00000000
[ 340.137351] rk-vcodec ff650000.vpu_service: reg[95] 962b4c85
[ 340.137358] rk-vcodec ff650000.vpu_service: reg[96] 90901d50
[ 340.137365] rk-vcodec ff650000.vpu_service: reg[97] 0000b694
[ 340.137372] rk-vcodec ff650000.vpu_service: reg[98] 00000000
[ 340.137380] rk-vcodec ff650000.vpu_service: reg[99] 00000000
[ 340.137387] rk-vcodec ff650000.vpu_service: reg[100] 00000000
[ 340.137394] rk-vcodec ff650000.vpu_service: reg[101] 1f522780
[ 340.137401] rk-vcodec ff650000.vpu_service: reg[102] 00000000
[ 340.137408] rk-vcodec ff650000.vpu_service: reg[103] 08109a61
[ 340.137415] rk-vcodec ff650000.vpu_service: reg[104] 00000000
[ 340.137422] rk-vcodec ff650000.vpu_service: reg[105] fc000000
[ 340.137429] rk-vcodec ff650000.vpu_service: reg[106] 00000000
[ 340.137436] rk-vcodec ff650000.vpu_service: reg[107] 00000000
[ 340.137443] rk-vcodec ff650000.vpu_service: reg[108] 00000000
[ 340.137450] rk-vcodec ff650000.vpu_service: reg[109] 00001441
[ 340.137458] rk-vcodec ff650000.vpu_service: reg[110] 3a122158
[ 340.137464] rk-vcodec ff650000.vpu_service: reg[111] 00000000
[ 340.137472] rk-vcodec ff650000.vpu_service: reg[112] 00000000
[ 340.137479] rk-vcodec ff650000.vpu_service: reg[113] 00000000
[ 340.137486] rk-vcodec ff650000.vpu_service: reg[114] 00000000
[ 340.137493] rk-vcodec ff650000.vpu_service: reg[115] 00000000
[ 340.137500] rk-vcodec ff650000.vpu_service: reg[116] 00000000
[ 340.137507] rk-vcodec ff650000.vpu_service: reg[117] 00000000
[ 340.137514] rk-vcodec ff650000.vpu_service: reg[118] 00000000
[ 340.137521] rk-vcodec ff650000.vpu_service: reg[119] 00000000
[ 340.137528] rk-vcodec ff650000.vpu_service: reg[120] 00000000
[ 340.137535] rk-vcodec ff650000.vpu_service: reg[121] 00000000
[ 340.137542] rk-vcodec ff650000.vpu_service: reg[122] 00000000
[ 340.137549] rk-vcodec ff650000.vpu_service: reg[123] 00000000
[ 340.137556] rk-vcodec ff650000.vpu_service: reg[124] 00000000
[ 340.137563] rk-vcodec ff650000.vpu_service: reg[125] 00000000
[ 340.137570] rk-vcodec ff650000.vpu_service: reg[126] 00000000
[ 340.137577] rk-vcodec ff650000.vpu_service: reg[127] 00000000
[ 340.137584] rk-vcodec ff650000.vpu_service: reg[128] 00000000
[ 340.137591] rk-vcodec ff650000.vpu_service: reg[129] 00000000
[ 340.137598] rk-vcodec ff650000.vpu_service: reg[130] 00000000
[ 340.137605] rk-vcodec ff650000.vpu_service: reg[131] 00000000
[ 340.137612] rk-vcodec ff650000.vpu_service: reg[132] 00000000
[ 340.137619] rk-vcodec ff650000.vpu_service: reg[133] 00000000
[ 340.137627] rk-vcodec ff650000.vpu_service: reg[134] 00000000
[ 340.137634] rk-vcodec ff650000.vpu_service: reg[135] 00000000
[ 340.137641] rk-vcodec ff650000.vpu_service: reg[136] 00000000
[ 340.137648] rk-vcodec ff650000.vpu_service: reg[137] 00000000
[ 340.137655] rk-vcodec ff650000.vpu_service: reg[138] 00000000
[ 340.137662] rk-vcodec ff650000.vpu_service: reg[139] 00000000
[ 340.137669] rk-vcodec ff650000.vpu_service: reg[140] 00000000
[ 340.137676] rk-vcodec ff650000.vpu_service: reg[141] 00000000
[ 340.137683] rk-vcodec ff650000.vpu_service: reg[142] 00000000
[ 340.137690] rk-vcodec ff650000.vpu_service: reg[143] 00000000
[ 340.137697] rk-vcodec ff650000.vpu_service: reg[144] 00000000
[ 340.137704] rk-vcodec ff650000.vpu_service: reg[145] 00000000
[ 340.137711] rk-vcodec ff650000.vpu_service: reg[146] 00000000
[ 340.137718] rk-vcodec ff650000.vpu_service: reg[147] 00000000
[ 340.137725] rk-vcodec ff650000.vpu_service: reg[148] 00000000
[ 340.137732] rk-vcodec ff650000.vpu_service: reg[149] 00000000
[ 340.137740] rk-vcodec ff650000.vpu_service: reg[150] 00000000
[ 340.137747] rk-vcodec ff650000.vpu_service: reg[151] 00000000
[ 340.137754] rk-vcodec ff650000.vpu_service: reg[152] 00000000
[ 340.137761] rk-vcodec ff650000.vpu_service: reg[153] 00000000
[ 340.137768] rk-vcodec ff650000.vpu_service: reg[154] 00000000
[ 340.137775] rk-vcodec ff650000.vpu_service: reg[155] 00000000
[ 340.137782] rk-vcodec ff650000.vpu_service: reg[156] 00000000
[ 340.137789] rk-vcodec ff650000.vpu_service: reg[157] 00000000
[ 340.137796] rk-vcodec ff650000.vpu_service: reg[158] 00000000
[ 340.137803] rk-vcodec ff650000.vpu_service: reg[159] 00000000
[ 340.137810] rk-vcodec ff650000.vpu_service: reg[160] 00000000
[ 340.137817] rk-vcodec ff650000.vpu_service: reg[161] 00000000
[ 340.137824] rk-vcodec ff650000.vpu_service: reg[162] 00000000
[ 340.137831] rk-vcodec ff650000.vpu_service: reg[163] 00000000
[ 340.137838] rk-vcodec ff650000.vpu_service: reg[164] 00000000
[ 340.137845] rk-vcodec ff650000.vpu_service: reg[165] 00000000
[ 340.137852] rk-vcodec ff650000.vpu_service: reg[166] 00000000
[ 340.137859] rk-vcodec ff650000.vpu_service: reg[167] 00000000
[ 340.137866] rk-vcodec ff650000.vpu_service: reg[168] 00000000
[ 340.137873] rk-vcodec ff650000.vpu_service: reg[169] 00000000
[ 340.137880] rk-vcodec ff650000.vpu_service: reg[170] 00000000
[ 340.137887] rk-vcodec ff650000.vpu_service: reg[171] 00000000
[ 340.137894] rk-vcodec ff650000.vpu_service: reg[172] 00000000
[ 340.137901] rk-vcodec ff650000.vpu_service: reg[173] 00000000
[ 340.137908] rk-vcodec ff650000.vpu_service: reg[174] 00000000
[ 340.137915] rk-vcodec ff650000.vpu_service: reg[175] 00000000
[ 340.137922] rk-vcodec ff650000.vpu_service: reg[176] 00000000
[ 340.137929] rk-vcodec ff650000.vpu_service: reg[177] 00000000
[ 340.137936] rk-vcodec ff650000.vpu_service: reg[178] 00000000
[ 340.137943] rk-vcodec ff650000.vpu_service: reg[179] 00000000
[ 340.137950] rk-vcodec ff650000.vpu_service: reg[180] 00000000
[ 340.137957] rk-vcodec ff650000.vpu_service: reg[181] 00000000
[ 340.137964] rk-vcodec ff650000.vpu_service: reg[182] 00000000
[ 340.137971] rk-vcodec ff650000.vpu_service: reg[183] 00000000
[ 340.138170] rk-vcodec ff650000.vpu_service: resetting...
[ 340.138224] rk-vcodec ff650000.vpu_service: reset done
[ 340.138291] rk-vcodec ff650000.vpu_service: reset done
Result is same file size as 636250, filled with 0x00 (NULL).
qvoid, can be problem in the board, not only kernel? I have ROCK PI 4A v1.4, and the same error even on dummy image.
@rageworx More log info is need to analyze this problem. set the env mpp_buffer_debug and echo 0xffff to /sys/module/rk_vcodec/parameters/debug. And then re-run the test and save the complete console log and kernel log. Upload them here, Thx.
@qvoid /sys/module/rk_vcodec/paramters/debug should not be able to written with even sudo, or root account. So I can give you result with -d 1 as below:
▶ ./mpi_enc_test -i ./testdump.yuv420sp.yuv -w 2464 -h 2064 -t 8 -o ./test.jpg -d 1
mpi_enc_test: cmd parse result:
mpi_enc_test: input file name: ./testdump.yuv420sp.yuv
mpi_enc_test: output file name: ./test.jpg
mpi_enc_test: width : 2464
mpi_enc_test: height : 2064
mpi_enc_test: format : 0
mpi_enc_test: type : 8
mpi_enc_test: debug flag : 1
mpi_enc_test: mpi_enc_test start
mpi_enc_test: failed to open input file ./testdump.yuv420sp.yuv
mpi_enc_test: create default yuv image for test
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpi_enc_test: mpi_enc_test encoder test start w 2464 h 2064 type 8
mpi: mpp_create enter ctx 0x5576241188 mpi 0x5576241190
mpi: mpp version: Without VCS info
mpi: mpp_create leave ret 0 ctx 0x5576242300 mpi 0x7fb4b01718
mpi: mpp_init enter ctx 0x5576242300 type 1 coding 8
mpi: mpp_init leave ret 0
mpi: mpi_control enter ctx 0x5576242300 cmd 320003 parm 0x5576241198
mpi: mpi_control leave ret 0
mpi_enc_test: mpi_enc_test bps 19071360 fps 30 gop 60
mpi: mpi_control enter ctx 0x5576242300 cmd 320005 parm 0x55762411e4
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x5576242300 cmd 320007 parm 0x557624121c
mpi: mpi_control leave ret 0
mpi: mpi_control enter ctx 0x5576242300 cmd 32000f parm 0x5576241cb0
mpi: mpi_control leave ret 0
mpi: mpi_encode_put_frame enter ctx 0x5576242300 frame 0x5576246200
jpege_api: jpege: hardware return error status 40
mpi: mpi_encode_put_frame leave ret 0
mpi: mpi_encode_get_packet enter ctx 0x5576242300 packet 0x7fe9230e88
mpi: mpi_encode_get_packet leave ret 0
mpi_enc_test: test_mpp_run encoded frame 0 size 636250
mpi_enc_test: test_mpp_run encode max 1 frames
mpi: mpi_reset enter ctx 0x5576242300
mpi: mpi_reset leave ret 0
mpi: mpp_destroy enter ctx 0x5576242300
mpi: mpp_destroy leave ret 0
mpi_enc_test: mpi_enc_test success total frame 1 bps 152700000
mpp_buffer: ~MppBufferService cleaning misc group
And kernel log here, ( removed some our MIPI CSI2 device kernel driver log )
@rageworx Sorry, I forgot to tell you the value of mpp_buffer_debug. Set mpp_buffer_debug to 0x137. In Linux you need to use export command, or use setprop in Androd. And dump log again, Thanks.
@qvoid Still occured "permission denied" with root accout, so I had changed permissions with root accout for 666, then put 0xffff (65535) for debug parameter. And ran test again. Just refer to following zip file: rkmpp.zip Regards, Raph.
ps I am not using Android. I don't need to use that.
look like there is some thing wrong with buffer fd. It is abnormal that fd equals 0.
mpp_buffer: group 0 buffer 0 fd 0 ops buf create ref_count 0 caller mpi_enc_test
mpp_buffer: group 0 buffer 0 fd 0 ops buf ref inc ref_count 0 caller mpi_enc_test
look like there is some thing wrong with buffer fd. It is abnormal that fd equals 0.
mpp_buffer: group 0 buffer 0 fd 0 ops buf create ref_count 0 caller mpi_enc_test mpp_buffer: group 0 buffer 0 fd 0 ops buf ref inc ref_count 0 caller mpi_enc_test
Dear @qvoid , so who process mpp_buffer fd ? mpi_enc_test and mpp those are belong to here. Any idea to solve this ?
@rageworx I think there is something wrong with memory mapping. But I don't know what cause that. See this log from your testing:
[ 340.136623] rk_iommu ff650800.iommu: Page fault at 0x0000000000006040 of type read
[ 340.136642] rk_iommu ff650800.iommu: iova = 0x0000000000006040: dte_index: 0x0 pte_index: 0x6 page_offset: 0x40
[ 340.136653] rk_iommu ff650800.iommu: mmu_dte_addr: 0x00000000f205c000 dte@0x00000000f205c000: 0x000000 valid: 0 pte@0x0000000000000000: 0x000000 valid: 0 page@0x0000000000000000 flags: 0x0
[ 340.136663] rk-vcodec ff650000.vpu_service: vcodec, fault addr 0x00006040 status 4b
[ 340.136670] rk-vcodec ff650000.vpu_service: no memory region mapped
There is a page fault when accessing 0x00006040. And the vpu_service show an "no memory region mapped" error.
look like there is some thing wrong with buffer fd. It is abnormal that fd equals 0.
mpp_buffer: group 0 buffer 0 fd 0 ops buf create ref_count 0 caller mpi_enc_test mpp_buffer: group 0 buffer 0 fd 0 ops buf ref inc ref_count 0 caller mpi_enc_test
Dear @qvoid , so who process mpp_buffer fd ? mpi_enc_test and mpp those are belong to here. Any idea to solve this ?
mpp_buffer is accessed both by MPP (call by user space application, in this case, it is the mpi_enc_test) and kernel.
look like there is some thing wrong with buffer fd. It is abnormal that fd equals 0.
mpp_buffer: group 0 buffer 0 fd 0 ops buf create ref_count 0 caller mpi_enc_test mpp_buffer: group 0 buffer 0 fd 0 ops buf ref inc ref_count 0 caller mpi_enc_test
Dear @qvoid , so who process mpp_buffer fd ? mpi_enc_test and mpp those are belong to here. Any idea to solve this ?
So, what's next ? need to change something from rockchip mpp sources ? Let me know,
@qvoid , Or do you have any contact point to solve this issue in platform level in Rockchip? - as like something configuration or kernel level. I believe we can solve this ! My boards - Rock960B,C, All Excavators not works at all.
@rageworx you can try to post this issue in RockChip Linux Kernel or in Rockchip redmine
Now I am trying to make fastest JPEG image encoder base on your enc_test. But it fails with these error from YUV image.
It generates a part of JPEG data strats with JPIF header, but cannot read all image because all right encodded datas not contained to output file by error of status 40. Any instructions? or right way? Regards, Raph.