streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.65k stars 200 forks source link

Skia shader compilation error on Arch Linux after upgrading llvm-libs 17.0.6-3 -> 17.0.6-4 #1004

Closed schmauder closed 2 months ago

schmauder commented 2 months ago

Checklist

Streamlink Twitch GUI version

AUR package streamlink-twitch-gui-bin 2.4.1-1

Streamlink version

6.7.3

Operating system, environment and configuration details

Arch Linux x86 X11 + Cinnamon desktop AMD Ryzen CPU + Radeon GPU

Description

Upgrading the arch linux package llvm-libs from 17.0.6-3 to 17.0.6-4 results in issues with streamlink-twitch-gui. When starting the application all widgets and elements in the GUI are missing, only a dark grey window is rendered. However moving the mouse over the applications results in changing of the mouse cursor at certain positions indicating there might be a clickable element that is just not visible. In the debug log the error after Errors: link failed but did not provide an info log repeats.

Debug log

streamlink-twitch-gui --loglevel debug
[8240:8255:0502/115330.101737:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: Keine derartige Schnittstelle »org.freedesktop.portal.FileChooser«
[8240:8255:0502/115330.101761:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
[8240:8240:0502/115330.126633:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[0502/115330.139357:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0502/115330.139698:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[8275:8275:0502/115330.342299:ERROR:gl_angle_util_vulkan.cc(189)] Failed to retrieve vkGetInstanceProcAddr
[8275:8275:0502/115330.342330:ERROR:vulkan_instance.cc(91)] Failed to get vkGetInstanceProcAddr pointer from ANGLE.
[debug][Application]
Parameters
{
    "_": [],
    "tray": false,
    "hide": false,
    "hidden": false,
    "max": false,
    "maximize": false,
    "maximized": false,
    "min": false,
    "minimize": false,
    "minimized": false,
    "reset-window": false,
    "versioncheck": false,
    "version-check": false,
    "logfile": true,
    "loglevel": "debug",
    "l": "debug",
    "theme": "",
    "launch": "",
    "goto": ""
}
[8275:8275:0502/115330.681026:ERROR:shared_context_state.cc(78)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;uniform float2 uAtlasSizeInv_S0;in float2 inPosition;in half4 inColor;in ushort2 inTextureCoords;noperspective out float2 vTextureCoords_S0;flat out float vTexIndex_S0;noperspective out half4 vinColor_S0;void main() {// Primitive Processor BitmapText
int texIdx = 0;float2 unormTexCoords = float2(inTextureCoords.x, inTextureCoords.y);vTextureCoords_S0 = unormTexCoords * uAtlasSizeInv_S0;vTexIndex_S0 = float(texIdx);vinColor_S0 = inColor;float2 _tmp_1_inPosition = inPosition;sk_Position = inPosition.xy01;}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform sampler2D uTextureSampler_0_S0;
noperspective in float2 vTextureCoords_S0;flat in float vTexIndex_S0;noperspective in half4 vinColor_S0;void main() {// Stage 0, BitmapText
half4 outputColor_S0;outputColor_S0 = vinColor_S0;half4 texColor;{ texColor = sample(uTextureSampler_0_S0, vTextureCoords_S0).rrrr; }half4 outputCoverage_S0 = texColor;{ // Xfer Processor: Porter Duff
sk_FragColor = outputColor_S0 * outputCoverage_S0;}}
// Vertex GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
uniform highp vec4 sk_RTAdjust;
uniform highp vec2 uAtlasSizeInv_S0;
in highp vec2 inPosition;
in mediump vec4 inColor;
in mediump uvec2 inTextureCoords;
noperspective out highp vec2 vTextureCoords_S0;
flat out highp float vTexIndex_S0;
noperspective out mediump vec4 vinColor_S0;
void main() {
    highp int texIdx = 0;
    highp vec2 unormTexCoords = vec2(float(inTextureCoords.x), float(inTextureCoords.y));
    vTextureCoords_S0 = unormTexCoords * uAtlasSizeInv_S0;
    vTexIndex_S0 = float(texIdx);
    vinColor_S0 = inColor;
    gl_Position = vec4(inPosition, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
}

// Fragment GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
out mediump vec4 sk_FragColor;
uniform sampler2D uTextureSampler_0_S0;
noperspective in highp vec2 vTextureCoords_S0;
flat in highp float vTexIndex_S0;
noperspective in mediump vec4 vinColor_S0;
void main() {
    mediump vec4 outputColor_S0 = vinColor_S0;
    mediump vec4 texColor = texture(uTextureSampler_0_S0, vTextureCoords_S0, -0.5).xxxx;
    mediump vec4 outputCoverage_S0 = texColor;
    {
        sk_FragColor = outputColor_S0 * outputCoverage_S0;
    }
}

Errors:
link failed but did not provide an info log
[8275:8275:0502/115330.682396:ERROR:shared_context_state.cc(78)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;uniform float2 uAtlasDimensionsInv_S0;in float2 inPosition;in half4 inColor;in ushort2 inTextureCoords;noperspective out half4 vinColor_S0;noperspective out float2 vTextureCoords_S0;flat out float vTexIndex_S0;noperspective out float2 vIntTextureCoords_S0;void main() {// Primitive Processor DistanceFieldA8Text
vinColor_S0 = inColor;float2 _tmp_1_inPosition = inPosition;int texIdx = 0;float2 unormTexCoords = float2(inTextureCoords.x, inTextureCoords.y);vTextureCoords_S0 = unormTexCoords * uAtlasDimensionsInv_S0;vTexIndex_S0 = float(texIdx);vIntTextureCoords_S0 = unormTexCoords;sk_Position = inPosition.xy01;}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform sampler2D uTextureSampler_0_S0;
noperspective in half4 vinColor_S0;noperspective in float2 vTextureCoords_S0;flat in float vTexIndex_S0;noperspective in float2 vIntTextureCoords_S0;void main() {// Stage 0, DistanceFieldA8Text
half4 outputColor_S0;
outputColor_S0 = vinColor_S0;float2 uv = vTextureCoords_S0;
half4 texColor;{ texColor = sample(uTextureSampler_0_S0, uv).rrrr; }half distance = 7.96875*(texColor.r - 0.50196078431);half afwidth;afwidth = abs(0.65*half(dFdx(vIntTextureCoords_S0.x)));half val = smoothstep(-afwidth, afwidth, distance);half4 outputCoverage_S0 = half4(val);{ // Xfer Processor: Porter Duff
sk_FragColor = outputColor_S0 * outputCoverage_S0;}}
// Vertex GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
uniform highp vec4 sk_RTAdjust;
uniform highp vec2 uAtlasDimensionsInv_S0;
in highp vec2 inPosition;
in mediump vec4 inColor;
in mediump uvec2 inTextureCoords;
noperspective out mediump vec4 vinColor_S0;
noperspective out highp vec2 vTextureCoords_S0;
flat out highp float vTexIndex_S0;
noperspective out highp vec2 vIntTextureCoords_S0;
void main() {
    vinColor_S0 = inColor;
    highp int texIdx = 0;
    highp vec2 unormTexCoords = vec2(float(inTextureCoords.x), float(inTextureCoords.y));
    vTextureCoords_S0 = unormTexCoords * uAtlasDimensionsInv_S0;
    vTexIndex_S0 = float(texIdx);
    vIntTextureCoords_S0 = unormTexCoords;
    gl_Position = vec4(inPosition, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
}

// Fragment GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
out mediump vec4 sk_FragColor;
uniform sampler2D uTextureSampler_0_S0;
noperspective in mediump vec4 vinColor_S0;
noperspective in highp vec2 vTextureCoords_S0;
flat in highp float vTexIndex_S0;
noperspective in highp vec2 vIntTextureCoords_S0;
void main() {
    mediump vec4 outputColor_S0 = vinColor_S0;
    highp vec2 uv = vTextureCoords_S0;
    mediump vec4 texColor = texture(uTextureSampler_0_S0, uv, -0.5).xxxx;
    mediump float _0_distance = 7.96875 * (texColor.x - 0.5019608);
    mediump float afwidth = abs(0.65 * dFdx(vIntTextureCoords_S0.x));
    mediump float val = smoothstep(-afwidth, afwidth, _0_distance);
    mediump vec4 outputCoverage_S0 = vec4(val);
    {
        sk_FragColor = outputColor_S0 * outputCoverage_S0;
    }
}
bastimeyer commented 2 months ago

I can confirm this on my main Arch system running KDE Plasma Wayland with --ozone-platform=wayland set as NW.js/Chromium launch arg. Without it, there are no issues when the app is run on XWayland.

In order to fix Chromium's skia shader compilation issues, the NW.js version needs to be bumped. NW.js unfortunately seems to have completely removed their NW1 internals which was forced here instead of using their "new" NW2 internals, because it was broken. I can't see anything in their changelogs though. The main thing that was broken was the window's blur event, which didn't always trigger, so the app couldn't refresh its contents once it re-gained focus after a while. I've reported this and other issues years ago, but there's been no activity. The whole NW.js project is pretty much dead since years, same as any other dependency which Streamlink Twitch GUI is built on, hence my lack of motivation for a long time now.

I'll have a look at bumping the used NW.js version, but this will surely result in other things breaking instead. Hopefully not...

bastimeyer commented 2 months ago

Fixed by fa0d9a6424e34217644fb5f32750ff99f94e559e (going to keep this issue open until I've published the next release)

What's broken now though is the application window's blur event, which doesn't trigger when the app loses focus for the first time. As said, this was the reason why NW1 was used. By enabling NW2 though, the app's close event now fires again on SIGTERM, meaning that the modal dialog for closing running streams can be shown again instead of simply closing the app without user confirmation.

Until the next release has been published, you can have a look at the streamlink-twitch-gui-git AUR PKGBUILD.

schmauder commented 2 months ago

Thanks a lot for the quick fix!

I can confirm that the streamlink-twitch-gui-git AUR package resolves the issue. In the first short tests i couldn't recognize problems with the modal stream dialogs.

bastimeyer commented 2 months ago

https://github.com/streamlink/streamlink-twitch-gui/releases/tag/v2.5.0