Closed amazingfate closed 1 year ago
copy buffer should return 0 directly for mmaped memory, since the userspace is using the same buffer(mmaped from exported dmabuf), no need to copy it.
rga is kind of broken in 3588, but i don't think it would related to this issue.
maybe try to: 1/ make sure mpp is returning valid frames 2/ make sure mpp frame's format is nv12 3/ maybe try to dump the input packages and check it with gstreamer+mpp 4/ maybe try to dump the output frames
After adding some logs I can see the mpp's frame is NV12,same as other normal videos. Any way to dump the mpp packages or the output frames?
I think there are something to do with video resolution. I found some other green videos: | video url | video resolution | video codec |
---|---|---|---|
https://www.bilibili.com/video/BV1wE411M7nK/ | 1376x776 | h264 | |
https://www.bilibili.com/video/BV1MR4y1T7YN | 2160x1080 | h264 | |
https://www.bilibili.com/video/BV1t34y1U7CN | 1440x1080 | h264 | |
https://www.bilibili.com/video/BV15z4y1Z734 | 2160x1080 | h264 |
While other 1920x1080 h264 videos can play well.
maybe try local videos, you can use ffmpeg to change resolution, to make sure it's a resolution related issue
After updating to chromium 105.0.5195.125, there is only one video(https://www.bilibili.com/video/BV1wE411M7nK) playing green among the above 4 videos. After turing to 720p in the bilibili web player it can also play well. I downloaded the video from bilibili, converted it to mp4 and played by chromium, also green. But I can play it well using mpv with rkmpp acceleration.
it looks like the size is not aligned, so mpp will give aligned frame, maybe chromium doesn't handle that will
tested on 3588 evb with buildroot + prebuilt chromium-wayland 101.0.4951.54, it works well with a local converted 1376x776 h.264 video.
that bilibili link only has 1080p / 720p / 360p here
tested on 3588 evb with buildroot + prebuilt chromium-wayland 101.0.4951.54, it works well with a local converted 1376x776 h.264 video.
that bilibili link only has 1080p / 720p / 360p here
Here is the video I downloaded from bilibili: https://cowtransfer.com/s/925bcee23c384c. Open it with chromium and from chrome://media-internals I can see that chromium is using VDAVideoDecoder, but the video is green.
that works well too. [867.245] [RKMPP] [5458] rkmpp_apply_info_change(225): frame info changed: 1376x776) [867.248] [RKMPP] [5455] plugin_mmap(945): mmap buffer(2): 0x7fa2180000, fd: 136 [867.249] [RKMPP] [5455] plugin_mmap(945): mmap buffer(3): 0x7fa1d80000, fd: 137 [867.249] [RKMPP] [5455] rkmpp_dec_g_selection(624): visible rect: 1376x776 [867.249] [RKMPP] [5455] rkmpp_dec_dqevent(420): dequeue resolution change event [867.250] [RKMPP] [5455] rkmpp_dec_g_selection(624): visible rect: 1376x776
That's weird. I'm basicly using the build config and patch from https://github.com/saiarcot895/chromium-ubuntu-build. I will try to build without the original patches to see if things will change.
BTW, I'm using panfork mesa gpu driver instead of mali driver. I don't know if this is related.
maybe you can try to dump this plugin's outbuf(or memset it to non-green data), if we're returning correct frames, this issue is likely related to chromium itself...
I find that if the video size is not divisible by 36 then it will get played green by rkmpp. Since I'm using panfrost mesa gpu driver and you can play well using mali gpu driver in buildroot, I will dive into the source code of chromium to see what really happends when I have time. This two videos, video_54.mp4 is played green while video_72 is played well.
https://user-images.githubusercontent.com/5022901/207275896-246490ad-2bbd-4860-86c8-9305eeeec47d.mp4
https://user-images.githubusercontent.com/5022901/207275940-a677b643-7098-4164-a185-047f30e59978.mp4
ok, that seems like a chromium+mesa issue.
could be alignment requirement for texture in mesa
Confirmed, when using the close source mali driver, video_54.mp4 is playing well. I will report this issue to the developer of mesa.
I've packaged the latest code in a ppa: https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/. And I can play some video with hardware accelerated decode in a patched chromium 101.0.4951.15 on radxa rock5b ,a rk3588 board. But there are some videos in bilibili.com that are displayed all green, for example: https://www.bilibili.com/video/BV1wE411M7nK. This seems to be a rga related issue. I Added this patch to show more log:
And I got this debug log: https://paste.ubuntu.com/p/3VVPVcwt7W/
rkmpp_copy_buffer
always return -1 because ofbuffer->memory == V4L2_MEMORY_MMAP
. And the output ofcat /proc/interrupts |grep rga
shows that the rga is not used. It this the root cause? Or any other things that I've ignored.