Tdesktop: aarch64 and armhf version of telegram-desktop crash on attempt to render animated sticker

Created on 5 Oct 2019  路  149Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Install aarch64 version ob Ubuntu 19.10 (on devboard, laptop or qemu virtual machine)
  2. Install telegram-desktop from system repository
  3. Try to send any animated sticker

Expected behaviour

Telegram doesn't crash on attempt to render sticker animation

Actual behaviour

Telegram crash on attempt to render sticker animation

Configuration

Operating system: Ubuntu 19.10
Version of Telegram Desktop: 1.8.8
Used theme: dark theme

gdb.log

bug

Most helpful comment

I found ~4 years old posts in google that disabling neon optimizations helps with this issue. Would be awesome if someone try to compile telegram with --disable-neon added to ffmpeg configargs

Try it here : sudo snap install alish-tdesktop --edge
use command alish-tdesktop.telegram-desktop to run

Videos - gifs - animated stickers...
Everything video related works now
I only added --disable-neon

Edit:
@ilya-fedin please make a PR.I don't know how to use --disable-neon only for arm64 and armhf.

All 149 comments

can you try on some build never than 1.8.8?

can you try on some build never than 1.8.8?

it does not work in 1.8.12 (or was it .13(?)). I wasn't able to test any other versions yet. And there was afaik no commit after 1.8.8. that would have touched anything of the related code

https://github.com/telegramdesktop/tdesktop/blob/1d8d2b6251ad69497be8157cd6f101c4dd98e7a2/Telegram/SourceFiles/lottie/lottie_cache.cpp#L142-L152

Still not working with 1.8.15 FWIW.

Crash also reproducible on armhf architecture, tested on Asus Flipbook C100P (RK3288) with Debian 10 and Linux 5.4.8.

try 1.9.8 plz.

The update tends to make the crashing more immediate for me. While before animated stickers would usually play almost a whole loop and sometimes even longer in the smaller preview versions when selecting a sticker, with the update it more commolny directly crashes with the animated sticker not even being fully loaded.

I also tried with a from-scratch setup, same result. Only console output I get is [swscaler @ 0xffff8cf63430] No accelerated colorspace conversion found from yuv420p to bgra.

can you run telegram with gdb or valgrind to get a crash and post result here?

Now https://snapcraft.io/telegram-desktop has armhf and arm64 builds. Please check if they're OK.

Nope, still crashing. (Flatpak, Snap, etc...)

--edge version still crashing 1.9.9-8-g68027fd23

Nope, still crashing. (Flatpak, Snap, etc...)

--edge version still crashing 1.9.9-8-g68027fd23

can you run telegram with gdb or valgrind to get a crash and post result here?

@Aokromes will try to use gdb and bring some logs.

@Aokromes - sorry, failed in usage of gdb, but found snap logs:

[2020.02.05 20:52:33] Launched version: 1009009, install beta: [FALSE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.02.05 20:52:33] Executable dir: /snap/telegram-desktop/1079/bin/, name: telegram-desktop
[2020.02.05 20:52:33] Initial working dir: /home/pi/
[2020.02.05 20:52:33] Working dir: /home/pi/snap/telegram-desktop/1079/.local/share/TelegramDesktop/
[2020.02.05 20:52:33] Command line: telegram-desktop --
[2020.02.05 20:52:32] Executable path before check: /snap/telegram-desktop/1079/bin/telegram-desktop
[2020.02.05 20:52:32] SNAP Environment detected, launcher filename is telegram-desktop_telegramdesktop.desktop
[2020.02.05 20:52:33] Logs started
[2020.02.05 20:52:35] Connecting local socket to /run/user/1000/snap.telegram-desktop/8f182ce9355a343ef741bbeafd33134c...
[2020.02.05 20:52:35] This is the only instance of Telegram, starting server and app...
[2020.02.05 20:52:35] Moved logging from '/home/pi/snap/telegram-desktop/1079/.local/share/TelegramDesktop/log_start0.txt' to '/home/pi/snap/telegram-desktop/1079/.local/share/TelegramDesktop/log.txt'!
[2020.02.05 20:52:35] Primary screen DPI: 96.1263
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansBold.ttf' loaded 'DAOpenSansBold'
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansBoldItalic.ttf' loaded 'DAOpenSansBoldItalic'
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansSemibold.ttf' loaded 'DAOpenSansSemibold'
[2020.02.05 20:52:38] Font: from ':/gui/fonts/DAOpenSansSemiboldItalic.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.02.05 20:52:38] Error: failed to load 'gdk_x11_drawable_get_xdisplay' function!
[2020.02.05 20:52:38] Getting DE, XDG_CURRENT_DESKTOP: 'XFCE'
[2020.02.05 20:52:38] Getting DE, DESKTOP_SESSION: 'lightdm-xsession'
[2020.02.05 20:52:38] Getting DE, KDE_SESSION_VERSION: ''
[2020.02.05 20:52:38] Getting DE, GNOME_DESKTOP_SESSION_ID: ''
[2020.02.05 20:52:38] Getting DE, KDE_FULL_SESSION: ''
[2020.02.05 20:52:38] DE: Other
[2020.02.05 20:52:38] Tray Icon: Try Qt = [TRUE], Prefer appindicator = [FALSE]
[2020.02.05 20:52:39] App Info: reading settings...
[2020.02.05 20:52:39] App Info: reading encrypted settings...
[2020.02.05 20:52:39] Lang Info: Loaded cached, keys: 2579
[2020.02.05 20:52:40] OpenAL Logging Level: (not set)
[2020.02.05 20:52:40] Audio Playback Devices: OpenAL Soft
[2020.02.05 20:52:40] Audio Playback Default Device: OpenAL Soft
[2020.02.05 20:52:40] Audio Capture Devices: Monitor of Built-in Audio Analog Mono
[2020.02.05 20:52:40] Audio Capture Default Device: Monitor of Built-in Audio Analog Mono
[2020.02.05 20:52:42] App Info: reading map...
[2020.02.05 20:52:42] App Info: reading encrypted map...
[2020.02.05 20:52:42] App Info: reading encrypted user settings...
[2020.02.05 20:52:42] App Info: encrypted user settings read.
[2020.02.05 20:52:42] App Info: reading encrypted mtp data...
[2020.02.05 20:52:42] MTP Info: read keys, current: 3, to destroy: 0
[2020.02.05 20:52:42] Map read time: 64
[2020.02.05 20:52:43] TCP Error: other (-1) - Unknown error
[2020.02.05 20:52:43] HTTP Error: network error 99 - Unknown error
[2020.02.05 20:52:43] Export Info: Destroy top bar by controller removal.
[2020.02.05 20:52:43] Using Qt tray icon.
[2020.02.05 20:52:43] Tray Icon: Using Qt tray icon, available: [TRUE]
[2020.02.05 20:52:44] Not using Unity Launcher count.
[2020.02.05 20:52:48] TCP Error: other (-1) - Unknown error
[2020.02.05 20:52:48] HTTP Error: network error 99 - Unknown error
[2020.02.05 20:52:49] TCP Error: other (-1) - Unknown error
[2020.02.05 20:52:49] HTTP Error: network error 99 - Unknown error
[2020.02.05 20:53:07] TCP Error: other (-1) - Unknown error
[2020.02.05 20:53:07] HTTP Error: network error 99 - Unknown error
[2020.02.05 20:53:58] Audio Info: recreating audio device and reattaching the tracks
[2020.02.05 20:54:02] Assertion Failed! "lines == to.height()" lottie_cache.cpp:150

I hope I got gdb to work right, but here are some logs from version 1.8.15
tgdesktop 1.8.15-2~bpo10+1.log from Debian buster-backports repo
and from version 1.19.14 tg desktop 1.9.14+ds-1.log from Debian Bullseye repo.
As said, app crashes when attempting to render an animated sticker.

BTW: why not temporarily disable animation for ARM-builds?

BTW: why not temporarily disable animation for ARM-builds?

Because arm is not officially supported and preston doesn't want to spend time on this :(
Although, I have a PR that might fix that. If someone test it - I think, preston accept it.

I can test if somebody builds a binary

BTW, i've got a backtrace from gdb

Thread 21 "Thread (pooled)" received signal SIGABRT, Aborted.
[Switching to Thread 0xa9984eb0 (LWP 4515)]
__libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
47  ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: 袧械褌 褌邪泻芯谐芯 褎邪泄谢邪 懈谢懈 泻邪褌邪谢芯谐邪.
(gdb) bt
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
#1  0xb453bdba in __libc_signal_restore_set (set=0xa99843f4) at ../sysdeps/unix/sysv/linux/internal-signals.h:84
#2  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:48
#3  0xb452c7f2 in __GI_abort () at abort.c:79
#4  0x005c0586 in base::assertion::fail(char const*, char const*, int) ()
    at ./Telegram/lib_base/base/assertion.h:34
#5  0x0133f54e in DecodeYUV2RGB () at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:150
#6  Decode () at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:185
#7  Lottie::Cache::renderFrame(QImage&, Lottie::FrameRequest const&, int) ()
    at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:491
#8  Lottie::Cache::renderFrame(QImage&, Lottie::FrameRequest const&, int) ()
    at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:462
#9  0x0133f6c4 in Lottie::Cache::readHeader(Lottie::FrameRequest const&) ()
    at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:455
#10 0x0133f7b6 in Lottie::Cache::Cache(QByteArray const&, Lottie::FrameRequest const&, base::unique_function<void (QByteArray&&)>) () at ./Telegram/lib_lottie/lottie/lottie_cache.cpp:377
#11 0x013319d4 in std::make_unique<Lottie::Cache, QByteArray const&, Lottie::FrameRequest const&, base::unique_function<void (QByteArray&&)> >(QByteArray const&, Lottie::FrameRequest const&, base::unique_function<void (QByteArray&&)>&&) () at /usr/include/c++/9/bits/unique_ptr.h:857
#12 Init () at ./Telegram/lib_lottie/lottie/lottie_animation.cpp:111
#13 operator() () at ./Telegram/lib_lottie/lottie/lottie_animation.cpp:208
#14 run() () at ./Telegram/lib_crl/crl/qt/crl_qt_async.h:28
#15 0xb4b790d0 in  () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#16 0xb4b76818 in  () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#17 0xb6de7d3e in start_thread (arg=0xab8d9a34) at pthread_create.c:479
#18 0xb45b220c in  () at ../sysdeps/unix/sysv/linux/arm/clone.S:73
(gdb) 

telegram-desktop-1.9.14 from Ubuntu 20.04

BTW: why not temporarily disable animation for ARM-builds?

Because arm is not officially supported and preston doesn't want to spend time on this :(
Although, I have a PR that might fix that. If someone test it - I think, preston accept it.

Just checked this patch - now it works!
Telegram does not crashes with animated stickers.

That seems to point at https://github.com/desktop-app/lib_lottie/blob/master/lottie/lottie_cache.cpp#L150 in that case

sws_scale doesn't seem to work on arm.
I.e. even after that you will not be able to watch videos, gifs and etc.

I upgraded ffmpeg to 4.x in snap. I hope, when PR will be accepted and snap edge channel will build this commit, the situation might be changed :thinking:

Okay, it is built. Can anyone test package on the edge channel?

Tried snaps on arch, could not get the telegram started, not even from stable channel. So to anyone with Ubuntu, getting it from the edge channel is as simple as:

snap remove telegram-desktop # if you installed it with snap
snap install telegram-desktop --edge
snap run telegram-desktop

# if you installed it with snap

There are snap refresh --edge telegram-desktop

could not get the telegram started

Can you send telegram output and log (~/snap/telegram-desktop/current/.local/share/TelegramDesktop/log.txt)?

Tried snaps on arch, could not get the telegram started, not even from stable channel. So to anyone with Ubuntu, getting it from the edge channel is as simple as:

snap remove telegram-desktop # if you installed it with snap
snap install telegram-desktop --edge
snap run telegram-desktop

Just tested snap build - crashes

:(

That was expectable because https://github.com/desktop-app/cmake_helpers/pull/19 seems not merged

As I said before - manually build with this patch works fine

That was expectable because desktop-app/cmake_helpers#19 seems not merged

I was hoping that sws_scale would work with ffmpeg 4 and this would not be necessary

@john-preston Please accept https://github.com/desktop-app/cmake_helpers/pull/19 because this fixes the bug

That was expectable because desktop-app/cmake_helpers#19 seems not merged

I was hoping that sws_scale would work with ffmpeg 4 and this would not be necessary

BTW, video playing still not fixed. I.e. telegram can't play videos from https://t.me/per_i_ozv

BTW, video playing still not fixed. I.e. telegram can't play videos from

https://github.com/telegramdesktop/tdesktop/issues/6647#issuecomment-596301377

Can you send telegram output and log (~/snap/telegram-desktop/current/.local/share/TelegramDesktop/log.txt)?

I found that my issue is the same as #7144

I found that my issue is the same as #7144

sudo fc-cache -r :)

I installed patched ubuntu-fontconfig and now the snap works.

Animated stickers still crash it though. Here is the log.

[2020.03.09 20:36:22] Launched version: 1009019, install beta: [TRUE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.09 20:36:22] Executable dir: /snap/telegram-desktop/1286/bin/, name: telegram-desktop
[2020.03.09 20:36:22] Initial working dir: /home/p3732/
[2020.03.09 20:36:22] Working dir: /home/p3732/snap/telegram-desktop/1286/.local/share/TelegramDesktop/
[2020.03.09 20:36:22] Command line: telegram-desktop
[2020.03.09 20:36:22] Executable path before check: /snap/telegram-desktop/1286/bin/telegram-desktop
[2020.03.09 20:36:22] Logs started
[2020.03.09 20:36:22] Launcher filename: telegram-desktop_telegram-desktop.desktop
[2020.03.09 20:36:22] Connecting local socket to /run/user/1000/snap.telegram-desktop/93563a13c754a95e6ecbadd9249819ec...
[2020.03.09 20:36:22] Socket connect error 0, starting server and app...
[2020.03.09 20:36:22] Moved logging from '/home/p3732/snap/telegram-desktop/1286/.local/share/TelegramDesktop/log_start0.txt' to '/home/p3732/snap/telegram-desktop/1286/.local/share/TelegramDesktop/log.txt'!
[2020.03.09 20:36:22] Primary screen DPI: 96
[2020.03.09 20:36:22] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2020.03.09 20:36:22] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2020.03.09 20:36:23] Font: from ':/gui/fonts/DAOpenSansBold.ttf' loaded 'DAOpenSansBold'
[2020.03.09 20:36:23] Font: from ':/gui/fonts/DAOpenSansBoldItalic.ttf' loaded 'DAOpenSansBoldItalic'
[2020.03.09 20:36:23] Font: from ':/gui/fonts/DAOpenSansSemibold.ttf' loaded 'DAOpenSansSemibold'
[2020.03.09 20:36:23] Font: from ':/gui/fonts/DAOpenSansSemiboldItalic.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.03.09 20:36:23] App Info: reading settings...
[2020.03.09 20:36:23] App Info: reading encrypted settings...
[2020.03.09 20:36:23] Lang Info: Loaded cached, keys: 2581
[2020.03.09 20:36:23] OpenAL Logging Level: (not set)
[2020.03.09 20:36:23] Audio Playback Devices: OpenAL Soft
[2020.03.09 20:36:23] Audio Playback Default Device: OpenAL Soft
[2020.03.09 20:36:23] Audio Capture Devices: Built-in Audio Stereo;Monitor of Built-in Audio Stereo
[2020.03.09 20:36:23] Audio Capture Default Device: Built-in Audio Stereo
[2020.03.09 20:36:24] System tray available: [FALSE]
[2020.03.09 20:36:24] Using Unity launcher counter.
[2020.03.09 20:36:24] App Info: reading map...
[2020.03.09 20:36:24] App Info: reading encrypted map...
[2020.03.09 20:36:24] App Info: reading encrypted user settings...
[2020.03.09 20:36:24] App Info: encrypted user settings read.
[2020.03.09 20:36:24] App Info: reading encrypted mtp data...
[2020.03.09 20:36:24] MTP Info: read keys, current: 3, to destroy: 0
[2020.03.09 20:36:24] Map read time: 34
[2020.03.09 20:36:24] Export Info: Destroy top bar by controller removal.
[2020.03.09 20:36:30] Assertion Failed! "lines == to.height()" lottie_cache.cpp:150

And here is a backtrace

#0  0x0000ffff8c6974d8 in raise () from target:/lib/aarch64-linux-gnu/libc.so.6
#1  0x0000ffff8c6988b4 in abort () from target:/lib/aarch64-linux-gnu/libc.so.6
#2  0x0000aaaad733d678 in base::assertion::fail(char const*, char const*, int) ()
#3  0x0000aaaad85089c0 in Lottie::Cache::renderFrame(QImage&, Lottie::FrameRequest const&, int) [clone .part.34] ()
#4  0x0000aaaad84f5504 in Lottie::SharedState::renderFrame(QImage&, Lottie::FrameRequest const&, int) ()
#5  0x0000aaaad84f58d0 in Lottie::SharedState::renderNextFrame(gsl::not_null<Lottie::Frame*>, Lottie::FrameRequest const&) ()
#6  0x0000aaaad84f609c in Lottie::SharedState::renderNextFrame(Lottie::FrameRequest const&) ()
#7  0x0000aaaad84f7c70 in Lottie::FrameRendererObject::generateFrames() ()
#8  0x0000aaaad84f8104 in crl::details::list::Entry<crl::details::object_on_queue_data<Lottie::FrameRendererObject>::async<crl::details::object_on_queue_data<Lottie::FrameRendererObject>::with<Lottie::FrameRendererObject::queueGenerateFrames()::{lambda(Lottie::FrameRendererObject&)#1}>(Lottie::FrameRendererObject::queueGenerateFrames()::{lambda(Lottie::FrameRendererObject&)#1}&&)::{lambda()#1}>(crl::details::object_on_queue_data<Lottie::FrameRendererObject>::with<Lottie::FrameRendererObject::queueGenerateFrames()::{lambda(Lottie::FrameRendererObject&)#1}>(Lottie::FrameRendererObject::queueGenerateFrames()::{lambda(Lottie::FrameRendererObject&)#1}&&)::{lambda()#1}) const::{lambda()#1}>::Process(crl::details::list::BasicEntry*) ()
#9  0x0000aaaad83800f4 in crl::details::list::process() ()
#10 0x0000aaaad83803d4 in crl::queue::process() ()
#11 0x0000ffff8cdab990 in ?? () from target:/snap/telegram-desktop/1286/usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#12 0x0000ffff8cdaea60 in ?? () from target:/snap/telegram-desktop/1286/usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#13 0x0000ffff8c97c088 in start_thread () from target:/lib/aarch64-linux-gnu/libpthread.so.0
#14 0x0000ffff8c7354ec in ?? () from target:/lib/aarch64-linux-gnu/libc.so.6

Okay, it is built. Can anyone test package on the edge channel?

I will test it in few hours.

I found ~4 years old posts in google that disabling neon optimizations helps with this issue. Would be awesome if someone try to compile telegram with --disable-neon added to ffmpeg configargs

Animated stickers still crash it though. Here is the log.

Same happens to me version 1.9.19-beta-20-gb66acdd0d

@ilya-fedin can you give me instructions to compile telegram?I tried to compile with snapcraft and it needs multipass which I can't use on rpi

logs:

[2020.03.10 07:39:43] Launched version: 1009019, install beta: [TRUE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.10 07:39:43] Executable dir: /snap/telegram-desktop/1287/bin/, name: telegram-desktop
[2020.03.10 07:39:43] Initial working dir: /home/pi/
[2020.03.10 07:39:43] Working dir: /home/pi/snap/telegram-desktop/1287/.local/share/TelegramDesktop/
[2020.03.10 07:39:43] Command line: telegram-desktop
[2020.03.10 07:39:43] Executable path before check: /snap/telegram-desktop/1287/bin/telegram-desktop
[2020.03.10 07:39:43] Logs started
[2020.03.10 07:39:43] Launcher filename: telegram-desktop_telegram-desktop.desktop
[2020.03.10 07:39:47] Connecting local socket to /run/user/1000/snap.telegram-desktop/8a42708206e3a08a25c9b74042bd2fae...
[2020.03.10 07:39:47] Socket connect error 0, starting server and app...
[2020.03.10 07:39:47] Moved logging from '/home/pi/snap/telegram-desktop/1287/.local/share/TelegramDesktop/log_start0.txt' to '/home/pi/snap/telegram-desktop/1287/.local/share/TelegramDesktop/log.txt'!
[2020.03.10 07:39:47] Primary screen DPI: 95.941
[2020.03.10 07:39:49] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2020.03.10 07:39:49] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2020.03.10 07:39:49] Font: from ':/gui/fonts/DAOpenSansBold.ttf' loaded 'DAOpenSansBold'
[2020.03.10 07:39:49] Font: from ':/gui/fonts/DAOpenSansBoldItalic.ttf' loaded 'DAOpenSansBoldItalic'
[2020.03.10 07:39:49] Font: from ':/gui/fonts/DAOpenSansSemibold.ttf' loaded 'DAOpenSansSemibold'
[2020.03.10 07:39:50] Font: from ':/gui/fonts/DAOpenSansSemiboldItalic.ttf' loaded 'DAOpenSansSemiboldItalic'
[2020.03.10 07:39:50] App Info: reading settings...
[2020.03.10 07:39:50] App Info: reading encrypted settings...
[2020.03.10 07:39:50] Lang Info: Loaded cached, keys: 2581
[2020.03.10 07:39:51] OpenAL Logging Level: (not set)
[2020.03.10 07:39:51] Audio Playback Devices: OpenAL Soft
[2020.03.10 07:39:51] Audio Playback Default Device: OpenAL Soft
[2020.03.10 07:39:52] Audio Capture Devices: ALSA Default
[2020.03.10 07:39:52] Audio Capture Default Device: ALSA Default
[2020.03.10 07:39:52] Audio Error: Could not open capture device!
[2020.03.10 07:39:54] System tray available: [TRUE]
[2020.03.10 07:39:54] Not using Unity launcher counter.
[2020.03.10 07:39:54] App Info: reading map...
[2020.03.10 07:39:54] App Info: reading encrypted map...
[2020.03.10 07:39:54] App Info: reading encrypted user settings...
[2020.03.10 07:39:54] App Info: encrypted user settings read.
[2020.03.10 07:39:54] App Info: reading encrypted mtp data...
[2020.03.10 07:39:54] MTP Info: read keys, current: 4, to destroy: 0
[2020.03.10 07:39:54] Map read time: 63
[2020.03.10 07:39:55] Export Info: Destroy top bar by controller removal.
[2020.03.10 07:39:55] Using Qt tray icon.
[2020.03.10 07:40:00] Assertion Failed! "lines == to.height()" lottie_cache.cpp:150

can you give me instructions to compile telegram?I tried to compile with snapcraft and it needs multipass which I can't use on rpi

It can work through docker and lxc also. Also, there are a --destructive-mode flag that allows running on host (but you can't use snapcraft on non-ubuntu)

It can work through docker and lxc also. Also, there are a --destructive-mode flag that allows running on host (but you can't use snapcraft on non-ubuntu)

How can I cross compile for armhf only in an amd64 platform?

How can I cross compile for armhf only in an amd64 platform?

Good question

comment if you know anything but i guess I found it:
snapcraft build --help has an option named --target-arch <arch> which says:Target architecture to cross compile to

I have no idea what kind of file it builds to and how I'm supposed to move build binary to my rpi.
I have to setup a new VM(download ubuntu, update it.clone git and ....) so it may take some time but I'm going to start now

1.multipass sucks.i tried over 10 timed and it timeouts randomly.i used LXD container
2.i built telegram for armhf but when running i get exec format error.looks like snap builds something for amd64 instead

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/snap/telegram-desktop/x2/bin/desktop-launch: line 10: /snap/telegram-desktop/x2/usr/bin/update-mime-database: cannot execute binary file: Exec format error
ERROR: update-mime-database /home/pi/snap/telegram-desktop/x2/.local/share/mime exited abnormally with status 126
/snap/telegram-desktop/x2/bin/desktop-launch: line 597: /snap/telegram-desktop/x2/bin/telegram-desktop: cannot execute binary file: Exec format error
/snap/telegram-desktop/x2/bin/desktop-launch: line 597: /snap/telegram-desktop/x2/bin/telegram-desktop: Success

output of sudo snapcraft --target-arch=armhf --debug --destructive-mode:

Setting target machine to 'armhf' The plugin used by 'telegram' does not support cross-compiling to a different target architecture.

I'm going to try build.snapcraft.io see it I can get a successful build there

I found ~4 years old posts in google that disabling neon optimizations helps with this issue. Would be awesome if someone try to compile telegram with --disable-neon added to ffmpeg configargs

Try it here : sudo snap install alish-tdesktop --edge
use command alish-tdesktop.telegram-desktop to run

Videos - gifs - animated stickers...
Everything video related works now
I only added --disable-neon

Edit:
@ilya-fedin please make a PR.I don't know how to use --disable-neon only for arm64 and armhf.

@AliDjango Wow, thanks.

please make a PR.I don't know how to use --disable-neon only for arm64 and armhf.

This flag shouldn't do anything on other arches, since neon is arm-specific

Try it here : sudo snap install alish-tdesktop --edge
use command alish-tdesktop.telegram-desktop to run

Videos - gifs - animated stickers...
Everything video related works now
I only added --disable-neon

So PR https://github.com/desktop-app/cmake_helpers/pull/19 is not needed any more ?

So PR desktop-app/cmake_helpers#19 is not needed any more ?

+

@industrium Install my snap and check if it works for you.
arm64 doesn't build in snapcraft.io(launchpad) though. here is the log.
arm64.log
@ilya-fedin can you check this? snap package built successfully in PR though

without neon optimizations sticker preview panel uses 80 percent cpu and is a little laggy at first though :(

here is the log.

Meh. Looks like aarch64 version doesn't have non-neon _idctdsp_ (I have no idea what it is)
https://github.com/FFmpeg/FFmpeg/blob/release/4.2/libavcodec/arm/Makefile#L20
https://github.com/FFmpeg/FFmpeg/blob/release/4.2/libavcodec/aarch64/Makefile#L44

without neon optimizations sticker preview panel uses 80 percent cpu and is a little laggy at first though :(

At first though rlottie should parse stickers, then ffmpeg-based cache comes into play. I.e. if you have lags only at first though, it is rlottie rather than ffmpeg.

You can also build with -DDESKTOP_APP_LOTTIE_USE_CACHE=OFF and compare.

Just filled a bug report to ffmpeg: https://trac.ffmpeg.org/ticket/8565#ticket

You can also build with -DDESKTOP_APP_LOTTIE_USE_CACHE=OFF and compare.

i'll try it

At first though rlottie should parse stickers, then ffmpeg-based cache comes into play. I.e. if you have lags only at first though, it is rlottie rather than ffmpeg.

i can't reproduce it again i guess it cached now.i don't think it's a big problem since raspberry pi is weak though and AFAIK these are mp4 h264 stickers maybe?it takes a split second to load, and they start playing

i can't reproduce it again i guess it cached now.

~It is RAM-only and resets when tdesktop is closed~
UPD: no

It is RAM-only and resets when tdesktop is closed

When loading for the first time, for a split second it gets laggy or doesn't start playing(im not sure about this) and then plays smoothly.
im going to try turning lottie off though and compare them.

@industrium Install my snap and check if it works for you.

Already tested: everything works.

Maybe --disable-dct ffmpeg config flag can fix the build on aarch64, but I don't know what it can affect

I'm waiting for armhf and arm64 builds in launchpad.i'll test this afterward.
it takes around another hour to finish
what is this config flag?

You can also build with -DDESKTOP_APP_LOTTIE_USE_CACHE=OFF and compare.

@ilya-fedin amd64.log
what's this time? this one happened in amd64

what is this config flag?

configure script describes it as disable DCT code
idctdsp

what's this time?

cmake failed to build :thinking:
Have you definitely added the flag to the configflags of the telegram part, not cmake?

@ilya-fedin yes
i386 built successfully
ill rebuild it again maybe just a bug with cmake.because error says compiler internal error

i386 built successfully

Maybe some random fail, as on github :)

@ilya-fedin does telegram even run on ppc64el?
maybe we can add architecture to snapcraft.yaml so launchpad doesnt waste time on s390x arch that is not even supported?

architectures:
  - build-on: [<build arch 1>, <build arch 2>]
    run-on: [<run arch 1>, <run arch 2>]

more info just in case you wanted to read more : https://snapcraft.io/docs/architectures

does telegram even run on ppc64el?

As far as I know, yes

s390x arch that is not even supported?

yes, big-endians doesn't work

maybe we can add architecture to snapcraft.yaml

Would be good

You can also build with -DDESKTOP_APP_LOTTIE_USE_CACHE=OFF and compare.

Does this affect video playback?because videos play like frame by frame.its soo laggy

You can also build with -DDESKTOP_APP_LOTTIE_USE_CACHE=OFF and compare.

Does this affect video playback?because videos play like frame by frame.its soo laggy

No, only stickers.

Maybe these ffmpeg config flags will help:

--enable-mmal
--enable-omx
--enable-omx-rpi

@industrium can you update your snap package?
sudo refresh alish-tdesktop --edge?
it comes with rlottie disabled.
for me stickers are like before.i can't feel any difference
EDIT:
sticker panel feels so slow now.i guess we should leave rlottie on

does telegram even run on ppc64el?

As far as I know, yes

Can confirm, it runs fine on ppc64le

https://github.com/AliDjango/tdesktop/runs/500131035

I don''t know what is needed for mmal, but for omx libomxil-bellagio-dev is needed in build -packages and libomxil-bellagio0 is needed in stage-packages

mmal files are in raspberrypi/userland github repository so for mmal we should do this.where should i add these lines?

git clone --depth=1 https://github.com/raspberrypi/firmware mmalheaders
git clone --depth=1 https://github.com/raspberrypi/userland piuserland
cp -a mmalheaders/opt/vc/include/* /usr/include/
cp -a mmalheaders/opt/vc/lib/* /usr/lib/
cp -a piuserland/interface/* /usr/include/

You should create a separate part mmal and make it a dependecy of ffmpeg part with after
But, I think, the first thing is to check if aarch64 will work with --disable-dct, after that you can try to compile with omx and only after that experimenting with mmal.

of course but i don't have aarch64 to test it.we may need someone with rpi 3/4(or other 64bit devices) with 64bit os to check if it has any kind of side effects

we may need someone with rpi 3 or 4 with 64bit os to check if it has any kind of side effects

I.e. you want to say it is successfully built?

I mean if it builds successfully we must check if it actually works and doesn't crash.

I mean if it builds successfully we must check if it actually works and doesn't crash.

Anyway, we should try to build it, because it is unknown if it will build or not. After that, we can think about testing.

I mean if it builds successfully we must check if it actually works and doesn't crash.

I am here if you need to test. Although I can't guarantee that errors with graphics libraries won't stem from the graphics driver not working (it's a PinebookPro for which the firmware drivers are only semi-stable).

Just filled a bug report to ffmpeg: https://trac.ffmpeg.org/ticket/8565#ticket

They fixed it! 馃コ

that was fast.

that was fast lol.
I'll try PR#7355 again to check if it works.

Don't forget that these changes will not appear on their own in version 4.2 and that they must be backported (or wait for a new version).

@industrium can you update your snap package?
sudo refresh alish-tdesktop --edge?
it comes with rlottie disabled.
for me stickers are like before.i can't feel any difference
EDIT:
sticker panel feels so slow now.i guess we should leave rlottie on

What the goal is to install build w/o rlottie?

What the goal is to install build w/o rlottie?

Good question.
Just wanted to see how difference the performance is.
stickers felt a little laggy at first and just wanted to check if rlottie is the culprit.
it's ok now.you don't need to test if you don't want to.performance is not good without rlottie.
edge package is replaced though so ...

Don't forget that these changes will not appear on their own in version 4.2 and that they must be backported (or wait for a new version).

latest build

i used master branch instead of 4.2 and everything build successfully including arm64.now its up to you to decide what to do.we can wait until 4,3 comes out or make our own fork of 4.2 with arm64 fix.

I'm trying to backport changes

built successfully

I am here if you need to test.

@p3732 can you test @AliDjango's aarch64 build?
snap install --edge alish-tdesktop

If anyone else want to test aarch64 build - you're welcome

@p3732 can you test @AliDjango's aarch64 build?
snap install --edge alish-tdesktop

Don't actually have the device with me, gonna do it tomorrow evening (Europe).

Tried testing but again ran into #7144. Tried everything, but this time not even installing the ubuntu-patched fontconfig helped. I guess this way I am of no use to the sticker testing...

@AliDjango can you remove -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF and add fonts-open-sans to stage-packages?

Ok :)

sure.i'll tell you when it's ready

Is it still building?

@ilya-fedin it is ready nearly 3 hours from when i start building.
we're having internet problem in my country and my internet barely works
it's ready though(finished building 7 hours ago)

Tried the refreshed version, running into the same errors as before, both for ubuntu-patched normal Arch fontconfig (and yes, I ran sudo fc-cache -r in between). Can anyone test on Ubuntu?

Tried the refreshed version, running into the same errors as before

Can you send log.txt from new version?

[2020.03.14 19:48:41] Launched version: 1009020, install beta: [TRUE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.14 19:48:41] Executable dir: /snap/alish-tdesktop/38/bin/, name: telegram-desktop
[2020.03.14 19:48:41] Initial working dir: /home/p3732/
[2020.03.14 19:48:41] Working dir: /home/p3732/snap/alish-tdesktop/38/.local/share/TelegramDesktop/
[2020.03.14 19:48:41] Command line: telegram-desktop
[2020.03.14 19:48:41] Executable path before check: /snap/alish-tdesktop/38/bin/telegram-desktop
[2020.03.14 19:48:41] Logs started
[2020.03.14 19:48:41] Launcher filename: alish-tdesktop_telegram-desktop.desktop
[2020.03.14 19:48:43] Connecting local socket to /run/user/1000/snap.alish-tdesktop/6796fcfc6b3ee98e0abab1c4f63bca00...
[2020.03.14 19:48:43] This is the only instance of Telegram, starting server and app...
[2020.03.14 19:48:43] Moved logging from '/home/p3732/snap/alish-tdesktop/38/.local/share/TelegramDesktop/log_start0.txt' to '/home/p3732/snap/alish-tdesktop/38/.local/share/TelegramDesktop/log.txt'!
[2020.03.14 19:48:43] Primary screen DPI: 95.958

That was the one with non-patched fontconfig, gonna get the other one too.

[2020.03.14 20:12:03] Launched version: 1009020, install beta: [TRUE], alpha: 0, debug mode: [FALSE], test dc: [FALSE]
[2020.03.14 20:12:03] Executable dir: /snap/alish-tdesktop/38/bin/, name: telegram-desktop
[2020.03.14 20:12:03] Initial working dir: /home/p3732/
[2020.03.14 20:12:03] Working dir: /root/snap/alish-tdesktop/38/.local/share/TelegramDesktop/
[2020.03.14 20:12:03] Command line: telegram-desktop
[2020.03.14 20:12:03] Executable path before check: /snap/alish-tdesktop/38/bin/telegram-desktop
[2020.03.14 20:12:03] Logs started
[2020.03.14 20:12:03] Launcher filename: alish-tdesktop_telegram-desktop.desktop
[2020.03.14 20:12:05] Connecting local socket to /run/user/0/snap.alish-tdesktop/f044ecafc17b36cac3ef208dfffb4844...
[2020.03.14 20:12:05] Socket connect error 0, starting server and app...
[2020.03.14 20:12:05] Moved logging from '/root/snap/alish-tdesktop/38/.local/share/TelegramDesktop/log_start0.txt' to '/root/snap/alish-tdesktop/38/.local/share/TelegramDesktop/log.txt'!
[2020.03.14 20:12:05] Primary screen DPI: 95.958
[2020.03.14 20:12:05] App Info: reading settings...
[2020.03.14 20:12:05] App Info: reading encrypted settings...

@ilya-fedin started building.i'll be ready in 3 hours.thanks for adding architectures to snapcraft config

Looks like fix now in mainline. The new 1.9.20-beta works excellent.
We can close the ticket.

The new 1.9.20-beta works excellent.

armhf or aarch64?

armhf

nobody tried on aarch64 yet :(

Mine is aarch64

Mine is aarch64

And you encountered with #7144

Yes. Not saying that I can verify this as fixed.

I hope that removing of gtk helps :(

We might know in 2 hours :D

Looks like it is already built for amd64/i386/ppc64le, but still in progress for armhf and arm64
image
image

I can test on aarch64 if needed.

I can test on aarch64 if needed.

Yes, it is needed.
snap install --edge telegram-desktop

@ilya-fedin after installing, I'm facing the the issue on #7144. I'll try compiling myself as from skimming through the thread, this seems like it may be snap related.

I'm on a Pinebook Pro, running Manjaro ARM.

I'm on a Pinebook Pro, running Manjaro ARM.

Haha, then we are in the exact same boat.

I'm also observing
Gtk-Message: 00:34:45.535: Failed to load module "canberra-gtk-module"
on startup, but Telegram launches and works as it should

Yep, this is not the real case. It is just regular warning.

It has built for aarch64.

It has built for aarch64.

And what is the result?

Here is the log of env QT_LOGGING_RULES="*.debug=true" alish-tdesktop.telegram-desktop > output_xorg.txt 2>&1

qt.qpa.screen: Output DP-1 is not connected
qt.qpa.screen: adding QXcbScreen(0xaaaad2514980, name="eDP-1", geometry=1920x1080+0+0, availableGeometry=1920x1053+0+27, devicePixelRatio=1.0, logicalDpi=QPair(96.0,96.0), physicalSize=508.0x285.0mm, screenNumber=0, virtualSize=1920x1080 (1920.0x1080.0mm), orientation=Qt::ScreenOrientation(LandscapeOrientation), depth=24, refreshRate=60.0, root=207, windowManagerName="GNOME Shell") (Primary: true )
qt.qpa.screen: primary output is "eDP-1"
qt.qpa.input.devices: XInput version 2.2 is available and Qt supports 2.2 or greater
qt.qpa.input.devices: input device  Virtual core XTEST pointer ID 4
qt.qpa.input.devices:    has 10 buttons
qt.qpa.input.devices:    has valuator "Rel X" recognized? true
qt.qpa.input.devices:    has valuator "Rel Y" recognized? true
qt.qpa.input.devices:    it's a scrolling device
qt.qpa.input.devices: input device  HAILUCK CO.,LTD USB KEYBOARD Mouse ID 10
qt.qpa.input.devices:    has 7 buttons
qt.qpa.input.devices:    has valuator "Rel X" recognized? true
qt.qpa.input.devices:    has valuator "Rel Y" recognized? true
qt.qpa.input.devices:    has valuator "Rel Horiz Scroll" recognized? true
qt.qpa.input.devices:    has valuator "Rel Vert Scroll" recognized? true
qt.qpa.input.devices:    it's a scrolling device
qt.qpa.input.devices: input device  HAILUCK CO.,LTD USB KEYBOARD Touchpad ID 11
qt.qpa.input.devices:    has 7 buttons
qt.qpa.input.devices:    has valuator "Rel X" recognized? true
qt.qpa.input.devices:    has valuator "Rel Y" recognized? true
qt.qpa.input.devices:    has valuator "Rel Horiz Scroll" recognized? true
qt.qpa.input.devices:    has valuator "Rel Vert Scroll" recognized? true
qt.qpa.input.devices:    it's a scrolling device
qt.qpa.gl: Choosing xcb gl-integration based on following priority
 ("xcb_glx", "xcb_egl")
qt.qpa.gl: Xcb EGL gl-integration created
qt.qpa.gl: Xcb EGL gl-integration retrying with display 0x0
qt.qpa.gl: Xcb EGL gl-integration successfully initialized
qt.qpa.gl: Failed to initialize xcb gl-integration "xcb_egl"
qt.qpa.gl: Failed to create xcb gl-integration
Qt: Session management error: None of the authentication protocols specified are supported
Fontconfig warning: FcPattern object weight does not accept value [40 210)

I strongly believe the GL problems are caused by the Panfrost driver not supporting them yet.

That was Xorg btw.

@aveao can you maybe also test on your machine, just to assure that it is not because my drivers are weird?

Also @anyone with an RPi4 and aarch64, different hardware tests would definitely also be helpful.

@p3732
Download this file: https://github.com/desktop-app/lib_ui/raw/master/qt_conf/fc-custom.conf
Put it into ~/snap/telegram-desktop/current
And run FONTCONFIG_FILE=~/snap/telegram-desktop/current/fc-custom.conf telegram-desktop

I put the file in ~/snap/alish-tdesktop/curren and ran env QT_LOGGING_RULES="*.debug=true" FONTCONFIG_FILE=~/snap/alish-tdesktop/current/fc-custom.conf alish-tdesktop.telegram-desktop > output_xorg.txt 2>&1 but the output is the same as before.

Hmm. Try to replace ~ with your home directory.

Stop, it is anyway overridden in desktop-launch script.

snap run --shell telegram-desktop
desktop-launch env FONTCONFIG_FILE=$HOME/snap/alish-tdesktop/current/fc-custom.conf telegram-desktop

It started! :tada: :tada: :tada:

Oh. This ugly hack. Brr-mrr-grr.

What's with animated stickers and videos?

Stickers work like a charm, GIFs too :D

Glad to hear :pray:
@Aokromes this issue can be closed

And videos too! Thank you so much for this long process and all the guiding! :1st_place_medal:

Can confirm it also works with non-ubuntu-patched fontconig. Testing Wayland next.

Xwayland works, can't get the native QT_QPA_PLATFORM=wayland working, but that is a problem for another time.

Looks like it is already built for amd64/i386/ppc64le, but still in progress for armhf and arm64

armhf and aarch64 nearly 3 hours.
amd64 i386 and ppc64le take almost 50 minutes

@ilya-fedin tested on rpi 3b with fake KMS and it works fine

@p3732 Hey, I left my PBP to build it overnight but it ended up out of power and shutting down it seems (not a rare issue sadly, even when it's plugged in).

I've followed the steps about the fontconfig and it didn't work at first, but after doing I then realized that $HOME is already ~/snap/telegram-desktop/1043/, so I replaced the command with desktop-launch env FONTCONFIG_FILE=$HOME/fc-custom.conf telegram-desktop.

Upon doing that, I can confirm that it runs, and that animated stickers no longer cause a crash.

Although completely off-topic (sorry!):

(not a rare issue sadly, even when it's plugged in).

I found that I wasn't properly plugging it in in the beginning. Ever since accidentally plugging the charger all the way I have not had any charging issues.

Looks like ffmpeg upstream fixed the issue in neon code (but only aarch64, 32-bit arm seems still unfixed): http://ffmpeg.org/pipermail/ffmpeg-devel/2020-July/265913.html

Looks like ffmpeg upstream fixed the issue in neon code (but only aarch64, 32-bit arm seems still unfixed)

@ilya-fedin aarch64 build of Telegram still crash on Ubuntu 20.10 with ffmpeg 4.3.1, that supposed to include this fix.

Should I fill new bugreport or this one can be reopened?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hamidna picture hamidna  路  99Comments

auchri picture auchri  路  149Comments

f1ztech picture f1ztech  路  78Comments

AliDjango picture AliDjango  路  109Comments

beerisgood picture beerisgood  路  122Comments