-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RK3588S Mali-G610 GPU (Orange Pi 5) video playback segfault #356
Comments
You need to set the right permission. Here is the udev rules I use: |
My previous udev rules:
After changing my existing udev rule to https://github.com/amazingfate/rockchip-multimedia-config/blob/main/99-rk-device-permissions.rules
The segfault goes away BUT the playback is horribly choppy and barely plays. Before it was perfect playback(same video file). During playback dmesg shows:
The board has 16Gb of memory. (only 2-3Gb is in use) mpv log during the slow playback:
And when I remove the commit 1cc1af1 from latest build then playback is normal. |
Change-Id: Ifd2286ecf97fb4477693c24cdaec10c1df15eacf Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
I just did some research on it. The mpp code update makes the kernel check for rga MMU changes: https://github.com/radxa/kernel/blob/linux-5.10-gen-rkr3.4/drivers/video/rockchip/rga3/rga_mm.c#L409. |
Is it possible to make mpp detect that this will not work on boards with more than 4Gb of memory and not use the feature the 1cc1af1 commit adds? Perhaps until this is fixed in the Kernel? The playback is perfect on 16Gb or memory without this commit. A user defined setting would also solve the issue IMHO or perhaps do a permission check - in case it has no access to "system-uncached" then don't use it? (Seems to be the case I had before changin udev rules - only ending in segfault...). I need more than 4Gb of memory - it is not an option to limit to 4Gb. I am sure there is others who want to use the hardware to the fullest. |
A quick fix (just revert a part of the commit):
I think this issue is hard to solve because ffmpeg need to convert YUV420SP to YUV420P, and only rga2 kernel driver can do this. And rga2 is hardware limited to memory less than 4G. |
also can calling rga api |
Ffmpeg want to convert |
I know the limitations in RGA3... So when 420P is needed, I suggest using GPU instead of RGA2 in RK3588S, rga2 has low performance and other limitations.. |
I can confirm with this change to latest "develop" branch the problem is not present.
How could this be solved permanently? Where does the change have to take place? |
If you are using latest mpp library, there is a better solution to fix RGA2 4GB issue jjm2473/ffmpeg-rk@7e350f9 diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index ca7a824ac1bd..e2078c089936 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -249,7 +249,7 @@ static int rkmpp_init_decoder(AVCodecContext *avctx)
goto fail;
}
- ret = mpp_buffer_group_get_internal(&decoder->frame_group, MPP_BUFFER_TYPE_DRM);
+ ret = mpp_buffer_group_get_internal(&decoder->frame_group, MPP_BUFFER_TYPE_DRM | MPP_BUFFER_FLAGS_DMA32);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "Failed to get buffer group (code = %d)\n", ret);
ret = AVERROR_UNKNOWN;
This patch will force MPP to output frames under dma32 address, so that RGA2 can handle it |
@shivabohemian They should all be the same as ffmpeg, but you need to confirm whether |
Hardware: Orange Pi 5 RK3588S Mali-G610 GPU
OS: Armbian Linux Linux (5.10.110-rockchip-rk3588 #trunk.0248 SMP Fri Feb 10 05:25:40 UTC 2023 aarch64 aarch64 aarch64)
When updating to latest version of librockchip_mpp.so.0 the video playback no longer works. I have traced down the cause to this commit 1cc1af1
When I remove commit 1cc1af1 code changes from latest commit a05b01d and build librockchip_mpp.so.0 then video playback is normal.
Syslog message when segfault happens. This is with the commit 1cc1af1.
The text was updated successfully, but these errors were encountered: