telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.29k stars 5.22k forks source link

Hard lags while scrolling on wayland in telegram 2.2 #8347

Closed Ugzuzg closed 3 years ago

Ugzuzg commented 4 years ago

Steps to reproduce

  1. Have QT_QPA_PLATFORM=wayland env variable set
  2. Open telegram and try scrolling anything (the list of chats, messages, settings)
  3. The scrolling lags

Expected behaviour

Scrolling is smooth

Actual behaviour

Lagging No such lags with QT_QPA_PLATFORM=xcb

Configuration

Arch Linux

Version of Telegram Desktop: Telegram 2.2.0

Installation source (Linux Only) - the official website / GitHub releases / flatpak / snap / distribution package: https://www.archlinux.org/packages/community/x86_64/telegram-desktop/

Used theme:

Logs: Insert log.txt here (if necessary)
ilya-fedin commented 4 years ago

If you experience any problems with QT_QPA_PLATFORM=wayland only, it is qtwayland bugs (I don't experience any problems with scroll btw)

Ugzuzg commented 4 years ago

I don't see any of the qt libraries upgraded in the log, so it must be something in the version 2.2.0 as there was no such problem on 2.1.x. Is there a way for me to collect more information about the issue?

ilya-fedin commented 4 years ago

Is there a way for me to collect more information about the issue?

Try official binary

Ugzuzg commented 4 years ago

Same issue on the official binary. Will use xcb platform for now.

ilya-fedin commented 4 years ago

Same issue on the official binary.

I can't reproduce with weston and intel graphics. Maybe there are an issue with your compositor or video card?

pbasov commented 4 years ago

Can confirm with the official 2.2.0 binary and Fedora 32 (gnome wayland) on Intel graphics.

Scrolling in large chats has a noticeable slowdown.

ilya-fedin commented 4 years ago

Can you reproduce with KDE Wayland?

rajveermalviya commented 4 years ago

+1

can confirm scroll lagging. On Fedora 32 (gnome wayland), Intel GPU

ilya-fedin commented 4 years ago

still can't reproduce.

etircopyh commented 4 years ago

Can't reproduce it on Sway either. Tried big channels with a lot of media content, tried groups, tried settings, no difference at all.

abdulocracy commented 4 years ago

This is obviously an issue only impacting GNOME, I can also reproduce with GNOME 3.36.5 and Telegram 2.3.2. Now that with latest Xwayland the xcb platform crashes (#8506), this will be quite noticeable for any GNOME user wanting to run the app.

alosarjos commented 4 years ago

Can confirm Telegram lags when scrolling and feels more unresponsive when using QT_QPA_PLATFORM=wayland from a Gnome/Wayland session on Arch and Telegram 2.3.2

alosarjos commented 4 years ago

Doing some testing, on a group with lots of messages and pictures, if I just keep scrolling, Telegram crashes

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Using Wayland-EGL
Using the 'xdg-shell' shell integration
Telegram-Message: 14:29:00.646: You can disable tray icon counter with TDESKTOP_DISABLE_TRAY_COUNTER and make it look better if it is monochrome.
error: : cannot open
error: : cannot open
error: : cannot open
Error sending request: Tubería rota
The Wayland connection broke. Did the Wayland compositor die?
[1]    49940 abort (core dumped)  ./Telegram

The log file is full of this message repeated lots of times:

[2020.08.27 14:29:19] App Error: Unable to get last user input time from org.gnome.Mutter.IdleMonitor: org.freedesktop.DBus.Error.InvalidSignature: Unexpected reply signature: got "t" (qulonglong), expected "u" (uint)

And finally:

[2020.08.27 14:29:19] Assertion Failed! Unexpected: Qt FATAL message was generated! crash_reports.cpp:129

I'm not sure if this happens with XWayland when it was working, but I don't remember scrolling becoming so unresponsive.

PD: "Tubería rota" means "Broken pipe" in Spanish.

ilya-fedin commented 4 years ago

The log file is full of this message repeated lots of times:

Oh, that can explain lags

alosarjos commented 4 years ago

The log file is full of this message repeated lots of times:

Oh, that can explain lags

It goes up to 7-8 MB of log in a 30 seconds session (All I do is open Telegram, go to a group and start scrolling)

rajveermalviya commented 4 years ago

still experiencing this issue in latest version v2.4.0

ilya-fedin commented 4 years ago

meh

jawadalkassim commented 4 years ago

Screenshot from 2020-10-04 19-35-25 This issue is only happens when i set POP_OS Power Manager to Battery Life or Balanced but works fine when switching to High performance App was working fine before the 2.4 update in the three options

ilya-fedin commented 4 years ago

@jawadalkassim telegram in flatpak was defaulting to XWayland before 2.4

jawadalkassim commented 4 years ago

@ilya-fedin i changed telegram flatpak settings and defaulting x11 socket, solved the problem. Screenshot from 2020-10-06 12-13-30

ilya-fedin commented 4 years ago

now it's on X11?

I don't understand this question, but no one provided a log after reopening so far.

jawadalkassim commented 4 years ago

@ilya-fedin just edited my last respond,

dziaineka commented 4 years ago

I don't understand this question, but no one provided a log after reopening so far.

How can I get telegram log?

ilya-fedin commented 4 years ago

How can I get telegram log?

~/.local/share/TelegramDesktop/log.txt if you are using regular binary version

dziaineka commented 4 years ago

Fedora 32, wayland, Telegram 2.4.2, flatpak version

I've started telegram. Went to unread group chat and scrolled it forward and backward. Observed lags.

[2020.10.07 08:51:57] Launched version: 2004002, install beta: [FALSE], alpha: 0, debug mode: [FALSE]
[2020.10.07 08:51:57] Executable dir: /app/bin/, name: telegram-desktop
[2020.10.07 08:51:57] Initial working dir: /home/skaborik/
[2020.10.07 08:51:57] Working dir: /home/skaborik/.var/app/org.telegram.desktop/data/TelegramDesktop/
[2020.10.07 08:51:57] Command line: telegram-desktop --
[2020.10.07 08:51:57] Executable path before check: /app/bin/telegram-desktop
[2020.10.07 08:51:57] Logs started
[2020.10.07 08:51:57] Launcher filename: org.telegram.desktop.desktop
[2020.10.07 08:51:57] Getting DE, XDG_CURRENT_DESKTOP: 'GNOME'
[2020.10.07 08:51:57] Getting DE, DESKTOP_SESSION: 'gnome'
[2020.10.07 08:51:57] Getting DE, KDE_SESSION_VERSION: ''
[2020.10.07 08:51:57] DE: Gnome
[2020.10.07 08:51:57] Connecting local socket to /run/user/1000/app/org.telegram.desktop/a17c4c3f2b689c1125e3f47efeb46e80...
[2020.10.07 08:51:57] This is the only instance of Telegram, starting server and app...
[2020.10.07 08:51:57] Moved logging from '/home/skaborik/.var/app/org.telegram.desktop/data/TelegramDesktop/log_start0.txt' to '/home/skaborik/.var/app/org.telegram.desktop/data/TelegramDesktop/log.txt'!
[2020.10.07 08:51:57] Primary screen DPI: 96
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.10.07 08:51:57] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2020.10.07 08:51:57] App Info: reading settings...
[2020.10.07 08:51:57] App Info: reading encrypted settings...
[2020.10.07 08:51:57] Lang Info: Loaded cached, keys: 2764
[2020.10.07 08:51:57] OpenAL Logging Level: (not set)
[2020.10.07 08:51:57] Audio Playback Devices: Built-in Audio Analog Stereo
[2020.10.07 08:51:57] Audio Playback Default Device: Built-in Audio Analog Stereo
[2020.10.07 08:51:57] Audio Capture Devices: Built-in Audio Analog Stereo;Monitor of Built-in Audio Analog Stereo
[2020.10.07 08:51:57] Audio Capture Default Device: Built-in Audio Analog Stereo
[2020.10.07 08:51:57] System tray available: [TRUE]
[2020.10.07 08:51:57] Not using D-Bus global menu.
[2020.10.07 08:51:57] Not using Unity launcher counter.
[2020.10.07 08:51:57] App Info: reading accounts info...
[2020.10.07 08:51:57] App Info: reading encrypted info...
[2020.10.07 08:51:57] App Info: reading map...
[2020.10.07 08:51:57] App Info: reading encrypted map...
[2020.10.07 08:51:57] App Info: reading encrypted user settings...
[2020.10.07 08:51:57] App Info: encrypted user settings read.
[2020.10.07 08:51:57] App Info: reading encrypted mtp data...
[2020.10.07 08:51:57] MTP Info: read keys, current: 4, to destroy: 0
[2020.10.07 08:51:57] Map read time: 0
[2020.10.07 08:51:57] App Info: reading encrypted mtp config...
[2020.10.07 08:51:57] TCP Error: network - Network unreachable
[2020.10.07 08:51:57] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:51:57] Export Info: Destroy top bar by controller removal.
[2020.10.07 08:51:57] Using SNI tray icon.
[2020.10.07 08:51:58] API Warning: not loaded minimal channel applied.
[2020.10.07 08:52:07] API Warning: not loaded minimal channel applied.
[2020.10.07 08:52:10] API Error: Got empty admins list from server.
[2020.10.07 08:52:12] TCP Error: network - Network unreachable
[2020.10.07 08:52:12] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:12] TCP Error: network - Network unreachable
[2020.10.07 08:52:12] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:13] TCP Error: network - Network unreachable
[2020.10.07 08:52:13] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:13] Streaming Error: Error in avformat_open_input (code: -1094995529, text: Invalid data found when processing input).
[2020.10.07 08:52:13] TCP Error: network - Network unreachable
[2020.10.07 08:52:13] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:14] TCP Error: network - Network unreachable
[2020.10.07 08:52:14] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:16] TCP Error: network - Network unreachable
[2020.10.07 08:52:16] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:18] TCP Error: network - Network unreachable
[2020.10.07 08:52:18] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:18] TCP Error: network - Network unreachable
[2020.10.07 08:52:18] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:19] Streaming Error: Error in avformat_open_input (code: -1094995529, text: Invalid data found when processing input).
[2020.10.07 08:52:21] Streaming Error: Error in avformat_open_input (code: -1094995529, text: Invalid data found when processing input).
[2020.10.07 08:52:22] TCP Error: network - Network unreachable
[2020.10.07 08:52:22] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:32] TCP Error: network - Network unreachable
[2020.10.07 08:52:32] HTTP Error: network error 99 - Network unreachable
[2020.10.07 08:52:33] TCP Error: network - Network unreachable
[2020.10.07 08:52:33] HTTP Error: network error 99 - Network unreachable

Then i enabled proxy and did the same scrolling. Also saw lags.

[2020.10.07 08:56:39] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:39] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:40] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:40] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:40] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:40] TCP Error: network - Host unreachable
[2020.10.07 08:56:40] Config Error: Could not find Answer in dns response JSON.
[2020.10.07 08:56:44] TCP Error: network - Network unreachable
[2020.10.07 08:56:58] Config Error: Failed to parse dns response JSON, error: illegal value
[2020.10.07 08:57:08] TCP Error: error packet received, endpoint: 'cdn.iranwebhost.xyz.:443', protocolDcId: -2, code = -404
[2020.10.07 08:57:08] MTP Info: -404 error received in 170002 with temporary key, assuming it was destroyed.
[2020.10.07 08:57:09] Streaming Error: Error in avformat_open_input (code: -1, text: Operation not permitted).
[2020.10.07 08:57:09] Config Error: Failed to parse dns response JSON, error: illegal value

Thank you!

ilya-fedin commented 4 years ago

Looks like there are no spam in log anymore, but I have no idea what else can cause this :see_no_evil: I can only suggest to enable high performance as described in @jawadalkassim's post or switch to XWayland.

jawadalkassim commented 4 years ago

@ilya-fedin i don't think he has Pop_OS power manager in Fedora to switch to High Performance So @dziaineka install flatseal from Flathub and switch to Xwayland, also you can use Terminal to switch to Xwayland without installing flatseal

ilya-fedin commented 4 years ago

I have an idea. Will the lags disappear if you disable notifications?

dziaineka commented 4 years ago

@ilya-fedin I have notifications disabled. Only icon counter. Still lags.

ilya-fedin commented 4 years ago

Ok, no idea again then

rajveermalviya commented 4 years ago

the lag disappears when changing the cpu governor to performance, no idea why. default is powersave for me.

to check

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

to change to performance

$ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
ilya-fedin commented 4 years ago

Looks like the only way to find the cause of this is to bisect through version and find on which exactly version the issue appeared (this couldn't be 2.2, it has only multiple commits with cross-platform features).

intelfx commented 3 years ago

Can confirm. Scrolling regressed on GNOME/Wayland starting with 2.2.0; now (2.4.7) it works fine when on AC power (cpufreq performance, HWP performance) but not when on battery (cpufreq powersave, HWP balanced_power).

I will try to go one by one over the released versions since 2.2.0 and then bisect precisely.

rajveermalviya commented 3 years ago

another finding, lag doesn't occur when scrolling by dragging the little scrollbar, only occurs when scrolling via two-finger using touchpad.

so, it's probably something about input handling.

ilya-fedin commented 3 years ago

another finding, lag doesn't occur when scrolling by dragging the little scrollbar, only occurs when scrolling via two-finger using touchpad.

There are a lot of comments, but still no screen record of these lags

ilya-fedin commented 3 years ago

I will try to go one by one over the released versions since 2.2.0 and then bisect precisely.

Mandatory requirement is that bisecting should be done with binaries from github releases since not all releases were released to flatpak.

intelfx commented 3 years ago

another finding, lag doesn't occur when scrolling by dragging the little scrollbar, only occurs when scrolling via two-finger using touchpad.

There are a lot of comments, but still no screen record of these lags

Here you go:

This is not github binaries, though — the bulds are as found in Arch.

System configruration:

All 6 tests involved high resolution scrolling with a touchpad gesture with an approximately constant speed.

Aokromes commented 3 years ago

testing archlinux binaries is useless, they use to have bugs official releases doesn't, plz test to download from github releases.

intelfx commented 3 years ago

The official appimage blobs are broken in a slightly different way. Starting with 2.2.0 on battery power, the high resolution scrolling is initially smooth, but quickly becomes unusable.

However, this whole report is about Arch builds. It would be nice if you could provide assistance with fixing the problem as observed in Arch.

Aokromes commented 3 years ago

The official appimage blobs are broken in a slightly different way. Starting with 2.2.0 on battery power, the high resolution scrolling is initially smooth, but quickly becomes unusable.

However, this whole report is about Arch builds. It would be nice if you could provide assistance with fixing the problem as observed in Arch.

if the bug is on arch packages only you must report to arch devs.

ilya-fedin commented 3 years ago

Mandatory requirement is that bisecting should be done with binaries from github releases since not all releases were released to flatpak.

@intelfx arch maintainers don't package beta releases as well, your bisecting is almost useless since there were a lot of releases between 2.2.0 and 2.1.13 https://github.com/telegramdesktop/tdesktop/releases?after=v2.2.0

ilya-fedin commented 3 years ago

if the bug is on arch packages only you must report to arch devs.

+, @intelfx if you can't confirm the bug on official binaries, you can't report here

ilya-fedin commented 3 years ago

Can confirm. Scrolling regressed on GNOME/Wayland starting with 2.2.0; now (2.4.7) it works fine when on AC power (cpufreq performance, HWP performance) but not when on battery (cpufreq powersave, HWP balanced_power).

btw, are you sure that you're talking about cpufreq governors and not about intel-pstate ones? As far as I know, the cpufreq powersave governor always uses the minimum cpu frequency, while the cpufreq performance governor always uses the maximum cpu frequency and both of them are not for everyday use. So it is expected if you have some problems with them. For everyday use there are schedutil/ondemand/conservative governors.

intelfx commented 3 years ago

Yes, I am absolutely sure, because intel_pstate is a cpufreq driver for modern Intel CPUs. The rest is incorrect; intel_pstate implements custom powersave and performance governors, which are comparable to conservative and ondemand in the classic cpufreq frameworks. Other governors are not even available with intel_pstate.

Other than that, you are just being rude and unhelpful.

ilya-fedin commented 3 years ago

intel_pstate implements custom powersave and performance governors

That's exactly what I meant by

are you sure that you're talking about cpufreq governors and not about intel-pstate ones?

umberts commented 3 years ago

Still present on Fedora 33 running lastest Gnome 3.38 and default Wayland compositor, both in the telegram-desktop via rpmfusion (now dropped because hostility towards maintainer and I can see why) and now on the flatpak version installed via Flathub.

ilya-fedin commented 3 years ago

Still present on Fedora 33 running lastest Gnome 3.38 and default Wayland compositor, both in the telegram-desktop via rpmfusion (now dropped because hostility towards maintainer and I can see why) and now on the flatpak version installed via Flathub.

Still no one bisected at which offifcial binary beta version the issue appeared, as was requested here. This is required since package maintainers don't package beta versions and the issue couldn't be introduced at 2.2 since it's just the first stable release after a lot beta releases with a lot of changes.

ilya-fedin commented 3 years ago

now dropped because hostility towards maintainer and I can see why

If you think that impossibility to fix bug that we don't know why is happening and how to fix it is hostility then ok, we're hostile :see_no_evil:

mymedia2 commented 3 years ago

Hey, guys! We still can't reproduce the problem. Scrolling in GNOME on Wayland works just fine.

Please provide as much info as possible. Describe precisely what you are doing. Do you use a mouse wheel, or touchpad gestures, or maybe a ThinkPad trackpoint, or maybe some other pointing device? That matters. What are you scrolling? Message history of a chat, right? If the bug appears in one particular chat, give us the link to it or tell us how does it differ from others.

Is this issue reproducible in virtual machines? Or is it solely hardware-related bug? If so can you please tell us how to reproduce this in Live images of popular distros? In the case, describe your hardware. If it is in a special mode, how do we can activate the mode and check it?

Which Qt version do you use? And did you file reports in downstream bug-trackers?

rajveermalviya commented 3 years ago

another finding, lag doesn't occur when scrolling by dragging the little scrollbar, only occurs when scrolling via two-finger using touchpad.

so, it's probably something about input handling.

https://github.com/telegramdesktop/tdesktop/issues/8347#issuecomment-731143125

And did you file reports in downstream bug-trackers?

No, because other qt apps like qbittorrent doesn't have this issue

Also lag only occurs when window is focused .