telegramdesktop / tdesktop

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

Make screencasting with audio work on Linux #26642

Open damnkrat opened 1 year ago

damnkrat commented 1 year ago

Steps to reproduce

  1. Try sharing video
  2. There is no share audio button at all

Expected behaviour

A button to share audio

Actual behaviour

No ability to share audio at all. No matter X11 or Wayland

Operating system

Linux

Version of Telegram Desktop

4.8.7

Installation source

Other (unofficial) source -> From Manjaro repo

Crash ID

No response

Logs

No response

damnkrat commented 1 year ago

@Aokromes Can you provide a link to the duplicate? I couldn't related issue before creating new one

ilya-fedin commented 1 year ago

I don't think this was reported before. Although there's no contributor who can implement that so it's unlikely to appear...

Aokromes commented 1 year ago

it was, i remember it reported, but hard to find xd

ilya-fedin commented 1 year ago

I see there were questions about why this is not implemented (#16730, #17163) but no bug report about that. Although I'd say this should be a feature request.

damnkrat commented 1 year ago

Also both are marked as closed, we need to open one of the questions, or without that, do this feature

ilya-fedin commented 1 year ago

I don't see a reason to open those questions, they're answered

ilya-fedin commented 1 year ago

I'm highly doubt the feature will be implemented, with an issue or without. But you can try to open a new feature request, hope @Aokromes won't close anymore.

ReillyBrogan commented 9 months ago

I assume Telegram is using the XDG portal for screencasting? If so then sending audio with application/system capture is currently unsupported (which is why it doesn't work in Discord or OBS either). There has been some movement on this recently, I'd recommend keeping watch on this issue (and for the Telegram devs working on Linux it might be a good idea to contribute their own two-cents there).

ilya-fedin commented 9 months ago

I assume Telegram is using the XDG portal for screencasting?

WebRTC.

There has been some movement on this recently, I'd recommend keeping watch on this issue (and for the Telegram devs working on Linux it might be a good idea to contribute their own two-cents there).

I'm not sure that would help. WebRTC has no "capture system audio" API and if this would become a part of the screencasting API then it would become unimplementable for tdesktop as currently the portal session is managed by WebRTC and tdesktop doesn't have access to its handles so it would be unable to speak to the portal directly and WebRTC doesn't have an API for this.

Right now it's implementable as application has full access to PipeWire/PulseAudio/ALSA. The only problem is application uses OpenAL for audio and OpenAL doesn't have API for this feature either so this feature has to be implemented with native code while tdesktop project has no one with PipeWire/PulseAudio/ALSA experience to implement any backend (not even speaking about every) for Linux. I guess OBS and Discord having the same problem: they don't have experience with Linux audio APIs and they always have much more prioritized tasks to spend time on rather than learning the zoo of Linux audio APIs.

I know there's https://github.com/maltejur/discord-screenaudio/blob/master/src/virtmic.cpp which could be used as a base but still someone has to spend time to port the implementation to tdesktop...

gmankab commented 8 months ago

some additional info about screen sharing with audio on wayland + pipewire

hope we get this feature in telegram soon

ilya-fedin commented 8 months ago

@gmankab someone interested should implement it and make a PR

lucianosrp commented 4 months ago

This feature is still not present as of v4.16.6 , would be nice to have it implemented somehow

ilya-fedin commented 4 months ago

No one seem to be really interested doing such work :(

damnkrat commented 4 months ago

For those who want some workaround for a time, check out helvum. Just connect audio sources manually in it

Снимок экрана_20240418_154244

gmankab commented 4 months ago

For those who want some workaround for a time, check out helvum. Just connect audio sources manually in it

thanks