mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
Green screen with the attached video sample #30
Labels
No labels
bug
enhancement
help wanted
invalid
pull-request
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/ffmpeg-rockchip#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kyak on GitHub (Mar 15, 2024).
Originally reported at https://github.com/7Ji-PKGBUILDs/.meta/issues/29
I'm using
kodi-mpp-gitandffmpeg-rockchip-git.With the attached video sample,
mpv --profile=fast --hwdec=rkmpp path-to-filedisplays green screen.kodiunder GBM (https://github.com/hbiyik/ffmpeg-rockchip/wiki/Rendering#kodi-under-gbm) seems to play it, although displays black screen after stopping the video.After stopping the video, kodi shows black screen (it doesn't freeze, it really is just a blank or black screen).
I see these messages in journalctl:
And these messages in kodi log:
Sorry for gzip'ed mkv, couldn't upload to github otherwise :(
out.mkv.gz
@hbiyik commented on GitHub (Mar 15, 2024):
and your kernel is?
@kyak commented on GitHub (Mar 15, 2024):
It's 5.10.160
@nyanmisaka commented on GitHub (Mar 15, 2024):
This clip itself is abnormal. When I play it on other x86 PCs, it also behaves very choppy. When I use ffmpeg-rockchip to transcode on RK3588, the transcoded clip is still very choppy, but there is no green screen here.
https://github.com/nyanmisaka/ffmpeg-rockchip/assets/14953024/4ae25d5a-38bc-4521-ad40-47c5031c0005
@hbiyik commented on GitHub (Mar 15, 2024):
dont worry, i reproduced the issue,
true that, the file is acting weird, but blue/green screen is because of the dimensions
w = 912,
stride = 57*16 (this is what mpp is using align to 16) = 912
but mesa (EGL/mpv) expect 912 to be 64 dividable, 912/64 = 14.25, so wont work
however gbm should have still worked, seems like there is something weird there, i m trying find out if this is kernel related or xbmc related....
@hbiyik commented on GitHub (Mar 15, 2024):
to prevent kodi/gbm issues in the meanwhile you can use without afbc mdoe as below
kodi --windowing=gbm --audio-backend=alsait should work (as long the file is not corrupted, the file seems to be corrupted)
do not add env variable
FFMPEG_RKMPP_DEC_OPT="afbc=on", there seems to be an issue there.@nyanmisaka commented on GitHub (Mar 15, 2024):
I think I know why. I've been using the mpp patch for Jellyfin to avoid 64-aligned issues when using RGA3. Maybe you should add these two to the repository too.
6e76ecb50a6221ca89d9@hbiyik commented on GitHub (Mar 15, 2024):
ok what if vp9 or hevc, are they 256 aligned?
and mpeg1/2/4... DVD stuff
@nyanmisaka commented on GitHub (Mar 15, 2024):
iirc vp9 and hevc should both be 256-aligned. I forgot mpeg1/2/4, will add it later.
@hbiyik commented on GitHub (Mar 15, 2024):
i think not always, only when above certain size, at least for either vp9 or hevc afaik...
@hbiyik commented on GitHub (Mar 15, 2024):
linking the issue for future reference https://github.com/rockchip-linux/mpp/issues/507
@hbiyik commented on GitHub (Mar 15, 2024):
Found the root cause of GBM problem
https://github.com/xbmc/xbmc/pull/24431#issuecomment-2000680604
i will push a fix, in the meanwhile you can disable afbc mode by not passing the env value
@hbiyik commented on GitHub (Mar 17, 2024):
@kyak
i pushed a fix for xbmc here: https://github.com/hbiyik/xbmc/tree/gbm_drm_dynamic_afbc_video_planes_v2
can you test it?
if you do not know how to test it here is a quick recipe.
if so far so good, we can move to https://github.com/xbmc/xbmc/pull/24431 for the discussion since the issue is not related to ffmpeg but xbmc
@kyak commented on GitHub (Mar 18, 2024):
@hbiyik although i build
kodi-ext-gitmaster branch on a regular basic, i couldn't build from your branch. Maybe it's because your branch is lagging behind the master branch? The error is the following:@hbiyik commented on GitHub (Mar 18, 2024):
@kyak yeah it is lagging but thats fine.
you can just add
somewhere around line 89~109, in to the
_argssection as a new line.also please delete the
in line 70, under
prepare()this will help to build faster next time, because the PKGBUILD will not delete the previous build and continue where it was left.@kyak commented on GitHub (Mar 18, 2024):
@hbiyik thanks for the hints!
Unfortunately, it doesn't really work. Most of the videos don't play (although I found one that plays).
For example,
Big_Buck_Bunny_1080_10s_10MB.mp4displays black screen.@kyak commented on GitHub (Mar 18, 2024):
Without FFMPEG_RKMPP_DEC_OPT="afbc=on", it seems to work, albeit weird.
For example, it displays black screen behind OSD (i.e. OSD is drawn on top of black screen). When OSD is not active, the video displays normally.
@hbiyik commented on GitHub (Mar 18, 2024):
Weird tried it last night it was working, i will check again.
Just to confirm, does ur kernel have below path?
0002-vop2_rbga2101010_capability_fix.patch
Which kernel package are you using?
Also you can you provide output of
drm_info?Drm info pkg is on aur: https://aur.archlinux.org/packages/drm_info
@kyak commented on GitHub (Mar 18, 2024):
I'm using
linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-gitfrom 7Ji's repo.drm_info.txt
@hbiyik commented on GitHub (Mar 18, 2024):
ok your kernel is not patched correctly
there should be no XRGB2101010 in drm formats... This is a bug confirmed by rockchip https://github.com/nyanmisaka/ffmpeg-rockchip/pull/4#issuecomment-1892934552
now we need a new ticket in 7ji-pkgbuilds. :) i will open it for you :)
@hbiyik commented on GitHub (Mar 18, 2024):
@kyak https://github.com/7Ji-PKGBUILDs/.meta/issues/31
@kyak commented on GitHub (Mar 19, 2024):
@hbiyik back to you here. As mentioned, i'm now running the patched kernel:
I need to mention that
kodi-mpp-gitfrom 7Ji's repo doesn't work withFFMPEG_RKMPP_DEC_OPT="afbc=on"nicely. It displays black screen instead of OSD and this is above the video. But I guess this is expected. Without the env var, it works fine.As for
kodi-ext-gitbuilt from your branch, it still doesn't work well. With the env var, depending on video, it displays OSD on top of black screen or a spinner (audio plays, video doesn't). Without the env var, it plays some videos fine (those with OSD on black screen with env variable) and shows spinner with audio on other videos.This message from the kernel log repeats:
@hbiyik commented on GitHub (Mar 20, 2024):
thanks for the feedback, i suggest the following
since we are on different hardwares we need to reduce the software variantions to minimum.
To even simplify the cases, lets focus 5.10 kernel, because 6.1 kernel has several differences in display driver of rockchip (vop2) and i dont want possible 6.1 vop2 changes related issues to interfere, so lets make sure 5.10 works first. Later we can reiterate the test on 6.1..
so lets use https://github.com/7Ji-PKGBUILDs/linux-aarch64-rockchip-bsp5.10-joshua/blob/master/PKGBUILD.
first thing to do, patch this with
https://patch-diff.githubusercontent.com/raw/Joshua-Riek/linux-rockchip/pull/8.patch
lets focus on 1 single file and 1 single obvious problem, and that should not be out.mkv.gz, because this file is already broken. So you will see black screen with this file not because rendering is wrong but because the file is broken and ffmpeg cant decode properly.
lets only test https://github.com/hbiyik/xbmc/tree/gbm_drm_dynamic_afbc_video_planes_v2 as xbmc, because i already noticed a problem in the first implementation (the one in the ffmpeg-mpp-git). And for you building this should be reletively easy may be in 2 or 3 mins, we can test a new change. We can forget ffmpeg-mpp-git for now until we clearify all the issues.
If we can reproduce 1 single issue, i assume the root cause of it will fix the rest of the issues.
From my end, i have onyl tested this with 5.10 radxa kernel, so may be i will directly see the issue on joshua 5.10.. we will see
@kyak commented on GitHub (Mar 20, 2024):
I'm running Orange Pi 5 Plus (have both 8 Gb and 16 Gb versions). What is your hardware?
This is clear, will do.
Also clear, I will find you the file that's properly broken :) Thing is, I've split this one from original video using ffmpeg and might've broken something in the video file along the way.
It's clear I should test
kodi-ext-gitwith your branchgbm_drm_dynamic_afbc_video_planes_v2. But what do you mean that we should forget aboutffmpeg-mpp-git? Should I simply keep using the binary package offfmpeg-mpp-gitfrom 7Ji's repo? Should I still set the env var when testing? Do I need to point kodi to the systemffmpeg-mpp-gitor it will use it automatically (since it's-extpackage)?@hbiyik commented on GitHub (Mar 20, 2024):
i am on radxa 5b with 4g.
i mean we should forget about ffmpeg-mpp-git durinf testing gbm workflow, when we fix those issues in gbm_drm_dynamic_afbc_video_planes_v2, i will port them to
ffmpeg-mpp-git. You can keep it installed, and use it daily, as far as i know it works without theafbc=onso you can daily use it.for testing and verifying the kodi-ext-git, point the source to gbm_drm_dynamic_afbc_video_planes_v2 and run
make pkgbut dont install the generated packages. Instead go tosrc/kodi-buildand run./kodi.binlocally for testing.Whenever i push a fix, you will run makepkg again, and it will compile with the latest from my branch so that you can verify that it is fixed in opi5 as well. When we make sure it works fine, i can then port the changes to
kodi-mpp-gitand mainlinexbmcrepo with PR saying that it is tested.@hbiyik commented on GitHub (Mar 20, 2024):
@kyak
here is a patched joshua's 5.10 kernel https://file.io/y7zSI9ZVm1Bl
i have tested and everything seems to work fine with my rock5b
@kyak commented on GitHub (Mar 20, 2024):
Don't worry, it's almost built on my side. Will report back tomorrow.
@kyak commented on GitHub (Mar 21, 2024):
@hbiyik
I'm now running
linux-aarch64-rockchip-bsp5.10-joshuawith the patch. I also builtkodi-ext-gitfrom your branch. I'm running kodi in GBM mode, with Direct to Plane rendering.With
afbc=on, i get black screen instead of video. OSD displays fine.Without
afbc=on, the video plays fine. OSD displays fine on top of the video.Is this expected?
@hbiyik commented on GitHub (Mar 21, 2024):
no this is not expected, it should play in afbc mode aswell.
could you restart the device and provide the full output of
drm_info. It is better for me to see the default drm state, therefore i need a clean start.Then run kodi with afbc mode in gbm, make sure u enabled debug mode . It is very important debug mode to be enabled otherwise i wont see anything.
Run the video which is resulting the black video output. Close kodi, and send the log file at
~/.kodi/temp.kodi.logAlso, for me to reproduce can you send the file that produces black video?
@kyak commented on GitHub (Mar 21, 2024):
Here's the drm_info output after the reboot:
drm_info.txt
Here's the verbose log:
kodi.log
And here is the video file: https://file.io/QNZMTBNLMCxi
@hbiyik commented on GitHub (Mar 21, 2024):
ok something obviously is wrong according to your logs, let me investigate this a little bit.
CDRMUtils::FindVideoPlane - Can not find a Video Plane plane for format 942691673, modifier 576460752303423553@hbiyik commented on GitHub (Mar 21, 2024):
@kyak is it possible to boot into https://github.com/7Ji-PKGBUILDs/linux-aarch64-rockchip-bsp6.1-joshua-git kernel, and provide the
drm_infooutput.I understood the problem, the soc rk3588s (used in opi5) and rk3588 (used in rock 5b) provides different drm layout, this is a little bit weird, to me looks like even a display driver (vop2) bug in kernel.
PS: no need to patch joshua6.1 all patches are already in there
I would like to compare my devices drm tree with your opi5, i think it should give some more hints.
Note to myself:
f15552775dmost likely this commit might fix a lot issues@kyak commented on GitHub (Mar 22, 2024):
@hbiyik
Here's the drm_info for 6.1:
drm_info.txt
Please note that i'm running Orange Pi 5 Plus, which is rk3588, not rk3588s.
I also checked the situation with 6.1 kernel and it seems like it didn't change anything.
@hbiyik commented on GitHub (Mar 22, 2024):
@kyak
could you replace your dtb with the dtb rk3588-orangepi-5-plus.dtb.tar.gz on joshua's 5.10 kernel, and run
drm_infoand paste the results?the location should be:
/boot/dtbs/linux-aarch64-rockchip-bsp5.10-joshua/rockchip/rk3588-orangepi-5-plus.dtbthe actual change is here
PS: I did not mention specificly and thought it was obvious, but in any case you need to restart the device after replacing the dtb :)
@kyak commented on GitHub (Mar 24, 2024):
@hbiyik thanks so much for your patience.
This is
drm_infooutput from joshua's 5.10 kernel with your modified dtb:drm_info.txt
Using modified dtb still didn't change anything
@kyak commented on GitHub (Mar 27, 2024):
@hbiyik in case this was lost in discussion, i want to point out that there is a configuration that works fine for me. I.e. all kinds of videos plays fine, OSD displays fine and this is with GBM and Direct to Plane mode of Kodi.
The configuration is:
linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-gitwith two patches:0001-rga3_uncompact_fix.patch
0002-vop2_rbga2101010_capability_fix.patch
ffmpeg-mpp-gitbinary packagekodi-mpp-gitbinary package, no environment variablesMaybe with can start from this configuration and figure out what the problem is?
@hbiyik commented on GitHub (Mar 27, 2024):
@kyak
Even in this configuration kodi with gbm mode and afbc enabled with FFMPEG_RKMPP_DEC_OPT="afbc=on should cause problems on opi5 variants.
I think i got the underlying problem, and i have something in my mind to solve it with xbmc.
Currently im on vacation may be next week i will prototype something, than i might need some testinv support.