Open greatquux opened 2 years ago
The oops backtrace doesn't provide any information but the dmsg log indicates there has been some non-fatal unhappiness (WARNs) in video driver ending with a more fatal null dereference.
If you disable hw acceleration I assume it plays okay?
I've tried installing twitch addon, and it is playing mst3k channel. How long is it usually before crashing? It's been playing about 25 mins so far without a crash.
I haven't tried to disable h/w acceleration just yet, and I do want to confirm this continues to occur in the latest kernel just released a few days ago. I just picked the mst3k channel because it had mid-roll ads (which were what was crashing). I will try to do some more tests tonight.
just picked the mst3k channel because it had mid-roll ads
How frequent were the ads? I think I stopped it after about 40 minutes (where it was still running).
I had an issue with the Twitch plugin still displaying ads on channels I'd subscribed to (including that one) but I've since fixed that by putting the right info in my addon's XML file. So I was jumping around last night (from around 22:10 to 22:17) trying to find a channel to display ads. I finally left it on loltyler1 (at 22:17) and it seems like it took about 40 minutes (coincidentally) to give me the Oops again (at 22:56) and then become completely unresponsive and require a hardware reboot at 23:03. So sometimes it needs to play for a while to get to one of these ads. But interestingly in the included dmesg log we start seeing WARNINGs before I settle on the one channel. twitch_prob_dmesg.log
I will try to turn off acceleration today and see if I can just leave it on a channel for a long time without crashing to definitely say it's related to hardware acceleration.
I will try to turn off acceleration today and see if I can just leave it on a channel for a long time without crashing to definitely say it's related to hardware acceleration.
I expect it will be related to hw acceleration, but always good to be sure. I'll leave the twitch test running longer when convenient.
Actually I turned off h/w acceleration (allow prime) and then went into a Twitch channel, which properly displayed a pre-roll ad that looked fine (and I usually don't even see the ads), but then went the ad ended and it displayed the channel video it was all screwed up, colors wrong and video corrupted. I stopped it and turned it back on and went back into the channel (no ad this time, probably because it just displayed one) and video was normal, so I'm leaving it on there since it seems to be unusable without acceleration.
I've just tried all combinations of "Allow using DRM PRIME decoder" and "PRIME Render Method" and all seemed to start playing video okay. I didn't seem to start with an ad though. Can you grab a debug enabled kodi log? If it's failing without hardware acceleration, then it's probably a kodi issue. Also might be worth testing the same version of kodi (is this 19.3?) on another platform (e.g. windows or linux on PC).
Do you want me to get the debug log with acceleration on or off? I didn't run it long enough to see if it crashes the kernel without acceleration because it just wasn't displaying correctly for me (if you want me to take a picture let me know).
If it's going wrong without acceleration then a log without acceleration should be fine. A picture could be useful too.
Ok, I have attached a debug log playing Twitch for a while (hour?) without acceleration. No hangs, but corrupted video display. kodi_debug_log_no_hwaccel.log Accel settings: Example of corrupted video display (pre-roll ad): Example of corrupted video display (channel):
I can try to get a debug log later on with acceleration on (at least, before it dies) but a kid is coming home from school now and will need to watch his favorite movie so this box is going to go into production mode (haha) until he goes to bed.
Hmm photos don't look like a decode error, but more an alignment error of luma/chroma. I wonder if stream changes resolution and that isn't handled properly. Can you test with "PRIME Render method" set to "EGL"?
I left "Allow using DRM PRIME Decoder" off and changed PRIME Render Method to EGL but there was no change in the display, it showed the same corruption. I turned Allow using DRM to on, and left render method at EGL, and the video was displayed properly then (I quit the stream before I could run into the crashing issue and reset render method back to Direct to Plane).
Also note there are two options for acceleration "Allow using DRM decoder" and "Allow hw accel with DRM PRIME" which may behave differently. The "DRM decoder" means we use DRM buffers so can decode and display with zero copy. In addition to that the decoder can be SW (ffmpeg) or HW (V4L2).
Ah I get it now. Later tonight I will test with "Allow using DRM decoder" ON, but "Allow hw accel" OFF and see what happens (and with direct and EGL). In terms of the crash though it's likely some V4L2 bug I guess?
With "allow hw accel" OFF but "allow using DRM" ON, Twitch looked fine, of course it used a lot of CPU, but did not give me any oops or crash kernel, left it running all night. EGL would work for a little while then run into problems with stuttering (with other videos too, even if hwaccel was on), Direct to Plane works just fine (with hwaccel on or off). So the kernel crashing issue does appear to be related to V4L2 hardware acceleration.
I suspect the colour being wrong and kernel crashing are different symptoms of the same problem (not handing a change in dimensions correctly). So I'm interested in which setting are: 1) perfect 2) no crash but colours corrupted 3) kernel crash
Also when colour go wrong, can you check the OSD info ('o' key) for video stream resolution. Does it change when it goes wrong.
Ok sorry it took so long but I was able to run a bunch of tests finally. Combinations of settings are described below. "Only Allow h/w accel w/ HEVC" is OFF for all settings below.
If willing to accept more CPU usage, then Allow using DRM Prime ON; Allow h/w acceleration with DRM PRIME OFF; Prime Method Direct to Plane will also render colors correctly and not crash. (ran a Twitch channel for about 45 min)
no crash but colors corrupted - anytime I set Allow using DRM Prime OFF I will get corrupted colors, no matter the other settings. And this is with a regular H.264 movie, images are shown below.
kernel crash - I have only gotten the kernel to crash as described in the initial report when using the otherwise "perfect" settings. I have gotten kodi to be unusable within a few minutes whenever I use Prime Method EGL Kodi just stops rendering, becomes almost unusable until I stop the video, and then doesn't work correctly until I reboot. No matter the other settings, EGL always gets into that state within a few minutes of playing any video (I tested with just a regular H.264 movie).
IN regards to your question about the resolutions, there are two images below, and the video stream resolution is shown differently in both of them.
Images: Allow using DRM Prime OFF - corrupted colors:
Allow using DRM Prime ON - colors are good:
Describe the bug
While playing video in the Twitch add-in, if the add-in needs to play an ad mid-stream, it has been reliably crashing and causing a kernel Oops. This is the latest kodi from raspbian bullseye archives, and regular 32-bit armhf raspbian bullseye, on pi 400.
Steps to reproduce the behaviour
install kodi and twitch add-in, use hardware acceleration (which works great for all other videos and the youtube add-in, and certainly doesn't cause kernel crashes!); play any channel you are not subscribed to which should eventually cause ads, I got the crash documented in the logs while viewing the mst3k channel https://www.twitch.tv/mst3k
Device (s)
Raspberry Pi 400
System
pi@raspberrypi ~> cat /etc/rpi-issue Raspberry Pi reference 2020-08-20 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 9a3a10bf1019ebb2d59053564dc6b90068bad27d, stage5
pi@raspberrypi ~> vcgencmd version Nov 18 2021 16:16:49 Copyright (c) 2012 Broadcom version d9b293558b4cef6aabedcc53c178e7604de90788 (clean) (release) (start)
pi@raspberrypi ~> uname -a Linux raspberrypi 5.10.63-v7l+ #1488 SMP Thu Nov 18 16:15:28 GMT 2021 armv7l GNU/Linux
Logs
crash logs were retrieved with command journalctl -o short-precise -k -b -2 dmesg_logs_twitch_crash.log
the Oops info was displayed on an SSH section I had connected at time of crash:
Additional context
No response