JeffyCN / meta-rockchip

Yocto BSP layer for the Rockchip SOC boards
Other
129 stars 96 forks source link

rk3588, chromium 122 video HW acceleration with Scarthgap and Kernel 6.1 #115

Closed chrisiberg closed 5 months ago

chrisiberg commented 5 months ago

Should this work since [v4l-rkmpp: Bump to 1.7.1] did someone try it?

chrisiberg commented 5 months ago

Scarthgap needs at least kernel 5.15 for glibc_2.39, so I can't try it with the 5.10 and with 6.1 Kernel Video HW-acceleration does not work. @JeffyCN Do you see any reason why this would not work with Scarthgap and Kernel 6.1?

JeffyCN commented 5 months ago

it doesn't require 5.15, it's configuable.

it works well on my board with my buildroot sdk + yocto chromium.

but i am not allowed go provide newer kernel code and some other codes, so i'm not sure would other parts affect it.

JeffyCN commented 5 months ago

maybe you can provide your rootfs image, i might try to test it with my internal 6.1 kernel to figure out which part went wrong. and maybe you can try to find other newer bsp kernel 6.1 code on other repo(for example radxa)

chrisiberg commented 5 months ago

That would be great! To be clear, in chrome://gpu everything looks right, but if I inspect the video with STRG+SHIFT+I > More Tools > Media Decoder name: VpxVideoDecoder or sometimes FFmpeg Hardware decoder: flase and CPU usage of chrome is much higher than with kirkstone and kernel 5.10

This is the Kernel source I used, because my hardware is a NanoPC-T6 https://github.com/friendlyarm/kernel-rockchip/tree/nanopi6-v6.1.y

rootfs: https://drive.google.com/file/d/1GAkEaT1iipIAznlKrKkOhiAxJMOyk3H6/view?usp=sharing

JeffyCN commented 5 months ago

i cannot access that rootfs.img, no permission

chrisiberg commented 5 months ago

sorry, should work now.

JeffyCN commented 5 months ago

please try to upgrade the mpp :)

chrisiberg commented 5 months ago

Thnx a lot, I will try!

the changes from WORKDIR > UNPACKDIR does not work in all cases I had to change it in xserver-xorg for modesetting.conf and in udev-conf-rocchip for 99-rockchip-permissions.rules

maybe you have a look at it.

chrisiberg commented 5 months ago

mpp upgrade does not make a difference image

# cat /dev/video-dec0
dec

shouldn't cat list the supported codecs here?

# dmesg | grep mpp
[    3.665362] mpp_service mpp-srv: unknown mpp version for missing VCS info
[    3.665367] mpp_service mpp-srv: probe start
[    3.666732] mpp_vepu2 jpege-ccu: probing start
[    3.666738] mpp_vepu2 jpege-ccu: probing finish
[    3.667354] mpp_rkvdec2 fdc30000.rkvdec-ccu: rkvdec-ccu, probing start
[    3.667402] mpp_rkvdec2 fdc30000.rkvdec-ccu: ccu-mode: 1
[    3.667406] mpp_rkvdec2 fdc30000.rkvdec-ccu: probing finish
[    3.667633] mpp_rkvenc2 rkvenc-ccu: probing start
[    3.667638] mpp_rkvenc2 rkvenc-ccu: probing finish
[    3.667949] mpp_service mpp-srv: probe success
[    3.842663] mpp_vdpu1 fdb51000.avsd-plus: Adding to iommu group 1
[    3.843019] mpp_vdpu1 fdb51000.avsd-plus: probe device
[    3.843243] mpp_vdpu1 fdb51000.avsd-plus: reset_group->rw_sem_on=0
[    3.843263] mpp_vdpu1 fdb51000.avsd-plus: reset_group->rw_sem_on=0
[    3.843405] mpp_vdpu1 fdb51000.avsd-plus: probing finish
[    3.843639] mpp_vdpu2 fdb50400.vdpu: Adding to iommu group 1
[    3.843713] mpp_vdpu2 fdb50400.vdpu: probe device
[    3.843879] mpp_vdpu2 fdb50400.vdpu: reset_group->rw_sem_on=0
[    3.843893] mpp_vdpu2 fdb50400.vdpu: reset_group->rw_sem_on=0
[    3.844002] mpp_vdpu2 fdb50400.vdpu: probing finish
[    3.844236] mpp_vepu2 fdba0000.jpege-core: Adding to iommu group 5
[    3.844355] mpp_vepu2 fdba0000.jpege-core: probing start
[    3.844602] mpp_vepu2 fdba0000.jpege-core: attach ccu success
[    3.844899] mpp_vepu2 fdba0000.jpege-core: probing finish
[    3.845147] mpp_vepu2 fdba4000.jpege-core: Adding to iommu group 6
[    3.845272] mpp_vepu2 fdba4000.jpege-core: probing start
[    3.845496] mpp_vepu2 fdba4000.jpege-core: attach ccu success
[    3.845781] mpp_vepu2 fdba4000.jpege-core: probing finish
[    3.846019] mpp_vepu2 fdba8000.jpege-core: Adding to iommu group 7
[    3.846139] mpp_vepu2 fdba8000.jpege-core: probing start
[    3.846365] mpp_vepu2 fdba8000.jpege-core: attach ccu success
[    3.846665] mpp_vepu2 fdba8000.jpege-core: probing finish
[    3.846907] mpp_vepu2 fdbac000.jpege-core: Adding to iommu group 8
[    3.847027] mpp_vepu2 fdbac000.jpege-core: probing start
[    3.847251] mpp_vepu2 fdbac000.jpege-core: attach ccu success
[    3.847474] mpp_vepu2 fdbac000.jpege-core: probing finish
[    3.847708] mpp-iep2 fdbb0000.iep: Adding to iommu group 9
[    3.847846] mpp-iep2 fdbb0000.iep: probe device
[    3.848062] mpp-iep2 fdbb0000.iep: allocate roi buffer failed
[    3.848333] mpp-iep2 fdbb0000.iep: probing finish
[    3.848578] mpp_jpgdec fdb90000.jpegd: Adding to iommu group 4
[    3.848863] mpp_jpgdec fdb90000.jpegd: probe device
[    3.849370] mpp_jpgdec fdb90000.jpegd: probing finish
[    3.849621] mpp_rkvdec2 fdc38100.rkvdec-core: Adding to iommu group 12
[    3.850094] mpp_rkvdec2 fdc38100.rkvdec-core: rkvdec-core, probing start
[    3.850345] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_a is not found!
[    3.850370] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_h is not found!
[    3.850409] mpp_rkvdec2 fdc38100.rkvdec-core: Looking up vdec-supply from device tree
[    3.850417] mpp_rkvdec2 fdc38100.rkvdec-core: Looking up vdec-supply property in node /rkvdec-core@fdc38000 failed
[    3.850442] mpp_rkvdec2 fdc38100.rkvdec-core: no regulator, devfreq is disabled
[    3.850538] mpp_rkvdec2 fdc38100.rkvdec-core: core_mask=00010001
[    3.850551] mpp_rkvdec2 fdc38100.rkvdec-core: attach ccu as core 0
[    3.850786] mpp_rkvdec2 fdc38100.rkvdec-core: sram_start 0x00000000ff001000
[    3.850799] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_iova 0x00000000fff00000
[    3.850810] mpp_rkvdec2 fdc38100.rkvdec-core: sram_size 491520
[    3.850819] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_size 1048576
[    3.850830] mpp_rkvdec2 fdc38100.rkvdec-core: min_width 512
[    3.850842] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_info_count 20
[    3.850851] mpp_rkvdec2 fdc38100.rkvdec-core: [136, 24576]
[    3.850861] mpp_rkvdec2 fdc38100.rkvdec-core: [137, 49152]
[    3.850871] mpp_rkvdec2 fdc38100.rkvdec-core: [141, 90112]
[    3.850880] mpp_rkvdec2 fdc38100.rkvdec-core: [140, 49152]
[    3.850890] mpp_rkvdec2 fdc38100.rkvdec-core: [139, 180224]
[    3.850899] mpp_rkvdec2 fdc38100.rkvdec-core: [133, 49152]
[    3.850909] mpp_rkvdec2 fdc38100.rkvdec-core: [134, 8192]
[    3.850918] mpp_rkvdec2 fdc38100.rkvdec-core: [135, 4352]
[    3.850928] mpp_rkvdec2 fdc38100.rkvdec-core: [138, 13056]
[    3.850937] mpp_rkvdec2 fdc38100.rkvdec-core: [142, 291584]
[    3.850989] mpp_rkvdec2 fdc38100.rkvdec-core: probing finish
[    3.851229] mpp_rkvdec2 fdc48100.rkvdec-core: Adding to iommu group 13
[    3.851882] mpp_rkvdec2 fdc48100.rkvdec-core: rkvdec-core, probing start
[    3.852375] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_a is not found!
[    3.852424] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_h is not found!
[    3.852500] mpp_rkvdec2 fdc48100.rkvdec-core: Looking up vdec-supply from device tree
[    3.852517] mpp_rkvdec2 fdc48100.rkvdec-core: Looking up vdec-supply property in node /rkvdec-core@fdc48000 failed
[    3.852563] mpp_rkvdec2 fdc48100.rkvdec-core: no regulator, devfreq is disabled
[    3.852711] mpp_rkvdec2 fdc48100.rkvdec-core: core_mask=00020002
[    3.852757] mpp_rkvdec2 fdc48100.rkvdec-core: attach ccu as core 1
[    3.853274] mpp_rkvdec2 fdc48100.rkvdec-core: sram_start 0x00000000ff079000
[    3.853300] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_iova 0x00000000ffe00000
[    3.853320] mpp_rkvdec2 fdc48100.rkvdec-core: sram_size 487424
[    3.853339] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_size 1048576
[    3.853360] mpp_rkvdec2 fdc48100.rkvdec-core: min_width 512
[    3.853384] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_info_count 20
[    3.853402] mpp_rkvdec2 fdc48100.rkvdec-core: [136, 24576]
[    3.853421] mpp_rkvdec2 fdc48100.rkvdec-core: [137, 49152]
[    3.853441] mpp_rkvdec2 fdc48100.rkvdec-core: [141, 90112]
[    3.853460] mpp_rkvdec2 fdc48100.rkvdec-core: [140, 49152]
[    3.853479] mpp_rkvdec2 fdc48100.rkvdec-core: [139, 180224]
[    3.853498] mpp_rkvdec2 fdc48100.rkvdec-core: [133, 49152]
[    3.853516] mpp_rkvdec2 fdc48100.rkvdec-core: [134, 8192]
[    3.853535] mpp_rkvdec2 fdc48100.rkvdec-core: [135, 4352]
[    3.853553] mpp_rkvdec2 fdc48100.rkvdec-core: [138, 13056]
[    3.853572] mpp_rkvdec2 fdc48100.rkvdec-core: [142, 291584]
[    3.853680] mpp_rkvdec2 fdc48100.rkvdec-core: probing finish
[    3.854154] mpp_rkvenc2 fdbd0000.rkvenc-core: Adding to iommu group 10
[    3.854672] mpp_rkvenc2 fdbd0000.rkvenc-core: probing start
[    3.855210] mpp_rkvenc2 fdbd0000.rkvenc-core: Looking up venc-supply from device tree
[    3.856064] mpp_rkvenc2 fdbd0000.rkvenc-core: bin=0
[    3.856411] mpp_rkvenc2 fdbd0000.rkvenc-core: leakage=17
[    3.856444] mpp_rkvenc2 fdbd0000.rkvenc-core: leakage-volt-sel=1
[    3.856543] mpp_rkvenc2 fdbd0000.rkvenc-core: Looking up venc-supply from device tree
[    3.857010] mpp_rkvenc2 fdbd0000.rkvenc-core: Looking up mem-supply from device tree
[    3.858145] mpp_rkvenc2 fdbd0000.rkvenc-core: avs=0
[    3.858202] mpp_rkvenc2 fdbd0000.rkvenc-core: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[    3.858836] mpp_rkvenc2 fdbd0000.rkvenc-core: attach ccu as core 0
[    3.859262] mpp_rkvenc2 fdbd0000.rkvenc-core: probing finish
[    3.859777] mpp_rkvenc2 fdbe0000.rkvenc-core: Adding to iommu group 11
[    3.860306] mpp_rkvenc2 fdbe0000.rkvenc-core: probing start
[    3.860799] mpp_rkvenc2 fdbe0000.rkvenc-core: Looking up venc-supply from device tree
[    3.861415] mpp_rkvenc2 fdbe0000.rkvenc-core: bin=0
[    3.861699] mpp_rkvenc2 fdbe0000.rkvenc-core: leakage=17
[    3.861802] mpp_rkvenc2 fdbe0000.rkvenc-core: leakage-volt-sel=1
[    3.861910] mpp_rkvenc2 fdbe0000.rkvenc-core: Looking up venc-supply from device tree
[    3.862208] mpp_rkvenc2 fdbe0000.rkvenc-core: Looking up mem-supply from device tree
[    3.863225] mpp_rkvenc2 fdbe0000.rkvenc-core: avs=0
[    3.863279] mpp_rkvenc2 fdbe0000.rkvenc-core: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[    3.863705] mpp_rkvenc2 fdbe0000.rkvenc-core: attach ccu as core 1
[    3.864016] mpp_rkvenc2 fdbe0000.rkvenc-core: probing finish
[    3.864530] mpp_av1dec fdc70000.av1d: Adding to iommu group 14
[    3.865220] mpp_av1dec fdc70000.av1d: probing start
[    3.866302] mpp_av1dec fdc70000.av1d: probing finish
JeffyCN commented 5 months ago

1/ Not sure about UNPACKDIR error, it's required by the newest poky, and it works well on my side. Please check your poky version

2/ It works with your image on my board after upgraded mpp and libmali. That is because the meta-rockchip's kernel is old(and i'm not allowed to upgrade it), which needs libmali valhall-g610-g6p0. If your are using a new kernel, you can need to choose a matched mpp and libmali(valhall-g610-g13p0 for newest kernel)

chrisiberg commented 5 months ago

Thnx a lot Jeffy! I got it, this is working!