tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Make screencasting with audio work on Linux

Open damnkrat opened this issue 2 years ago • 15 comments

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 avatar Aug 12 '23 14:08 damnkrat

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

damnkrat avatar Aug 12 '23 14:08 damnkrat

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

ilya-fedin avatar Aug 13 '23 04:08 ilya-fedin

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

Aokromes avatar Aug 13 '23 04:08 Aokromes

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.

ilya-fedin avatar Aug 13 '23 05:08 ilya-fedin

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

damnkrat avatar Aug 14 '23 14:08 damnkrat

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

ilya-fedin avatar Aug 14 '23 20:08 ilya-fedin

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.

ilya-fedin avatar Aug 14 '23 20:08 ilya-fedin

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).

ReillyBrogan avatar Nov 17 '23 08:11 ReillyBrogan

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...

ilya-fedin avatar Nov 17 '23 09:11 ilya-fedin

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

  • works by default in obs
  • works by default in discord-screenaudio
  • works by default in vesktop, audio source must be selected, no audio selected by default
  • here is a guide how to make it work in firefox
  • here is a guide how to make it work in chromium

hope we get this feature in telegram soon

gmankab avatar Dec 20 '23 13:12 gmankab

@gmankab someone interested should implement it and make a PR

ilya-fedin avatar Dec 20 '23 15:12 ilya-fedin

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

lucianosrp avatar Apr 17 '24 19:04 lucianosrp

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

ilya-fedin avatar Apr 17 '24 19:04 ilya-fedin

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

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

damnkrat avatar Apr 18 '24 12:04 damnkrat

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

thanks

gmankab avatar Apr 18 '24 13:04 gmankab