Skip to content
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

Kodi 18.1 do not display DVB subtitles correctly on linux #15723

Closed
neywat opened this issue Mar 11, 2019 · 17 comments

Comments

Projects
None yet
5 participants
@neywat
Copy link

commented Mar 11, 2019

Bug report

Describe the bug

On Linux, after upgrading to kodi 18.1, subtitles for DVB streams (both live tv and recordings) are no more readable : a white rectangle is displayed instead. If hardware acceleration is enabled, any time such a white rectangle shows, the video flickers. When hardware acceleration is disabled or not available, there is no flickering.
Possibly related to https://forum.kodi.tv/showthread.php?tid=340891&highlight=white+rectangle+subtitle

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Watching live tv or recordings with subtitles enabled is expected to display readable subtitles. Using hardware acceleration must not generate flickering when activating subtitles.

Actual Behavior

Playing DVB streams with subtitles enabled displays white rectangles when subtitles are expected.

Possible Fix

To Reproduce

Steps to reproduce the behavior:

I use tvheadend to watch live TV and record TV shows, with a DVB card. To reproduce you need to watch a DVB stream with subtitles enabled.

  1. Open TV menu
  2. Choose a recording with embedded subtitles
  3. Enable subtitles

Here is a sample from an existing recording containing DVB subtitles : https://www.dropbox.com/s/yn05enw040i0zff/kodi_18.1_bug_subtitles_dvb%20-%20issue%2015723.mkv?dl=0

Debuglog

The debuglog can be found here:
kodi.log

Screenshots

Here are some links or screenshots to help explain the problem:

image

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

My DVB recordings are created by tvheadend. Tvheadend produces MKV files without further postprocessing as far as i understand correctly. With mktoolnix i listed the content of recorded files and saw that subtitles streams are using the S_DVBSUB type. This type is not properly rendered in kodi v18.1, while it was in kodi v17.6.
MKVs containing subtitles with S_TEXT/UTF8 type are working correctly in both kodi versions.

Note, screenshot and kodi.log where created from a VM to be able to reproduce the problem from scratch and from a clean install.

Your Environment

Used Operating system:

  • Android

  • iOS

  • Linux

  • OSX

  • Raspberry-Pi

  • Windows

  • Windows UWP

  • Operating system version/name: Ubuntu 18.04.2 LTS

  • Kodi version: 18.1 (2:18.1+git20190217.1232-final-0bionic)

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@neywat neywat changed the title Subtitles from DVB streams not properly displayed Kodi 18.1 do not display DVB subtitles correctly on linux Mar 16, 2019

@neywat

This comment has been minimized.

Copy link
Author

commented Mar 16, 2019

Seems to be a linux only issue.
DVB subtitles from the sample file (https://www.dropbox.com/s/yn05enw040i0zff/kodi_18.1_bug_subtitles_dvb%20-%20issue%2015723.mkv?dl=0) are correctly displayed on windows 7 + kodi 18.1.

@enen92

This comment has been minimized.

Copy link
Member

commented Mar 16, 2019

Could not reproduce on both OSX and android. Marking as a linux specific issue. Triage needed since I don't have a way to test on linux. @DaVukovic can you try playing the sample file on your linux system?

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Mar 16, 2019

When saying "Linux" you should make clear what configuration you are referring to. I doubt that there is an issue on a typical Linux x86 installation. Running Kodi in a virtual machine is an edge case.

2019-03-11 15:19:27.094 T:140134571451328 NOTICE: GL_VENDOR = VMware, Inc.
2019-03-11 15:19:27.094 T:140134571451328 NOTICE: GL_RENDERER = llvmpipe (LLVM 7.0, 128 bits)
2019-03-11 15:19:27.095 T:140134571451328 NOTICE: GL_VERSION = 3.1 Mesa 18.2.2
2019-03-11 15:19:27.095 T:140134571451328 NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.40

@neywat

This comment has been minimized.

Copy link
Author

commented Mar 16, 2019

When saying "Linux" you should make clear what configuration you are referring to. I doubt that there is an issue on a typical Linux x86 installation. Running Kodi in a virtual machine is an edge case.

2019-03-11 15:19:27.094 T:140134571451328 NOTICE: GL_VENDOR = VMware, Inc.
2019-03-11 15:19:27.094 T:140134571451328 NOTICE: GL_RENDERER = llvmpipe (LLVM 7.0, 128 bits)
2019-03-11 15:19:27.095 T:140134571451328 NOTICE: GL_VERSION = 3.1 Mesa 18.2.2
2019-03-11 15:19:27.095 T:140134571451328 NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.40

I totally agree, but as i wrote in the bug report, i created a vm to reproduce the bug and to make sure the issue was not with my real kodi computer on which i downgraded to 17.6-Krypton as soon i encountered the problem.

Here comes an extract from current kodi.log (currently downgraded to kodi 17.6) from my real hardware :

19:08:06.052 T:139954302957952  NOTICE: Starting Kodi (17.6 Git:20171114-a9a7a20). Platform: Linux x86 64-bit
19:08:06.052 T:139954302957952  NOTICE: Using Release Kodi x64 build
19:08:06.052 T:139954302957952  NOTICE: Kodi compiled Nov  4 2012 by GCC 5.4.0 for Linux x86 64-bit version 4.4.90 (263258)
19:08:06.052 T:139954302957952  NOTICE: Running on Ubuntu 16.04.6 LTS, kernel: Linux x86 64-bit version 4.4.0-121-generic
19:08:06.052 T:139954302957952  NOTICE: FFmpeg version/source: ffmpeg-3.1-kodi
...
19:08:06.566 T:139954302957952  NOTICE: GL_VENDOR = X.Org
19:08:06.566 T:139954302957952  NOTICE: GL_RENDERER = AMD CEDAR (DRM 2.43.0 / 4.4.0-121-generic, LLVM 6.0.0)
19:08:06.566 T:139954302957952  NOTICE: GL_VERSION = 3.0 Mesa 18.0.5
19:08:06.566 T:139954302957952  NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.30
...

If needed i can re-update to kodi 18.1 and produce a debug log from real hardware.

@MightyMrMuesli

This comment has been minimized.

Copy link

commented Mar 17, 2019

I'm experiencing the same problem with embedded subtitles in mkv files. External srt files are working fine. Here's an example:

screenshot001

The debug kodi.log

I use the standard Arch Linux package and run Kodi in standalone mode following the guide in the Arch wiki.

mesa: 18.3.4
glu: 9.0.0
xf86-video-ati: 19.0.0
xorg-server: 1.20.4

The subs were displayed correctly under 17.6.

@kszaq

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

This is a shot in the dark but it seems like missing shaders for GLSL < 1.5. Perhaps this could help:

wget http://ix.io/1DWk -O /usr/share/kodi/system/shaders/GL/1.2/gl_shader_frag_texture_lim.glsl
cp /usr/share/kodi/system/shaders/GL/1.5/gl_tonemap.glsl /usr/share/kodi/system/shaders/GL/1.2
@neywat

This comment has been minimized.

Copy link
Author

commented Mar 19, 2019

Thank you for this !

One bad new, one good new.

The bad one : I already tried to copy gl_tonemap.glsl in vain : results in flickering, no video and no subtitles either. Corresponding log here : kodi.old.log

Now, for the good one, if i ignore gl_tonemap.glsl download the first shader gl_shader_frag_texture_lim.glsl and use only this one, then DVB subtitles get back to life in the uploaded mkv on a test machine. I did not try your solution yet on my "production" computer, but this sounds promising.

@kszaq

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

Please confirm on your "production" computer and I can PR this.

About missing tonemap shader I cannot help as I know nothing about coding shaders. Perhaps @FernetMenta can help on this?

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

@kszaq there is no tone mapping for that old version of GL. You can safely ignore the error.

For a fix you should enable SM_TEXTURE instead of SM_TEXTURE_LIM if glsl version is < 1.5
https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGL.cpp#L517

Limited range is not supported on those old systems.

@MightyMrMuesli

This comment has been minimized.

Copy link

commented Mar 19, 2019

Thank you for this !

One bad new, one good new.

The bad one : I already tried to copy gl_tonemap.glsl in vain : results in flickering, no video and no subtitles either. Corresponding log here : kodi.old.log

Now, for the good one, if i ignore gl_tonemap.glsl download the first shader gl_shader_frag_texture_lim.glsl and use only this one, then DVB subtitles get back to life in the uploaded mkv on a test machine. I did not try your solution yet on my "production" computer, but this sounds promising.

Can confirm on hardware:

kodi.log with both copied gl_tonemap.glsl and downloaded gl_shader_frag_texture_lim.glsl (not working)
kodi.log with gl_shader_frag_texture_lim.glsl only (working)

@neywat

This comment has been minimized.

Copy link
Author

commented Mar 20, 2019

Please confirm on your "production" computer and I can PR this.

Works on own hardware, fix confirmed.

@kszaq

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

@FernetMenta Does this mean that using gl_shader_frag_texture_lim.glsl adapted to GLSL 1.2 is incorrect (http://ix.io/1DWk)? This approach is cleaner (no additional ifs in code) but if incorrect, I will not PR it.

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

Does this mean that using gl_shader_frag_texture_lim.glsl adapted to GLSL 1.2 is incorrect

exactly this.

kszaq added a commit to kszaq/xbmc that referenced this issue Mar 20, 2019

GL: Don't use SM_TEXTURE_LIM for GLSL < 1.5
SM_TEXTURE_LIM is not available for GLSL < 1.5, we should use SM_TEXTURE instead.

Fixes xbmc#15723

@kszaq kszaq referenced this issue Mar 20, 2019

Merged

GL: Don't use SM_TEXTURE_LIM for GLSL < 1.5 #15783

3 of 13 tasks complete

kszaq added a commit to kszaq/xbmc that referenced this issue Mar 20, 2019

GL: Don't use SM_TEXTURE_LIM for GLSL < 1.5
SM_TEXTURE_LIM is not available for GLSL < 1.5, we should use SM_TEXTURE instead.

Fixes xbmc#15723
@kszaq

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

@FernetMenta I implemented the change you suggested: #15783

@neywat @MightyMrMuesli Can you try if the patch from PR works?

@neywat

This comment has been minimized.

Copy link
Author

commented Mar 20, 2019

@kszaq With patch applied on master, subtitles are correctly rendered on my test machine. kodi.log

@MightyMrMuesli

This comment has been minimized.

Copy link

commented Mar 20, 2019

@FernetMenta I implemented the change you suggested: #15783

@neywat @MightyMrMuesli Can you try if the patch from PR works?

Building against xbmc master with your patch right now. As you can imagine this will take a while on my ancient board. ;-) Thanks for the insanely fast support!

@MightyMrMuesli

This comment has been minimized.

Copy link

commented Mar 21, 2019

@kszaq With patch applied on master, subtitles are correctly rendered on my test machine. kodi.log

Worked for me too. Thanks everyone!

fuzzard added a commit to fuzzard/xbmc that referenced this issue Apr 13, 2019

GL: Don't use SM_TEXTURE_LIM for GLSL < 1.5
SM_TEXTURE_LIM is not available for GLSL < 1.5, we should use SM_TEXTURE instead.

Fixes xbmc#15723

fuzzard added a commit to fuzzard/xbmc that referenced this issue Apr 15, 2019

GL: Don't use SM_TEXTURE_LIM for GLSL < 1.5
SM_TEXTURE_LIM is not available for GLSL < 1.5, we should use SM_TEXTURE instead.

Fixes xbmc#15723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.