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

Accepting calls crashes Telegram Desktop #4219

Closed
Daniel-M opened this issue Dec 21, 2017 · 38 comments
Closed

Accepting calls crashes Telegram Desktop #4219

Daniel-M opened this issue Dec 21, 2017 · 38 comments

Comments

@Daniel-M
Copy link

Daniel-M commented Dec 21, 2017

Steps to reproduce

  1. Attempt call to any telegram contact
  2. Once the call connects, the client crashes

Expected behaviour

The client shouldn't crash and the call should work normally

Actual behaviour

The client crashed. When run from the terminal showed

QObject::startTimer: Timers cannot have negative intervals
D/tgvoip: === Updating voip config ===
V/tgvoip: audio_bitrate_step_decr -> 1000.000000
V/tgvoip: audio_bitrate_step_incr -> 1000.000000
V/tgvoip: audio_congestion_window -> 1024.000000
V/tgvoip: audio_frame_size -> 60.000000
V/tgvoip: audio_init_bitrate -> 16000.000000
V/tgvoip: audio_init_bitrate_edge -> 8000.000000
V/tgvoip: audio_init_bitrate_gprs -> 8000.000000
V/tgvoip: audio_init_bitrate_saving -> 8000.000000
V/tgvoip: audio_max_bitrate -> 20000.000000
V/tgvoip: audio_max_bitrate_edge -> 16000.000000
V/tgvoip: audio_max_bitrate_gprs -> 8000.000000
V/tgvoip: audio_max_bitrate_saving -> 8000.000000
V/tgvoip: jitter_losses_to_reset -> 20.000000
V/tgvoip: jitter_max_delay_20 -> 25.000000
V/tgvoip: jitter_max_delay_40 -> 15.000000
V/tgvoip: jitter_max_delay_60 -> 10.000000
V/tgvoip: jitter_max_slots_20 -> 50.000000
V/tgvoip: jitter_max_slots_40 -> 30.000000
V/tgvoip: jitter_max_slots_60 -> 20.000000
V/tgvoip: jitter_min_delay_20 -> 6.000000
V/tgvoip: jitter_min_delay_40 -> 4.000000
V/tgvoip: jitter_min_delay_60 -> 2.000000
V/tgvoip: jitter_resync_threshold -> 0.500000
V/tgvoip: use_system_aec -> true
V/tgvoip: use_system_ns -> true
V/tgvoip: new endpoint 10003: 91.108.12.3:536
V/tgvoip: new endpoint 10002: 91.108.12.2:521
V/tgvoip: new endpoint 40003: 91.108.8.3:529
V/tgvoip: new endpoint 40002: 91.108.8.2:535
V/tgvoip: new endpoint 50003: 91.108.16.3:540
V/tgvoip: new endpoint 50004: 91.108.16.4:537
W/tgvoip: Set remote endpoints
V/tgvoip: Adding endpoint: 91.108.12.3:536, UDP
V/tgvoip: Adding endpoint: 91.108.12.2:521, UDP
V/tgvoip: Adding endpoint: 91.108.8.3:529, UDP
V/tgvoip: Adding endpoint: 91.108.8.2:535, UDP
V/tgvoip: Adding endpoint: 91.108.16.3:540, UDP
V/tgvoip: Adding endpoint: 91.108.16.4:537, UDP
I/tgvoip: update data saving mode, config 0, enabled 0, reqd by peer 0
W/tgvoip: Starting voip controller
V/tgvoip: trying bind to port 25539
D/tgvoip: Bound to local UDP port 25539
I/tgvoip: Receive thread starting
E/tgvoip: can't set thread priority: Operación no permitida
E/tgvoip: can't set thread priority: Operación no permitida
E/tgvoip: can't set thread priority: Operación no permitida
V/tgvoip: Call state changed to 2
V/tgvoip: Sending UDP ping to 91.108.12.3:536
V/tgvoip: Sending UDP ping to 91.108.12.2:521
V/tgvoip: Sending UDP ping to 91.108.8.3:529
V/tgvoip: Sending UDP ping to 91.108.8.2:535
V/tgvoip: Sending UDP ping to 91.108.16.3:540
V/tgvoip: Sending UDP ping to 91.108.16.4:537
D/tgvoip: SIGNAL BAR COUNT CHANGED: 1
I/tgvoip: Detected IPv4 connectivity, will not try IPv6
D/tgvoip: Received init
I/tgvoip: Peer version is 3
W/tgvoip: Received duplicated packet for seq 1
D/tgvoip: SIGNAL BAR COUNT CHANGED: 2
D/tgvoip: SIGNAL BAR COUNT CHANGED: 3
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
D/tgvoip: SIGNAL BAR COUNT CHANGED: 4
V/tgvoip: Call state changed to 2
D/tgvoip: Received init ack
I/tgvoip: peer version from init ack 3
I/tgvoip: before create audio io
E/tgvoip: can't set thread priority: Operación no permitida
V/tgvoip: starting encoder, packets per frame=3
E/tgvoip: can't set thread priority: Operación no permitida
I/tgvoip: decoder: packets per frame 3
W/tgvoip: jitter: found no packet for timestamp 0 (last put = 0, lost = 0)
W/tgvoip: jitter: found no packet for timestamp 60 (last put = 0, lost = 0)
V/tgvoip: Trying to recover late packet
W/tgvoip: jitter: found no packet for timestamp 0 (last put = 0, lost = 0)
V/tgvoip: PLC
I/tgvoip: Sending public endpoints request
D/tgvoip: Sending public endpoints request to 91.108.12.3:536
D/tgvoip: Received init
I/tgvoip: Peer version is 3
W/tgvoip: Received duplicated packet for seq 3
V/tgvoip: opus_encoder: setting bitrate to 16000
D/tgvoip: new delay from stddev 2
V/tgvoip: Call state changed to 3
I/tgvoip: jitter: resyncing, next timestamp = -120 (step=60, minDelay=2)
Assertion 'e->mainloop->n_enabled_defer_events > 0' failed at pulse/mainloop.c:257, function mainloop_defer_enable(). Aborting.
Aborted

A call with other contact provided the following result on the prompt

QObject::startTimer: Timers cannot have negative intervals
D/tgvoip: === Updating voip config ===
V/tgvoip: audio_bitrate_step_decr -> 1000.000000
V/tgvoip: audio_bitrate_step_incr -> 1000.000000
V/tgvoip: audio_congestion_window -> 1024.000000
V/tgvoip: audio_frame_size -> 60.000000
V/tgvoip: audio_init_bitrate -> 16000.000000
V/tgvoip: audio_init_bitrate_edge -> 8000.000000
V/tgvoip: audio_init_bitrate_gprs -> 8000.000000
V/tgvoip: audio_init_bitrate_saving -> 8000.000000
V/tgvoip: audio_max_bitrate -> 20000.000000
V/tgvoip: audio_max_bitrate_edge -> 16000.000000
V/tgvoip: audio_max_bitrate_gprs -> 8000.000000
V/tgvoip: audio_max_bitrate_saving -> 8000.000000
V/tgvoip: jitter_losses_to_reset -> 20.000000
V/tgvoip: jitter_max_delay_20 -> 25.000000
V/tgvoip: jitter_max_delay_40 -> 15.000000
V/tgvoip: jitter_max_delay_60 -> 10.000000
V/tgvoip: jitter_max_slots_20 -> 50.000000
V/tgvoip: jitter_max_slots_40 -> 30.000000
V/tgvoip: jitter_max_slots_60 -> 20.000000
V/tgvoip: jitter_min_delay_20 -> 6.000000
V/tgvoip: jitter_min_delay_40 -> 4.000000
V/tgvoip: jitter_min_delay_60 -> 2.000000
V/tgvoip: jitter_resync_threshold -> 0.500000
V/tgvoip: use_system_aec -> true
V/tgvoip: use_system_ns -> true
V/tgvoip: new endpoint 10003: 91.108.12.3:525
V/tgvoip: new endpoint 10001: 91.108.12.1:537
V/tgvoip: new endpoint 40007: 91.108.8.7:537
V/tgvoip: new endpoint 40003: 91.108.8.3:528
V/tgvoip: new endpoint 50001: 91.108.16.1:523
V/tgvoip: new endpoint 50002: 91.108.16.2:532
W/tgvoip: Set remote endpoints
V/tgvoip: Adding endpoint: 91.108.12.3:525, UDP
V/tgvoip: Adding endpoint: 91.108.12.1:537, UDP
V/tgvoip: Adding endpoint: 91.108.8.7:537, UDP
V/tgvoip: Adding endpoint: 91.108.8.3:528, UDP
V/tgvoip: Adding endpoint: 91.108.16.1:523, UDP
V/tgvoip: Adding endpoint: 91.108.16.2:532, UDP
I/tgvoip: update data saving mode, config 0, enabled 0, reqd by peer 0
W/tgvoip: Starting voip controller
V/tgvoip: trying bind to port 17284
D/tgvoip: Bound to local UDP port 17284
I/tgvoip: Receive thread starting
E/tgvoip: can't set thread priority: Operación no permitida
E/tgvoip: can't set thread priority: Operación no permitida
E/tgvoip: can't set thread priority: Operación no permitida
V/tgvoip: Call state changed to 2
V/tgvoip: Sending UDP ping to 91.108.12.3:525
V/tgvoip: Sending UDP ping to 91.108.12.1:537
V/tgvoip: Sending UDP ping to 91.108.8.7:537
V/tgvoip: Sending UDP ping to 91.108.8.3:528
V/tgvoip: Sending UDP ping to 91.108.16.1:523
V/tgvoip: Sending UDP ping to 91.108.16.2:532
D/tgvoip: SIGNAL BAR COUNT CHANGED: 1
I/tgvoip: Detected IPv4 connectivity, will not try IPv6
D/tgvoip: Received init
I/tgvoip: Peer version is 3
W/tgvoip: Received duplicated packet for seq 1
D/tgvoip: SIGNAL BAR COUNT CHANGED: 2
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
D/tgvoip: SIGNAL BAR COUNT CHANGED: 3
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
D/tgvoip: SIGNAL BAR COUNT CHANGED: 4
V/tgvoip: Call state changed to 2
D/tgvoip: Received init ack
I/tgvoip: peer version from init ack 3
I/tgvoip: before create audio io
E/tgvoip: can't set thread priority: Operación no permitida
V/tgvoip: starting encoder, packets per frame=3
E/tgvoip: can't set thread priority: Operación no permitida
I/tgvoip: Sending public endpoints request
D/tgvoip: Sending public endpoints request to 91.108.12.3:525
V/tgvoip: Call state changed to 3
I/tgvoip: jitter: resyncing, next timestamp = -120 (step=60, minDelay=3)
I/tgvoip: decoder: packets per frame 3
W/tgvoip: jitter: found no packet for timestamp -120 (last put = 60, lost = 0)
W/tgvoip: jitter: found no packet for timestamp -60 (last put = 60, lost = 0)
V/tgvoip: Trying to recover late packet
W/tgvoip: jitter: found no packet for timestamp -120 (last put = 60, lost = 0)
V/tgvoip: PLC
W/tgvoip: jitter: found no packet for timestamp 0 (last put = 60, lost = 0)
V/tgvoip: Trying to recover late packet
W/tgvoip: jitter: found no packet for timestamp -60 (last put = 60, lost = 0)
V/tgvoip: PLC
V/tgvoip: Trying to recover late packet
W/tgvoip: jitter: found no packet for timestamp 0 (last put = 60, lost = 0)
E/tgvoip: Can't provide 18376 bytes of audio data at a time
Assertion '!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m)' failed at pulse/thread-mainloop.c:187, function pa_threaded_mainloop_unlock(). Aborting.
Aborted

Configuration

Operating system:
Debian Testing

$ uname -a
Linux 4.13.0-1-amd64 #1 SMP Debian 4.13.13-1 (2017-11-16) x86_64 GNU/Linux

I'm using pulseaudio to manage my audio streams, I had successful calls before in my system.

Version of Telegram Desktop:
Version 1.2.3 alpha

Used theme:
Standard theme

Logs: Last call log: [last_call_log.txt](https://github.com/telegramdesktop/tdesktop/files/1577885/last_call_log.txt)

Any additional details I'm willing to give upon request.

@Aokromes
Copy link
Collaborator

Aokromes commented Jan 3, 2018

Try after a00941f

@Daniel-M
Copy link
Author

Daniel-M commented Jan 15, 2018

Updated to version 1.2.8 alpha and the problem persist. I'm up to accepting calls if any dev wants me to test

@Daniel-M
Copy link
Author

I have to add that I'm able to send voice messages without any problem

@nartes
Copy link

nartes commented Mar 24, 2018

I experience pulse audio related logic problems too! Either you have a shitty code for pulseaudio, or it is itself unstable.

@Daniel-M
Copy link
Author

@nartes I have pulseaudio 11.1 I'm not sure if it is unstable :(

@nartes
Copy link

nartes commented Mar 28, 2018

To be precise:

(gdb) where
#0  0x00007f6bafce2860 in raise () at /usr/lib/libc.so.6
#1  0x00007f6bafce3ec9 in abort () at /usr/lib/libc.so.6
#2  0x00007f6b7fde2c67 in pa_threaded_mainloop_unlock () at /usr/lib/libpulse.so.0
#3  0x000055dfe4cc959a in tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, unsigned long) ()
#4  0x00007f6b7fddbe07 in  () at /usr/lib/libpulse.so.0
#5  0x00007f6b7fb6adcb in pa_pdispatch_run () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#6  0x00007f6b7fdbe520 in  () at /usr/lib/libpulse.so.0
#7  0x00007f6b7fb6dc1f in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#8  0x00007f6b7fb707cb in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#9  0x00007f6b7fb70b8a in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#10 0x00007f6b7fb71440 in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#11 0x00007f6b7fdd3ea8 in pa_mainloop_dispatch () at /usr/lib/libpulse.so.0
#12 0x00007f6b7fdd4280 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#13 0x00007f6b7fdd4301 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#14 0x00007f6b7fde26ae in  () at /usr/lib/libpulse.so.0
#15 0x00007f6b7fb8181c in  () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#16 0x00007f6bb095608c in start_thread () at /usr/lib/libpthread.so.0
#17 0x00007f6bafda3e7f in clone () at /usr/lib/libc.so.6
(gdb) info threads
  Id   Target Id         Frame 
  1    Thread 0x7f6bb64d1d00 (LWP 4474) "telegram-deskto" 0x000055dfe4c7cc87 in ?? ()
  2    Thread 0x7f6ba0296700 (LWP 4476) "QXcbEventReader" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  3    Thread 0x7f6b96832700 (LWP 4477) "dconf worker" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  4    Thread 0x7f6b96031700 (LWP 4478) "gmain" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  5    Thread 0x7f6b95830700 (LWP 4479) "gdbus" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  6    Thread 0x7f6b856f2700 (LWP 4480) "QDBusConnection" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  7    Thread 0x7f6b84911700 (LWP 4485) "QThread" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  8    Thread 0x7f6b7f435700 (LWP 4486) "QThread" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  9    Thread 0x7f6b7ec34700 (LWP 4487) "QThread" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  10   Thread 0x7f6b7e433700 (LWP 4489) "Qt bearer threa" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  11   Thread 0x7f6b7b2dd700 (LWP 4490) "MTP::internal::" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  12   Thread 0x7f6b427fc700 (LWP 21120) "MTP::internal::" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  13   Thread 0x7f6b796f6700 (LWP 21123) "MTP::internal::" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  15   Thread 0x7f6b7a2db700 (LWP 22841) "QNetworkAccessM" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  25   Thread 0x7f6b5a7fc700 (LWP 1128) "QNetworkAccessM" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  56   Thread 0x7f6b5b7fe700 (LWP 1652) "QNetworkAccessM" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  64   Thread 0x7f6b5affd700 (LWP 1761) "QThread" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  66   Thread 0x7f6b59ffb700 (LWP 1764) "QThread" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
  70   Thread 0x7f6b78ef5700 (LWP 1788) "voip-recv" 0x00007f6bafd9b7b3 in select () from /usr/lib/libc.so.6
  71   Thread 0x7f6b557fa700 (LWP 1789) "voip-send" 0x00007f6bb095ecf6 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
  72   Thread 0x7f6b54ff9700 (LWP 1790) "voip-tick" 0x00007f6bafd71b10 in nanosleep () from /usr/lib/libc.so.6
  73   Thread 0x7f6b5bfff700 (LWP 1791) "threaded-ml" 0x00007f6bafd9997b in poll () from /usr/lib/libc.so.6
* 74   Thread 0x7f6b7aadc700 (LWP 1793) "threaded-ml" 0x00007f6bafce2860 in raise () from /usr/lib/libc.so.6
  75   Thread 0x7f6b43fff700 (LWP 1794) "voip-recv" 0x00007f6bb095ecf6 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
  76   Thread 0x7f6b437fe700 (LWP 1795) "opus_encoder" 0x00007f6bb095ecf6 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
  77   Thread 0x7f6b42ffd700 (LWP 1796) "opus_decoder" 0x00007f6bb095ecf6 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
(gdb) info registers
rax            0x0      0
rbx            0x7f6b8c00f370   140099887100784
rcx            0x7f6bafce2860   140100487751776
rdx            0x0      0
rsi            0x7f6b7aadb6e0   140099596433120
rdi            0x2      2
rbp            0x8360   0x8360
rsp            0x7f6b7aadb940   0x7f6b7aadb940
r8             0x0      0
r9             0x7f6b7aadb6e0   140099596433120
r10            0x8      8
r11            0x246    582
r12            0x7f6b8c00f3d4   140099887100884
r13            0x7f6b8c0017e0   140099887044576
r14            0x7f6b7aadb958   140099596433752
r15            0x7f6b7aadb960   140099596433760
rip            0x55dfe4cc959a   0x55dfe4cc959a <tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, unsigned long)+474>
eflags         0x246    [ PF ZF IF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0

@llybin
Copy link

llybin commented May 16, 2018

still does not work

@Daniel-M
Copy link
Author

Daniel-M commented May 16, 2018

@llybin I can confirm that In my machine the calls still crash, In fact, since my initial post on this issue, the calls have neven been working in the desktop client

@llybin
Copy link

llybin commented May 16, 2018

If need some information - I ready to provide.

@grishka
Copy link
Contributor

grishka commented Jul 14, 2018

Please try 1.3.10

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

@grishka as of today with Telegram 1.3.10 alpha the problem persist, Telegram Desktop client crashes when the other end accepts the call.

@grishka
Copy link
Contributor

grishka commented Aug 1, 2018

A backtrace of the crash maybe?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

The logs of .local/share/TelegramDesktop/log

[2018.08.01 15:31:03] Launched version: 1003010, alpha: [TRUE], beta: 0, debug mode: [TRUE], test dc: [FALSE]
[2018.08.01 15:31:03] Executable dir: /home/damejia/opt/Telegram/, name: Telegram
[2018.08.01 15:31:03] Initial working dir: /home/damejia/
[2018.08.01 15:31:03] Working dir: /home/damejia/.local/share/TelegramDesktop/
[2018.08.01 15:31:03] Command line: /home/damejia/opt/Telegram/Telegram --
[2018.08.01 15:31:03] Executable path before check: /home/damejia/opt/Telegram/Telegram
[2018.08.01 15:31:03] Logs started
[2018.08.01 15:31:04] Connecting local socket to /tmp/d51ee65f8f47bb437a5bb8e4287ee9e3-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2018.08.01 15:31:04] Socket connect error 0, starting server and app...
[2018.08.01 15:31:04] Moved logging from '/home/damejia/.local/share/TelegramDesktop/log_start2.txt' to '/home/damejia/.local/share/TelegramDesktop/log.txt'!
[2018.08.01 15:31:04] Old start log 'log_start0.txt' found, deleted: [TRUE]
[2018.08.01 15:31:04] Old start log 'log_start1.txt' found, deleted: [TRUE]
[2018.08.01 15:31:04] Opened '/home/damejia/.local/share/TelegramDesktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 1775
[2018.08.01 15:33:53] Font Error: could not resolve 'Open Sans Semibold' font, got 'Open Sans' after feeding '%3'.
[2018.08.01 15:33:54] Update Info: MTP is unavailable.
[2018.08.01 15:33:55] App Error: _basePath is empty in writeSettings()
[2018.08.01 15:33:55] Error: failed to load 'gdk_x11_drawable_get_xdisplay' function!
[2018.08.01 15:33:55] Getting DE, XDG_CURRENT_DESKTOP: 'LXQt'
[2018.08.01 15:33:55] Getting DE, DESKTOP_SESSION: 'lxqt'
[2018.08.01 15:33:55] Getting DE, KDE_SESSION_VERSION: ''
[2018.08.01 15:33:55] Getting DE, GNOME_DESKTOP_SESSION_ID: ''
[2018.08.01 15:33:55] Getting DE, KDE_FULL_SESSION: ''
[2018.08.01 15:33:55] DE: Other
[2018.08.01 15:33:55] Tray Icon: Try Qt = [TRUE], Prefer appindicator = [FALSE]
[2018.08.01 15:33:55] App Info: reading settings...
[2018.08.01 15:33:55] App Info: reading encrypted settings...
[2018.08.01 15:33:56] Lang Info: Loaded cached, keys: 1867
[2018.08.01 15:33:56] Lang Error: Unknown key 'lng_channel_admin_sure'
[2018.08.01 15:33:56] Lang Error: Unknown key 'lng_context_remove_admin'
[2018.08.01 15:33:56] OpenAL Logging Level: (not set)
[2018.08.01 15:33:56] Audio Playback Devices: OpenAL Soft
[2018.08.01 15:33:56] Audio Playback Default Device: OpenAL Soft
[2018.08.01 15:33:56] Audio Capture Devices: Audio Interno Estéreo Analógico;Monitor of Audio Interno Digital Stereo (HDMI);Monitor of Audio Interno Estéreo Analógico;Monitor of FFT based equalizer on Audio Interno Estéreo Analógico
[2018.08.01 15:33:56] Audio Capture Default Device: Audio Interno Estéreo Analógico
[2018.08.01 15:33:56] App Info: reading map...
[2018.08.01 15:33:56] App Info: reading encrypted map...
[2018.08.01 15:33:57] App Info: reading encrypted user settings...
[2018.08.01 15:33:57] App Info: encrypted user settings read.
[2018.08.01 15:33:57] App Info: reading encrypted mtp data...
[2018.08.01 15:33:57] MTP Info: read keys, current: 5, to destroy: 0
[2018.08.01 15:33:57] Map read time: 481
[2018.08.01 15:33:57] TCP Error: network - Network unreachable
[2018.08.01 15:33:57] HTTP Error: network error 99 - Network unreachable
[2018.08.01 15:33:57] Export Info: Destroy top bar by controller removal.
[2018.08.01 15:33:57] Using Qt tray icon.
[2018.08.01 15:33:57] Tray Icon: Using Qt tray icon, available: [TRUE]
[2018.08.01 15:33:57] Not using Unity Launcher count.
[2018.08.01 15:33:57] Lang Info: Up to date.
[2018.08.01 15:34:26] Notifications Server: Xfce Notify Daemon
[2018.08.01 15:37:50] WARNING: Compositing is disabled for screen index 0 (for position 958,601)
[2018.08.01 15:37:54] App Info: writing encrypted user settings...
[2018.08.01 15:38:05] Gif Error: Unable to avcodec_open2 for file '', data size '722449', error -22, Argumento inválido
[2018.08.01 15:38:15] Skipping message, because it is already in blocks!
[2018.08.01 15:39:00] Message Info: bad message notification received (error_code 16) for msg_id = 6584853328544104424, seq_no = 196
[2018.08.01 15:39:15] TCP Error: network - Network unreachable
[2018.08.01 15:39:15] HTTP Error: network error 99 - Network unreachable

No last_call.log was generated

@grishka
Copy link
Contributor

grishka commented Aug 1, 2018

I mean, could you please start it in gdb and reproduce the crash?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

It shows a long text https://gist.github.com/Daniel-M/249d2fa3638ddaca87a1722ccbfed54e related to another issue with fontconfig.

@grishka
Copy link
Contributor

grishka commented Aug 1, 2018

Okay, and then, when it crashes and you run where, what does it show?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

After a long wait, I could make gdb work with it, heres the report of the crash:

[Thread 0x7fffd4f4c700 (LWP 21453) exited]
[New Thread 0x7fffeeffd700 (LWP 21752)]
[New Thread 0x7fffd4f4c700 (LWP 21753)]
W/tgvoip: Set remote endpoints, allowP2P=1, connectionMaxLayer=74
V/tgvoip: Adding endpoint: 91.108.12.1:530, UDP
V/tgvoip: Adding endpoint: 91.108.12.3:536, UDP
V/tgvoip: Adding endpoint: 91.108.8.6:522, UDP
V/tgvoip: Adding endpoint: 91.108.8.4:525, UDP
V/tgvoip: Adding endpoint: 91.108.16.2:535, UDP
V/tgvoip: Adding endpoint: 91.108.16.1:531, UDP
I/tgvoip: update data saving mode, config 0, enabled 0, reqd by peer 0
W/tgvoip: Starting voip controller
V/tgvoip: trying bind to port 27644
D/tgvoip: Bound to local UDP port 27644
[New Thread 0x7fffc57fa700 (LWP 21758)]
I/tgvoip: Receive thread starting
[New Thread 0x7fff93fff700 (LWP 21759)]
[New Thread 0x7fff937fe700 (LWP 21760)]
V/tgvoip: Call state changed to 2
I/tgvoip: Detected IPv4 connectivity, will not try IPv6
D/tgvoip: Received init
I/tgvoip: Peer version is 6
W/tgvoip: Received duplicated packet for seq 1
V/tgvoip: Sending UDP ping to 91.108.12.1:530
V/tgvoip: Sending UDP ping to 91.108.12.3:536
V/tgvoip: Sending UDP ping to 91.108.8.6:522
V/tgvoip: Sending UDP ping to 91.108.8.4:525
V/tgvoip: Sending UDP ping to 91.108.16.2:535
V/tgvoip: Sending UDP ping to 91.108.16.1:531
V/tgvoip: Received UDP ping reply from 91.108.12.1:530: date=1533159052, queryID=12345, my IP=190.7.146.163, my port=27644
V/tgvoip: Received UDP ping reply from 91.108.12.3:536: date=1533159052, queryID=12345, my IP=190.7.146.163, my port=27644
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
V/tgvoip: Received UDP ping reply from 91.108.8.4:525: date=1533159052, queryID=12345, my IP=190.7.146.163, my port=27644
V/tgvoip: Received UDP ping reply from 91.108.8.6:522: date=1533159052, queryID=12345, my IP=190.7.146.163, my port=27644
V/tgvoip: Call state changed to 2
D/tgvoip: Received init
I/tgvoip: Peer version is 6
W/tgvoip: Received duplicated packet for seq 4
V/tgvoip: Sending UDP ping to 91.108.12.1:530
V/tgvoip: Sending UDP ping to 91.108.12.3:536
V/tgvoip: Sending UDP ping to 91.108.8.6:522
V/tgvoip: Sending UDP ping to 91.108.8.4:525
V/tgvoip: Sending UDP ping to 91.108.16.2:535
V/tgvoip: Sending UDP ping to 91.108.16.1:531
D/tgvoip: Received init ack
I/tgvoip: peer version from init ack 6
I/tgvoip: before create audio io
[New Thread 0x7fff92ffd700 (LWP 21761)]
[New Thread 0x7fff927fc700 (LWP 21762)]
I/tgvoip: AEC: 1 NS: 1 AGC: 1
Telegram: /home/preston/Telegram/tdesktop/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp:277: void tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, size_t): La declaración `requestedBytes<=sizeof(remainingData)' no se cumple.
D/tgvoip: new delay from stddev 2,000000
[New Thread 0x7fff91ffb700 (LWP 21763)]

Thread 47 "threaded-ml" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff927fc700 (LWP 21762)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No existe el fichero o el directorio. (the directory doesn't exists)

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

^ I see /home/preston/... up there, that would be a problem too since Telegram is running from /home/damejia/... in my machine

@nartes
Copy link

nartes commented Aug 1, 2018

it doesn't look like you've entered where in gdb, there's no stacktrace.

@grishka
Copy link
Contributor

grishka commented Aug 1, 2018

^ I see /home/preston/... up there

That doesn't matter here, I know which assertion failed. It's PulseAudio asking for stupidly large chunks of data again. Did you have anything else play or record audio while calling?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

Heres the trace when I wrote where in gdb

[New Thread 0x7fffc7fff700 (LWP 23349)]
[New Thread 0x7fffc77fe700 (LWP 23350)]
V/tgvoip: Call state changed to 2
I/tgvoip: Detected IPv4 connectivity, will not try IPv6
D/tgvoip: Received init
I/tgvoip: Peer version is 6
W/tgvoip: Received duplicated packet for seq 1
V/tgvoip: Sending UDP ping to 91.108.12.2:535
V/tgvoip: Sending UDP ping to 91.108.12.5:533
V/tgvoip: Sending UDP ping to 91.108.8.5:540
V/tgvoip: Sending UDP ping to 91.108.8.2:527
V/tgvoip: Sending UDP ping to 91.108.16.1:525
V/tgvoip: Sending UDP ping to 91.108.16.4:533
V/tgvoip: Received UDP ping reply from 91.108.12.5:533: date=1533159978, queryID=12345, my IP=190.7.146.163, my port=25492
V/tgvoip: Received UDP ping reply from 91.108.12.2:535: date=1533159978, queryID=12345, my IP=190.7.146.163, my port=25492
W/tgvoip: Received duplicated packet for seq 1
W/tgvoip: Received duplicated packet for seq 1
V/tgvoip: Received UDP ping reply from 91.108.8.2:527: date=1533159978, queryID=12345, my IP=190.7.146.163, my port=25492
V/tgvoip: Received UDP ping reply from 91.108.8.5:540: date=1533159978, queryID=12345, my IP=190.7.146.163, my port=25492
W/tgvoip: Received duplicated packet for seq 1
V/tgvoip: Call state changed to 2
V/tgvoip: Received UDP ping reply from 91.108.16.1:525: date=1533159978, queryID=12345, my IP=190.7.146.163, my port=25492
D/tgvoip: Received init
I/tgvoip: Peer version is 6
W/tgvoip: Received duplicated packet for seq 4
V/tgvoip: Sending UDP ping to 91.108.12.2:535
V/tgvoip: Sending UDP ping to 91.108.12.5:533
V/tgvoip: Sending UDP ping to 91.108.8.5:540
V/tgvoip: Sending UDP ping to 91.108.8.2:527
V/tgvoip: Sending UDP ping to 91.108.16.1:525
V/tgvoip: Sending UDP ping to 91.108.16.4:533
D/tgvoip: Received init ack
I/tgvoip: peer version from init ack 6
I/tgvoip: before create audio io
[New Thread 0x7fffc6ffd700 (LWP 23351)]
[New Thread 0x7fffc67fc700 (LWP 23352)]
I/tgvoip: AEC: 1 NS: 1 AGC: 1
Telegram: /home/preston/Telegram/tdesktop/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp:277: void tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, size_t): La declaración `requestedBytes<=sizeof(remainingData)' no se cumple.
[New Thread 0x7fffc5ffb700 (LWP 23353)]

Thread 28 "threaded-ml" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffc67fc700 (LWP 23352)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No existe el fichero o el directorio.
(gdb) where
#0  0x00007ffff6d64f3b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6d662f1 in __GI_abort () at abort.c:79
#2  0x00007ffff6d5da8a in __assert_fail_base (fmt=0x7ffff7fbd14e "%s%s%s:%u: %s%sLa declaración `%s' no se cumple.\n%n", assertion=assertion@entry=0x397ffc8 "requestedBytes<=sizeof(remainingData)", file=file@entry=0x397ff68 "/home/preston/Telegram/tdesktop/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp", line=line@entry=277, function=function@entry=0x3980060 "void tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, size_t)") at assert.c:92
#3  0x00007ffff6d5db02 in __GI___assert_fail (assertion=0x397ffc8 "requestedBytes<=sizeof(remainingData)", file=0x397ff68 "/home/preston/Telegram/tdesktop/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp", line=277, function=0x3980060 "void tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, size_t)") at assert.c:101
#4  0x0000000001503451 in tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, unsigned long) ()
#5  0x0000000001503417 in tgvoip::audio::AudioOutputPulse::StreamWriteCallback(pa_stream*, unsigned long, void*) ()
#6  0x00007fffd8210efe in  () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7  0x00007fffd7fa0932 in pa_pdispatch_run () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#8  0x00007fffd81f432e in  () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#9  0x00007fffd7fa360f in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#10 0x00007fffd7fa60cb in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#11 0x00007fffd7fa6469 in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#12 0x00007fffd7fa6cef in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#13 0x00007fffd82092f8 in pa_mainloop_dispatch () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#14 0x00007fffd82096ce in pa_mainloop_iterate () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#15 0x00007fffd8209750 in pa_mainloop_run () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#16 0x00007fffd82175b9 in  () at /usr/lib/x86_64-linux-gnu/libpulse.so.0
#17 0x00007fffd7fb6c78 in  () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-11.1.so
#18 0x00007ffff70a3f2a in start_thread (arg=0x7fffc67fc700) at pthread_create.c:463
#19 0x00007ffff6e26edf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

@grishka Yes, I was playing music and I have a plug-equal pulse audio plugin

@Daniel-M
Copy link
Author

Daniel-M commented Aug 1, 2018

@nartes you are right, I forgot to write where, I'm not very proficient with GDB

@Daniel-M
Copy link
Author

Daniel-M commented Aug 2, 2018

@grishka If it serves to something, Telegram doesn't have problems when i'm playing music and hearing a voice message or related media played by the desktop client, so it might be related to calls only

@grishka
Copy link
Contributor

grishka commented Aug 2, 2018

Yes, calls and all other audio are separate implementations

@Daniel-M
Copy link
Author

Daniel-M commented Aug 2, 2018

@grishka I'm up to provide any additional help to fix the issue

@grishka
Copy link
Contributor

grishka commented Aug 6, 2018

I've tried to reproduce this but it doesn't crash for me. I tried both on a VM running Ubuntu 14.04 with whatever player comes with it, and Kubuntu 18.04 on a real laptop playing music in VLC. Which player are you using? Did you make any changes to your PulseAudio configuration?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 6, 2018

@grishka I have a module module-equalizer-sink installed which I use to tune the audio output. If you want more information on my system sound, here's the output of a couple of PulseAudio commands and the configs

@grishka
Copy link
Contributor

grishka commented Aug 7, 2018

module-role-cork is also an interesting one, albeit I've never heard about "stream roles" until now and I don't set any on my streams. I'll try to replicate your configuration and then hopefully reproduce this crash.

@Daniel-M
Copy link
Author

Daniel-M commented Aug 7, 2018

module-role-cork seems to come by default in my pulseaudio installation, the only modifications I made to the configs are related to module-equalizer-sink and setting the output streams to pass through it. It seems that module-role-cork is related to muting output audio streams when receiving VoIP calls, the problem might be there

@grishka
Copy link
Contributor

grishka commented Aug 7, 2018

The thing is, my playback stream isn't in any way marked to be recognized as one pertaining to a VoIP call, so I assume this module considers it to be music. But it shouldn't be the problem. My bet is on the equalizer because it actually manipulates the sample data on its way from the applications to the soundcard. And it of course has to have a buffer of some sort, and a rather large one in order to be able to perform FFT or whatever equalizers do to equalize and get the low frequencies correctly. And of course it doesn't make much sense to put a VoIP call through an equalizer so there has to be a way to bypass it. BRB while I read libpulse docs.

@grishka
Copy link
Contributor

grishka commented Aug 7, 2018

I found out how to set the role on my PA context, and it does make a difference – the music player now pauses automatically when I start a call and then resumes after it ends. There's also a way to tell PA to specifically bypass filters. I'll push an update soon.

@Daniel-M
Copy link
Author

Daniel-M commented Aug 7, 2018

I'd gladly provide any additional information upon request, and I'm happy to know you found a solution to the behaviour 😄

@grishka
Copy link
Contributor

grishka commented Aug 7, 2018

2.2.2 is out, now we need a tdesktop build with it.

@nartes
Copy link

nartes commented Aug 7, 2018

what if i'd like to listen to music whilst talking?

@Daniel-M
Copy link
Author

Daniel-M commented Aug 7, 2018

@nartes I figure you should disable the module module-role-cork in pulseaudio, with pactl unload-module module-role-cork or something like that. Also disable it at /etc/pulseaudio/default.pa

@Aokromes
Copy link
Collaborator

@Daniel-M Try on 1.3.14 :)

@stek29 stek29 closed this as completed Nov 7, 2018
@github-actions
Copy link

github-actions bot commented Mar 7, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

No branches or pull requests

6 participants