Kodi Community Forum
Linux green screen on skip forward or backward - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Linux green screen on skip forward or backward (/showthread.php?tid=331440)

Pages: 1 2


green screen on skip forward or backward - Harri - 2018-04-30

Hi folks,
if I press skip forward or backward on movie playback, then I get a distorted, green screen for a few seconds. "file" says, its an "ISO Media, MP4 v2 [ISO 14496-14]". Hardware is Zotac O Series PC, especially
  00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
Platform is Debian (with or without deb-multimedia repository). Kodi is 2:17.6+dfsg1-2, ffmpeg 7:3.4.2-2+b1, Kernel is 4.16.6.

Every helpful comment is highly appreciated
Harri


RE: green screen on skip forward or backward - wsnipex - 2018-04-30

try with our official packages instead of the debian ones.


RE: green screen on skip forward or backward - Harri - 2018-04-30

Correct me if I am wrong, but AFAICT you provide packages only for Ubuntu. For Debian the installation guide points to the Debian repository. Is this not valid anymore?


RE: green screen on skip forward or backward - wsnipex - 2018-04-30

debian's packages are unsupported here. If you prefer to use them, you'll have to report issues to debian, unless the problem occur with vanilla kodi as well


RE: green screen on skip forward or backward - Harri - 2018-05-05

I tried Ubuntu and your ppa archive, but installation failed miserably, see https://paste.ubuntu.com/p/PDNpHdGfG3/ . Feels like I wasted my time. At least it could be installed on Debian.


RE: green screen on skip forward or backward - wsnipex - 2018-05-06

Remove all Debian packages first


RE: green screen on skip forward or backward - Harri - 2018-05-06

That was a fresh Ubuntu install. Not to mention that appr. 95% of all packages Ubuntu relies on are "Debian packages".


RE: green screen on skip forward or backward - yasij - 2018-05-06

He means specifically the Debian Kodi package the ships with Ubuntu. It is packaged differently and causes conflicts.

sudo apt purge kodi*

sudo apt install kodi


RE: green screen on skip forward or backward - Scorpius - 2018-05-14

Same exactly thing happens to me on very similar hardware, but I think I know what it is.

I have an Intel NUC.  This started happening when I upgraded to 17.6.  If I disable the VA-API hardware acceleration, the forward/rewind works fine.

Remember these NUCs have a Haswell Intel CPU with integrated graphics that loads the i965 driver for Intel G45 & HD Graphics Family.

Now and I'm sorry, I don't think it's the driver or the kernel fault.  With VLC with VA-API enable, you can skip all around fine.  With Kodi, you can actually see errors on StepBack like these:
Code:
22:52:26.707 T:140082223740352   DEBUG: OnKey: 169 (0xa9, obc86) pressed, action is StepBack
(...)
22:52:27.587 T:140080471807744   DEBUG: VAAPI - open decoder
22:52:27.588 T:140078638671616   DEBUG: Thread Vaapi-Output start, auto delete: false
22:52:27.588 T:140078638671616  NOTICE: COutput::OnStartup: Output Thread created
22:52:27.592 T:140078638671616   DEBUG: VAAPI::COutput::CreateEGLContext - created context
22:52:27.594 T:140078564366080   DEBUG: CVideoPlayer::HandleMessages - player started 1
22:52:27.596 T:140078638671616   DEBUG: VAAPI::COutput::InitBufferPool - Surfaces created
22:52:27.596 T:140080471807744   DEBUG: CDVDVideoCodecFFmpeg - Updated codec: ff-h264-vaapi
22:52:27.596 T:140080471807744   DEBUG: ffmpeg[7F6706C31700]: [h264] Using deprecated struct vaapi_context in decode.
22:52:27.597 T:140080471807744   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 0
22:52:27.597 T:140080471807744   ERROR: ffmpeg[7F6706C31700]: [h264] Got unexpected packet size after a partial decode
22:52:27.597 T:140080471807744   ERROR: Decode - avcodec_decode_video returned failure
22:52:27.597 T:140080471807744   DEBUG: CVideoPlayerVideo - video decoder returned error
22:52:27.597 T:140080471807744   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 0
22:52:27.598 T:140080471807744   DEBUG: Previous line repeats 1 times.
22:52:27.598 T:140080471807744 WARNING: CVideoSurfaces::ClearReference - surface invalid
22:52:27.598 T:140080471807744   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 0
22:52:27.608 T:140082223740352   DEBUG: Previous line repeats 1 times.
22:52:27.608 T:140082223740352  NOTICE: VAAPI::Close

I can disable the hardware acceleration and these little computers handle the data just fine but after a while the fan cooler starts accelerating and making an annoying noise so I would prefer to use the VA-API hardware acceleration.

The thing is, I also have Debian, and I also use deb-multimedia.org which is NOT the official Debian repo and are supposed to be vanilla kodi.  If you guys insist is a Debian problem, and not a Haswell problem in Kodi (or the ffmpeg that Kodi uses), the only solution to discard that theory is to compile the whole thing manually.  But I think it's a Haswell problem on Kodi because it wasn't happening in 16.x using the same non-official repo.


RE: green screen on skip forward or backward - fritsch - 2018-05-14

Why do people always have to cut their debuglogs?


RE: green screen on skip forward or backward - Scorpius - 2018-05-14

(2018-05-14, 07:55)fritsch Wrote: Why do people always have to cut their debuglogs?
 Way too much private information in them that it's totally useless for a developer.  Posting the complete debug log in the Internet is fatal.


RE: green screen on skip forward or backward - fritsch - 2018-05-14

As you know what is useless for a dev - I am curious on your fix.


RE: green screen on skip forward or backward - Scorpius - 2018-05-14

For a full debug.log I would have to create a staging environment for it, but I wonder what you need to see in it...

The problem is that, with VA-API hardware acceleration enabled on a Haswell, when you skip back it seems that it doesn't look for the previous keyframe and then process the stream up to your your position like it should (and finally show the image).  Since there's no keyframe, you see green screen artifacts everywhere, and when the next keyframe comes in the stream, the image gets fixed obviously.  That's why OP says "green screen for a few seconds".

I don't think it happens when you skip ahead... I haven't tested this.  If you disable the hardware acceleration it works fine.

I'm pretty sure this only happens on a Haswell so I guess the devs here can't reproduce it and probably the solution would be a downgrade in the ffmpeg that Kodi uses, or maybe try it with the new ffmpeg 4.0.  I have another box with Windows and an AMD Radeon R9 290 and does not happen there (it doesn't even use VA-API as you know).  Even though I'm commenting the bug here, I'm almost sure it's an ffmpeg bug with the 3.1.6 in the ff-h264-vaapi codec.

I would compile Kodi myself with another ffmpeg if it wouldn't take days...


RE: green screen on skip forward or backward - fritsch - 2018-05-14

I am running HSW on my laptop. What do I have to do - to trigger the green screen?

I tried searching through an mp4 (h264) forward and backward and did not see any black green screen. I cannot reproduce with 17.6 / ffmpeg 3.1.x and also not with v18 / ffmpeg 4.0.x


RE: green screen on skip forward or backward - Scorpius - 2018-05-14

Hmm... Then it's definitely ffmpeg, and it seems I don't have 3.1.6.   I just found out this:

Code:
naikel@htpc:~/.kodi/temp$ ldd -d /usr/lib/x86_64-linux-gnu/kodi/kodi.bin | grep avcodec
        libavcodec.so.57 => /usr/lib/x86_64-linux-gnu/libavcodec.so.57 (0x00007f4ad1183000)
        libavcodec.so.58 => /usr/lib/x86_64-linux-gnu/libavcodec.so.58 (0x00007f4ab323a000)
naikel@htpc:~/.kodi/temp$ dpkg -l | grep avcodec
ii  libavcodec57:amd64                     10:3.4.2-dmo3                        amd64        Library to encode decode multimedia streams - runtime files
ii  libavcodec58:amd64                     10:4.0-dmo1                          amd64        Library to encode decode multimedia streams - runtime files

This means my Kodi is somehow using both ffmpeg 3.4.2 and 4.0 at the same time.  This is obviously a packaging problem from whoever compiled this in deb-multimedia.org. 

But, why wouldn't it work with 3.4.2? I think it is because they disabled the H264 look_ahead by default:

https://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff/0cf9fa99242a1f694e2ea3b35a450974774f56cc..0645698ecc2021ec422b625a6c1d235d2f252563:/libavcodec/qsvenc_h264.c

It's my only theory right now.

At this point it seems the only solution I have to have a vanilla Kodi in Debian is to compile it myself but that's like several days of work.