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
Red line artifacts on x265 playback on latest git on Arch ARM RPi4 #18444
Comments
Sure, go nuts. Probably worth someone else verifying it for the pr author. If it doesn't fix this issue, I'll unlink it from that pr |
@fuzzard - Just applying that PR to 7f6bf8f did not fix the issue unfortunately. Link to debug log: https://gist.github.com/graysky2/3c93259256ec88aee718b04501a589a4 |
Seems like it's an 8 bit HEVC. Does it work with 10 bit HEVC?
Likely the lack of modifiers (linear) is causing the banding. I'm not sure why that's happening but perhaps it's a kernel problem (v4l2 decoder not outputting the correct format) |
@graysky2 can you test this with a LibreELEC nightly? It's not an effect I've seen. (from forum thread it looks like it works correctly with a fairly recent LE nightly build). I've just tested with latest nightly and it's still good. I don't see the issue on my own gbm build compiled on Pi4 using RPiOS. At a guess I'd say the luma pointer is correct but chroma is pointing at garbage. Some mismatch in build options between kernel/ffmpeg/kodi seems most likely. I'll ask our codec guy if he can think of anything. |
@graysky2 what is your cma setting? |
Can you report the kernel version? (ideally git hash it was built from, but "uname -a" output if not. |
OK - I've no immediate ideas as to why you get that. The modifiers hold the "vertical stride" which is the same for both luma & chroma so given that there appears to be a generally plausible luma there I would guess it is getting through (though the apparent repeats in chroma look like both stride1 & stride2 are zero and I've no idea how you achieve that). It seems very odd to me that you get this artefact with 4k but not with 1080. Do other resolutions work/not-work? Is it all 4k streams? |
Also what about 4k 10-bit hevc? |
@lrusak -
I cannot seem to play 4k HEVC 10-bit content at all. For example, HEVC 10-bit 59.940fps (Korean ATSC 3.0 satellite TV capture sample) from the samples wiki page. Here I get the animated circles Kodi shows while it loads but I never get video. Here is my debug log when I try: https://gist.github.com/graysky2/f1bbf3c6eb96192e4d1de11181562098 Note that I can play 1080p 10-bit content just fine, this only happens with 4K content. |
@jc-kynesim - I only tried 4k and 1080p so far. So far no 4k content works and all 1080p content works. |
Yes, the latest LE nightly does NOT show this issue, tested LibreELEC-RPi4.arm-9.80-nightly-20200920-1fcfe6a.tar
I took the settings directly from LE.
I have been experiencing this for quite some time, but as I type this, the current kernel is built from raspberrypi/linux@1cbfe9e and:
And
|
I'd be interested if you could try with some other resolutions. There isn't much in the decoder that has ideas about size. 1920x1088 was intended to be the default size if otherwise unspecified though until recently that was broken in a way that would probably have failed to init. Also is there anything in dmesg? The H265 decoder emits a small amount of info by default and should log cases where it detects errors. |
One more question - are you playing to a 4k TV or something else? It shouldn't make any difference but then nor should 4k/not-4k. |
@jc-kynesim - I am happy to try other resolutions. To be clear, are you asking me to switch the resolution in Kodi to something else while trying to playback the same 4K video or are you asking me to try to find some 4K videos in different resolutions and play them with Kodi set to 4K?
I did not see anything printed to dmesg when I played back that 8-bit clip.
I do not own a 4k TV. I have the RPi4 hooked up to a 4K monitor (cheap Philips 276E8V). |
I was wondering what you guys think about the repeating output when I try playing the 10-bit 4K HEVC sample from my comment above #18444 (comment) The kodi.log is filled with lines like this:
|
Re resolutions - I meant please try clips that are neither 4k nor 1080p, 720p for instance and/or other random resolutions. I do not care about display resolution. |
@graysky2 do you have the setting enabled to allow HW decoding using DRMPRIME? Settings -> player -> video |
@lrusak I take it you get some dmesg logging when using the V4L2 H265 decode? |
@lrusak - Yes:
@jc-kynesim - I will try to find some 720p 8bit HEVC and 720p 10bit HEVC and report back. I just built fbef8cf and played back the 4k 8bit HEVC I linked above.
Here is debug log from that: https://gist.github.com/graysky2/9faec1f213129ea64b4f2b900d3557bb |
@jc-kynesim - I managed to locate some 720p HEVC content, one 8-bit and the other 10-bit. I do not believe they are copyright free so I do not want to post URLs. Summary: Log playing back the 8-bit clip: https://gist.github.com/graysky2/24e40d4c931df3fa7199972f80debab1 |
There is an option for turning on FFmpeg debug too in Kodi. I've forgotten where it lives though. If you can find it and turn it on it might reveal something in the logs. |
@jc-kynesim - I googled quite a bit for this but came up empty. Would it be through edited |
In settings/system/logging there is a component specific debug. Enable that and turn on ffmpeg from the options. |
@popcornmix - Yes, thank you! I just found it also. Here is a debug log playing back the video I linked (filename is Here is a debug log trying to play back HEVC 10-bit 59.940fps (Korean ATSC 3.0 satellite TV capture sample) from the samples wiki page. Here no video is displayed at all: https://gist.github.com/graysky2/d0ad319dacca832c8d8a6e3159aa794c Both are using kodi built from fbef8cf |
My understanding is that a kodi master build won't support hevc decode as that requires ffmpeg patches that haven't made it upstream yet. I'm not quite sure what will happen here - I'd assume it would fall back to software decode. |
With vc4-fkms-v3d you need |
Yes, with a resolution of 3840x2160 and vc4-kms-v3d-pi4, without cma the artifacts are the same. |
Interestingly, system/audio "Audio output device" is grayed out.
Kodi log is spammed with lines line:
|
I have something like this
|
Yes - dtparam rather than dtoverlay |
OK! That made all the difference. Now, if I boot using the following, I have no red lines at all. When I switch over to popcornmix/gbm I get HW decoding on all files.
|
Okay, that's interesting. It narrows the problem down to rendering in the kms driver. |
Yes, but vc4-kms-v3d-pi4 works better. Without tearing. |
I am happy to try. Beyond updating the kernel package, are there any changes to the bootloader or firmware etc. that I need to also change? |
Shouldn't be. As long as they are vaguely current switching between 5.4 and 5.9 should be straightforward. |
@popcornmix - Just had to disable If it is something in kms... why doesn't the bug manifest on LE? |
I should note that as @a-ucontrol noted, using Debug log: https://gist.github.com/graysky2/b88feebaa9e1755018b4adeff6de52d4 EDIT: I am wrong... I get similar errors if I use |
What resolution are you using in system/video settings? If it's 4k try 1080p. |
At 1080p I have a normal image. |
For me, even the kodi gui is corrupted at 3840x2160@30. I'm a little surprised you could use kodi at all at that resolution, |
@popcornmix - I just built b0dfb3e and it does not exhibit the red line artifacts I initially reported. Arch ARM, kernel 5.4.70
|
I suspect that is just by luck. The fix will be in kernel not kodi. Avoid 4K hdmi modes for now. |
@graysky2 I assume this can be closed? |
I think it's 100% safe to close this. Thanks to everyone who contributed to the discussion and fix. |
@popcornmix - As an aside, I have read mixed things about 60fps running in 4k on the RPi4B. Is this possible in Matrix? After adding |
It needs this series of patches |
That's excellent. It seems I need more than just those 5 patches. I applied them to the latest commit from rpi-5.10.y (raspberrypi/linux@e1499ba) but the build ended in errors:
|
Take this to forums - it's spamming kodi devs with notifications. |
Bug report
Describe the bug
Playback of a 4k, x265 video on RPi4 gbm build (latest git) on Arch ARM is polluted with red line artifacts. 1080p x265 content is fine.
Expected Behavior
Playback should be artifact-free.
Actual Behavior
Playback is polluted with red line artifacts.
Possible Fix
Help me understand why my build is affected. I do not see this on for example LibreLE.
To Reproduce
Steps to reproduce the behavior:
If you're new to Arch, just login to the system (usernames/passwords shown in the install guide I linked above) update the system, then install kodi-rbp4-git, reboot (changes to
/boot/config.txt
need to be active), and start kodi:Debuglog
The debuglog can be found here: https://gist.github.com/graysky2/b6ed24d7e9f8baaa1b0d3f056320745e
Screenshots
Here are some links or screenshots to help explain the problem:
Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
Kodi for Arch ARM is currently built by this PKGBUILD. Here is the expanded cmake stanza for context:
Your Environment
Used Operating system:
Linux
Operating system version/name: Arch ARM armv7h for RPi4
Kodi version: 19.0.r55946.e29db7f391
The text was updated successfully, but these errors were encountered: