telegramdesktop / tdesktop

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

Telegram not see audio interfaces which was plugged after Telegram launch #27403

Closed NTMan closed 8 months ago

NTMan commented 9 months ago

Steps to reproduce

  1. Launch Telegram
  2. Paring bluetooth headset or connect external audio interface

Screenshot from 2024-01-26 13-15-10

Expected behaviour

Sound present in headset then I listen sound in Telegram

Actual behaviour

No sound until Telegram restarted

Operating system

Linux Fedora Rawhide (Pipewire)

Version of Telegram Desktop

4.14.11 beta

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

VladimirMrzv commented 9 months ago

The same thing with other connected device after Telegram already started. Telegram can not use sound device that was connected after start.

ilya-fedin commented 9 months ago

Yeah, that's unlikely to be solved because the cross-platform audio library tdesktop uses doesn't provide a way to get device list updates and there's no one with the knowledge of Linux native audio APIs (there are workarounds for Windows and macOS written using native APIs). That's something you have to get used to if you don't plan to help with the implementation.

kartavenko1983 commented 9 months ago

@ilya-fedin, yes, the node version 4.14.11 beta is beta, everything worked correctly

ilya-fedin commented 9 months ago

@kartavenko1983 node version? which node?

kartavenko1983 commented 9 months ago

@ilya-fedin I'm sorry, I'm using a translator, I probably translated it incorrectly I meant that the telegram version 4.14.11 beta everything worked correctly. That is, telegram saw the connected audio interfaces

ilya-fedin commented 9 months ago

The thing is it doesn't anymore and chances that it would be fixed before stable release (or at all) are low because there's no one to fix the bug

kartavenko1983 commented 9 months ago

@ilya-fedin Are your people running away? Is there no one to work?

ilya-fedin commented 9 months ago

@kartavenko1983 Telegram's paid developers work on linux support in spare time (linux is not of interest for business due to low market share), their spare time is little and Linux support was almost non-existent before 2020 when I started volunteering (it was launching but with lots of bugs and unimplemented features). I'm the only person volunteering for Linux support from outside but I can't fix this because I have no experience with Linux audio APIs (I know what should be done but I don't know the APIs to do that). And the paid developers too, as far as I know. So unless someone else with pipewire/pulseaudio/alsa knowledge would volunteer, the bug is likely to become a long standing one.

kartavenko1983 commented 9 months ago

@ilya-fedin Let's see how events will develop. But, interestingly, if the telegram is restarted, then the audio interfaces are picked up, and if they are disconnected and connected again, then the telegram continues to work correctly.

ilya-fedin commented 9 months ago

But, interestingly, if the telegram is restarted, then the audio interfaces are picked up, and if they are disconnected and connected again, then the telegram continues to work correctly.

This sounds expected to me. The audio device is closed when there's nothing to play so as long as the system can open it again, it will work.

kartavenko1983 commented 9 months ago

@ilya-fedin I see, thanks. Here is another open problem on a similar topic.

27421

ilya-fedin commented 9 months ago

Why did you create a duplicate if you see there's already an issue?

kartavenko1983 commented 9 months ago

@ilya-fedin I saw this topic later than I opened a new one.

ilya-fedin commented 9 months ago

but you can close it now

NTMan commented 9 months ago

Most annoying thing that with "Default" input/output device Telegram not have sound after connected new headset. The fact that you cannot select a specific device in the telegram itself is not such a necessary function as the absence of sound as such.

kartavenko1983 commented 9 months ago

@NTMan You can turn on playback or make a call, and then connect the headset, then the sound will appear. Or restart the telegram after turning on the headset.

NTMan commented 9 months ago

Or restart the telegram after turning on the headset.

Typically this has to be done after the call was answered. Everything happens in the following sequence:

  1. The call come to Telegram.
  2. I put the TWS in my ears (which are establish connect with my workstation in the background)
  3. I press the answer button in telegram.
  4. I understand that I can’t hear my buddy.
ilya-fedin commented 9 months ago

Most annoying thing that with "Default" input/output device Telegram not have sound after connected new headset.

Yeah, it should be simpler to fix just that but there's a conflict between Windows/macOS and Linux behaviors here. So I'm not sure I will get a permission to do that and a fully involved fix will then be needed to implement the same code as for Windows/macOS (what I can't do as already explained).

john-preston commented 9 months ago

@NTMan @kartavenko1983 @VladimirMrzv Please check the released 4.14.12 version, I hope it works as before or better.

kartavenko1983 commented 9 months ago

@john-preston, @ilya-fedin, Yes, everything is working correctly, thank you very much

NTMan commented 9 months ago

@john-preston Almost perfect, it would be perfect if devices appear and disappear without re-opening the window on fly.

Demonstration

ilya-fedin commented 9 months ago

It works by re-requesting the device list when opening the dialog (like before the beta). There's sadly no one to write the code to get change on the fly like done on Windows/macOS as mentioned earlier.

alba4k commented 8 months ago

I came to report a different issue, which I suppose is related? The notification sound always plays on the device that was default when telegram was opened

Example: I open telegram. I connect my bt headphones. A notification arrives. The sound still plays on the laptop speakers.

I'm not sure whether I should open a different issue for this? for context, I'm using Hyprland on Arch Linux, and PipeWire

ilya-fedin commented 8 months ago

@alba4k update to the latest version, it should already be fixed to the previous state

alba4k commented 8 months ago

yeah this can be closed I believe

also idk what that thing is ^^^^

Aokromes commented 8 months ago

yeah this can be closed I believe

also idk what that thing is ^^^^

spam.

kartavenko1983 commented 8 months ago

@ilya-fedin please delete the spam

ilya-fedin commented 8 months ago

@kartavenko1983 I can't