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

Black screen when viewing media fullscreen #25192

Closed
s-kk opened this issue Oct 15, 2022 · 31 comments
Closed

Black screen when viewing media fullscreen #25192

s-kk opened this issue Oct 15, 2022 · 31 comments
Labels

Comments

@s-kk
Copy link

s-kk commented Oct 15, 2022

Steps to reproduce

  1. Start Telegram desktop on Linux (4.2.4) under XWayland (i.e. without QT_QPA_PLATFORM=wayland)
  2. Open random chats and left background for a while (~15 minutes).
  3. Switch to Telegram main window and click to view some images or videos.

Expected behaviour

Image and video viewer should work properly.

Actual behaviour

The screen goes black when media viewer (both image and video viewer) is fullscreen. For image viewer, the whole display becomes black. For video viewer, only playback control is visible.

Operating system

GNOME 42.4 on Arch Linux

Version of Telegram Desktop

4.2.4

Installation source

Other (unofficial) source

Logs

No logs generated when the bug reproduced

@s-kk s-kk added the bug label Oct 15, 2022
@nbz6
Copy link

nbz6 commented Oct 15, 2022

Hi,
I had the same problem, same version (4.2.4) but I'm not using Wayland.
It was probably related to the Advanced setting "Enable OpenGL rendering for media = Enable".
If you disable this settings, the fullscreen viewing is working again for both image and video.

Update:
I was trying to downgrade to telegram-desktop package to 4.1.1 and 4.2.0 to find from which version the problem appeared.
4.1.1 and 4.2.0 was OK
And now my 4.2.4 is working again, even with the "Enable OpenGL rendering for media = Enable".
Maybe some dirty config cache to clean with a clean install ?

@ilya-fedin
Copy link
Contributor

Apparently some mesa bugs

@s-kk
Copy link
Author

s-kk commented Oct 16, 2022

It was probably related to the Advanced setting "Enable OpenGL rendering for media = Enable".

Tried disabling this option. No issue so far.

However, version 4.2.0 does not seem to have the same issue. Updating to 4.2.4 introduced the problem.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Oct 16, 2022

I see you specified Other (unofficial) source, can you check 4.2.0 and 4.2.4 from official binary?

@s-kk
Copy link
Author

s-kk commented Oct 16, 2022

I see you specified Other (unofficial) source, can you check 4.2.0 and 4.2.4 from official binary?

The binary used is compiled by Arch Linux official repository from upstream source. It should behave the same as the official binary downloaded from Telegram website.

@ilya-fedin
Copy link
Contributor

It won't behave the same due to other libraries versions and the lack of Telegram's patches for third-party libraries

@nbz6
Copy link

nbz6 commented Oct 16, 2022

While I was able to make it work again with version 4.2.4 with "Enable OpenGL rendering for media = Enable".
If I check the settings "Use system window frame" (that I used previously before my settings get reinitialize), then the black fullscreen issue is back. (if I disable this settings then reboot Telegram, the issue is gone)

OpenGL on + System frame on : black fullscreen
OpenGL on + System frame off : no issue
OpenGL off + System frame on : no issue
OpenGL off + System frame off : no issue

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Oct 16, 2022

If I check the settings "Use system window frame"

I don't believe that's the case, its value affects only the main window, media viewer doesn't even subclass from the class that provides custom decorations

@nbz6
Copy link

nbz6 commented Oct 16, 2022

The official binary from github has no issue with OpenGL on + System frame on.

@s-kk
Copy link
Author

s-kk commented Oct 16, 2022

Maybe some dirty config cache to clean with a clean install ?

From my experience, a clean install would not resolve the issue. Here's what I have done:

  1. Removed Telegram desktop package with pacman -R telegram-desktop
  2. Removed Telegram user and cache directory at ~/.local/share/TelegramDesktop
  3. Removed previously auto generated Telegram .desktop file at ~/.local/share/applications/userapp-Telegram Desktop-XXXXXX.desktop
  4. Reinstall with pacman -S telegram-desktop
  5. Run Telegram from GNOME applications
  6. The same issue comes again (a fresh install would enable Enable OpenGL rendering for media by default)

One thing worth noting is that after I perform the fresh install with steps above, Telegram desktop would launch under Wayland by default (observed by larger cursor when hovering on the window and not being able to use non-native notifications).

@ilya-fedin
Copy link
Contributor

What about checking the official binary?

@nbz6
Copy link

nbz6 commented Oct 18, 2022

I'm using this binary version for 3 days :
https://github.com/telegramdesktop/tdesktop/releases/download/v4.2.4/tsetup.4.2.4.tar.xz

Seams good at first but the black screen is here again.
If I restart Telegram, it's working again (without touching anything in settings), but I suspect that after a few hours or days the black screen could be back.
Unofficial version from Arch had the problem immediately with no delay.

I'm using HiDPI and the 200% scale settings in Telegram if this can be related.

OpenGL infos :

$ glxinfo |grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX 580 Series (polaris10, LLVM 14.0.6, DRM 3.48, 6.0.1-arch2-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.2.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.2.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.2.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

@ilya-fedin
Copy link
Contributor

Can you reproduce with 4.2.0? Because I still don't believe it's tdesktop fault, I believe it's a change in mesa, X11/Xwayland or GNOME.

@s-kk
Copy link
Author

s-kk commented Oct 19, 2022

What about checking the official binary?

Can confirm that it is reproducing on official binary version 4.2.4.

Can you reproduce with 4.2.0? Because I still don't believe it's tdesktop fault, I believe it's a change in mesa, X11/Xwayland or GNOME.

Never seen this bug happening on 4.2.0 with Arch Linux built packages (on XWayland).

@Aokromes
Copy link
Collaborator

What about checking the official binary?

Can confirm that it is reproducing on official binary version 4.2.4.

Can you reproduce with 4.2.0? Because I still don't believe it's tdesktop fault, I believe it's a change in mesa, X11/Xwayland or GNOME.

Never seen this bug happening on 4.2.0 with Arch Linux built packages (on XWayland).

can you try downloading 4.2.0 official version from releases of github and try?

@ilya-fedin
Copy link
Contributor

can you try downloading 4.2.0 official version from releases of github and try?

Yeah, that's required, if it won't be reproduced, then it's also required to check all the official binary versions between 4.2.0 and 4.2.4 (including betas) to find the exact version where it started bugging.

If it will still be reproducible, then you will need to check older versions to find the first bugged version.

@github-actions
Copy link

github-actions bot commented Nov 3, 2022

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Nov 3, 2022
@Aiku1
Copy link

Aiku1 commented Nov 5, 2022

I had the same issues for a while, I ended up shuffling around with different video drivers, various graphics (ANGLE) settings, disabling hw video decoding, even reinstalling the OS for unrelated reasons and it still happened.
This is on Windows 10 22H2, 4.2.4 tdesktop.

Disabling FreeSync from my GPU panel seems to have solved the issue, maybe it has something to do with that?

@s-kk
Copy link
Author

s-kk commented Nov 5, 2022

Disabling FreeSync from my GPU panel seems to have solved the issue, maybe it has something to do with that?

My monitor does not support FreeSync, but I indeed used an AMD RX550 GPU on a 4K display with GNOME scaling factor of 200%, not sure if this is related or not.

For the testing result of all the official binaries, I haven't got enough time to test them thoroughly. For me personally, I disabled OpenGL rendering in Telegram settings to mitigate the issue. I wish there's more people with similar specs to test it out.

@Aokromes
Copy link
Collaborator

Aokromes commented Nov 5, 2022

#25192 (comment)

@Aiku1
Copy link

Aiku1 commented Nov 5, 2022

I disabled OpenGL rendering in Telegram settings to mitigate the issue

That for only solved the issue for a few minutes at best on every OS startup, after that it acted the same.
Kind of confusing, unless there's some power saving measure taken too far that messes up something?

@Aokromes as far as I can tell it only happens in 4.2.3 and 4.2.4 for me.

@ilya-fedin
Copy link
Contributor

@Aiku1 I believe your issue is completely different given that disabling OpenGL doesn't help

@Aiku1
Copy link

Aiku1 commented Nov 5, 2022

As of right now with 4.3 it seems that even with FreeSync enabled (but hw decoding off and ANGLE on "Auto") the bug has disappeared.

@s-kk
Copy link
Author

s-kk commented Nov 6, 2022

As of right now with 4.3 it seems that even with FreeSync enabled (but hw decoding off and ANGLE on "Auto") the bug has disappeared.

The bug can still be reproduced in 4.3 built by official Arch Linux repo as of now.

@Aokromes
Copy link
Collaborator

Aokromes commented Nov 6, 2022

#25192 (comment)

@s-kk
Copy link
Author

s-kk commented Nov 7, 2022

Can you reproduce with 4.2.0? Because I still don't believe it's tdesktop fault, I believe it's a change in mesa, X11/Xwayland or GNOME.

Just downloaded and tried on official binary 4.2.0. It's been running for at least an hour and cannot reproduce yet.

Can confirm that it is reproducing on official binary version 4.2.4.

Also, I need to correct the statement. It seems that I mixed up versions at that time, which means I did not test official binary 4.2.4 yet.

@s-kk
Copy link
Author

s-kk commented Nov 8, 2022

Also, I need to correct the statement. It seems that I mixed up versions at that time, which means I did not test official binary 4.2.4 yet.

Update: just tested official binary 4.2.4, no problem so far.

@Aokromes Aokromes closed this as completed Nov 8, 2022
@s-kk
Copy link
Author

s-kk commented Nov 10, 2022

It won't behave the same due to other libraries versions and the lack of Telegram's patches for third-party libraries

I'm replying not to reopen the issue. But if possible, I would like to know more specifically about the patches that Telegram made to other libraries. The problem could be fixed on the Arch side if we know about these patches and make updates to the building process of the Arch build of tdesktop.

Thanks again for helping out!

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 10, 2022

Here are the patches: https://github.com/desktop-app/patches/tree/master/qtbase_6_4_0
I don't think any of those can fix this though. I'd rather assume there's some UB (in tdesktop/qt/gcc itself) and different compiler versions&flags produce different results. Or maybe it's because Arch's Qt is configured to link to libOpenGL + libGLX while official binary links to the legacy libGL for backward compatibility.

@s-kk
Copy link
Author

s-kk commented Nov 11, 2022

Here are the patches: https://github.com/desktop-app/patches/tree/master/qtbase_6_4_0

Thanks for the reply. However, I don't seem to see any patches being applied from the GitHub Actions workflows file. So I can't help wondering if there is any proprietary CI workflows other than this (cuz I noticed that all of Telegram pre-built release binaries are released manually by @john-preston instead of github-actions)?

Any help is appreciated.

@ilya-fedin
Copy link
Contributor

If you want to build a binary, build instructions are in the README

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants