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

Not being able to share individual application window or different screen on X11 #1

Open
teppyboy opened this issue Jul 24, 2022 · 37 comments
Labels
bug Something isn't working

Comments

@teppyboy
Copy link
Contributor

When you start screen share, it always share the whole desktop, and that isn't something everybody wants to.

@maltejur
Copy link
Owner

maltejur commented Jul 25, 2022

This also applies to screens, the first one is always used and you can't change that. That is a limitation of QtWebEngine (afaik). I have tried and will continue to try to find a hack to implement this but it isn't trivial.

@maltejur maltejur changed the title Not being able to share individual application window Not being able to share individual application window or different screen Jul 25, 2022
@teppyboy
Copy link
Contributor Author

Didn't know that was a limitation of QtWebEngine, do you have any links to Qt Bugtracker for this bug?

@maltejur
Copy link
Owner

This isn't documented really well and I only found it out by digging though the QtWebEngine source code (so I could also be wrong). But here are some relevant bugs:

https://bugreports.qt.io/browse/QTBUG-80054
https://bugreports.qt.io/browse/QTBUG-70077

@maltejur
Copy link
Owner

After researching a bit further, this could maybe be achieved using the org.freedesktop.portal.ScreenCast D-Bus API. I currently have no idea how that works, but it may be worth looking into that.

@maltejur maltejur added the enhancement New feature or request label Jul 25, 2022
teppyboy added a commit to teppyboy/discord-screenaudio that referenced this issue Jul 25, 2022
So people can trace down more information about this issue.
maltejur added a commit that referenced this issue Jul 25, 2022
readme: add issue #1 to 3rd known issue
@hotburger
Copy link

Using screencast also should? make this wayland compatible.

@teppyboy
Copy link
Contributor Author

Using screencast also should? make this wayland compatible.

It should, but the problem right now is QtWebEngine itself can't capture anything else than the first screen (I tried screensharing with QuteBrowser and it had the same problem as this project)

@maltejur maltejur pinned this issue Jul 27, 2022
@maltejur
Copy link
Owner

Fyi selecting a screen/window should now be possible on Wayland, still not on X11.

@maltejur maltejur changed the title Not being able to share individual application window or different screen Not being able to share individual application window or different screen on X11 Jul 30, 2022
@maltejur maltejur added bug Something isn't working and removed enhancement New feature or request labels Jul 30, 2022
@Smoukus
Copy link

Smoukus commented Jul 30, 2022

Fyi selecting a screen/window should now be possible on Wayland, still not on X11.

On what version exactly? I tried AUR package right now, and people could only see black screen and no audio when streaming a game.
I am on GNOME Wayland, Arch

@maltejur
Copy link
Owner

To test it you would have to build manually on the master branch. Or you wait a few days until I release the changes.

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

Ah I see, that version just hasn't been released yet. All clear now, thanks.

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

To test it you would have to build manually on the master branch. Or you wait a few days until I release the changes.

I've built it manually now, but sadly people still see black screen, and no audio.
What are the needed steps to uninstall everything now?

@maltejur
Copy link
Owner

maltejur commented Jul 31, 2022

To uninstall, run sudo xargs rm -f <build/install_manifest.txt. But before doing that, can you try running QTWEBENGINE_CHROMIUM_FLAGS=--enable-features=WebRTCPipeWireCapturer ./build/discord-screenaudio and see if that works? Also, do you have xdg-desktop-portal-gtk installed?

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

To uninstall, run sudo xargs rm -f <build/install_manifest.txt. But before doing that, can you try running QTWEBENGINE_CHROMIUM_FLAGS=--enable-features=WebRTCPipeWireCapturer ./build/discord-screenaudio and see if that works? Also, do you have xdg-desktop-portal-gtk installed?

Thanks for the answer.
I have ran the command QTWEBENGINE_CHROMIUM_FLAGS=--enable-features=WebRTCPipeWireCapturer ./build/discord-screenaudio and it opened discord-screenaudio without issues, but game or audio were still not viisible when screen sharing.

I am on Arch Linux, so I have found a package in the AUR (https://aur.archlinux.org/packages/xdg-desktop-portal-gtk-git) for xdg-desktop-portal-gtk, but sadly it won't install because it has apparently syntax error in some file.

@maltejur
Copy link
Owner

Just install it from the official repositories: https://archlinux.org/packages/extra/x86_64/xdg-desktop-portal-gtk/

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

Didn't know there was a package from official repo. It turns out I have it installed already.

@bbaster
Copy link

bbaster commented Jul 31, 2022

I've got screensharing to work with Wayland on latest master, however audio sharing seems to not work...

discord-screenaudio-virtmic is selected as an input device, but my friend with whom I tested it reports only hearing my microphone, no desktop audio.

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

Damn, how come it works for you, but not for me?
Could I have been doing something wrong?

I've build it form source, selected the game from the list of open apps to stream, selected 720p 30fps quality, and started streaming.
Does the game have to be in windowed/borderless mode? All games that I tested were in Fullscreen mode.

@maltejur
Copy link
Owner

@BulletBlaster see #28 (comment)

@Smoukus I'll see if I can find another fix

@bbaster
Copy link

bbaster commented Jul 31, 2022

@Smoukus I didn't stream any game, I've selected the entire desktop, I also think my issue was different - the screen/application sharing window didn't show up at all, but I fixed it by i think installing xdg-desktop-portal-gtk
I'm also using KDE Plasma on Arch, maybe check if it works on it, does screensharing on Qutebrowser work? (It uses the same engine as this application)

@maltejur I got it to work by following the steps in this comment, maybe add it to the README?

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

@Smoukus I didn't stream any game, I've selected the entire desktop, I also think my issue was different - the screen/application sharing window didn't show up at all, but I fixed it by i think installing xdg-desktop-portal-gtk I'm also using KDE Plasma on Arch, maybe check if it works on it, does screensharing on Qutebrowser work? (It uses the same engine as this application)

Would you mind posting a screenshot of the window that lets you choose to select entire dekstop? I could only select specific apps, didn't see desktop anywhere.
xdg-desktop-portal-gtk is already installed though.

@bbaster
Copy link

bbaster commented Jul 31, 2022

@Smoukus Are you using KDE Plasma? That window had a KDE icon, so I think it's not a part of the xdg-desktop-portal-gtk package, here's how the screen sharing window looks like for me (it says Konsole because I launched discord-screenaudio from the terminal):

Screenshot_20220731_195619

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

@BulletBlaster damn, I don't have that option :(
I am on GNOME however.
This is how it looks for me:
image
image

In my case I selected NieR Replicant, and pressed on Start Stream.

@bbaster
Copy link

bbaster commented Jul 31, 2022

@Smoukus Just tested with a single window, works perfectly fine too, doesn't seem to matter whether I run it with QTWEBENGINE_CHROMIUM_FLAGS=--enable-features=WebRTCPipeWireCapturer or not, I'll also install GNOME to see if it works there too, in the meantime could you check if it's working on KDE Plasma?

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

@Smoukus Just tested with a single window, works perfectly fine too, doesn't seem to matter whether I run it with QTWEBENGINE_CHROMIUM_FLAGS=--enable-features=WebRTCPipeWireCapturer or not, I'll also install GNOME to see if it works there too, in the meantime could you check if it's working on KDE Plasma?

I don't know how can I check with KDE Plasma because I am very new to Linux, and am afraid of messing things up.
I've read that it isn't really good to have 2 DE's installed.
I am glad that it works for you on KDE at least.

@bbaster
Copy link

bbaster commented Jul 31, 2022

@Smoukus Also the window you're showing is for sharing sound, after it a screen sharing window should apppear

Just installed GNOME and I seem to be having the same issue as you, I'll check in the Arch Wiki to see if something is misconfigured

You're new to Linux and using Arch? How did you install it? Nothing should break if you have 2 DE's installed, you might see some errors but they're mostly meaningless, to install Plasma run sudo pacman -S plasma-meta plasma-wayland-session in a terminal, then log out and when logging in before typing your password (but after selecting your account) click on the gear and select "Plasma (Wayland)".

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

Unfortunately that is the only window that I get. As soon as I choose the game in that window, stream starts, and I can't choose anything else. The only available option is to "end stream".

I am on EndeavourOS, and that is basically Arch with an installer.

@hotburger
Copy link

Can confirm that this works on gnome wayland. I am just using the flatpak release and manually setting that variable.

@bbaster
Copy link

bbaster commented Jul 31, 2022

@Smoukus Please don't say in the future that you are using Arch, while Endeavour is based on it it's not the same distribution

I also got screen sharing to work on GNOME, you need to install the xdg-desktop-portal-gnome package and then run systemctl --user restart xdg-desktop-portal, didn't test sound sharing on GNOME but I don't see why it wouldn't work

@Smoukus
Copy link

Smoukus commented Jul 31, 2022

@Smoukus Please don't say in the future that you are using Arch, while Endeavour is based on it it's not the same distribution

I also got screen sharing to work on GNOME, you need to install the xdg-desktop-portal-gnome package and then run systemctl --user restart xdg-desktop-portal, didn't test sound sharing on GNOME but I don't see why it wouldn't work

Okay, will test it out with xdg-desktop-portal-gnome package. Will post results.

How is Endeavour different than Arch though? (I am genuinely curious)

EDIT: xdg-desktop-portal-gnome was the solution. It is exactly as you said @BulletBlaster . First window is sound, and then comes another window for window/screen.
Thanks a lot!

EDIT2: can confirm that also the AUR Version works on Gnome Wayland with audio and screen.

@maltejur
Copy link
Owner

Oh damn, didn't realize there was a difference between xdg-desktop-portal-gtk and xdg-desktop-portal-gnome. Thanks a lot @BulletBlaster and @luke876 for helping here.

@D3SOX
Copy link
Contributor

D3SOX commented Jul 31, 2022

I can confirm that sharing a screen or application windows now work for me with v1.2.0 on KDE Plasma Wayland with xdg-desktop-portal-kde

@Taza53
Copy link

Taza53 commented Aug 17, 2022

I can confirm that sharing a screen or application windows now work for me with v1.2.0 on KDE Plasma Wayland with xdg-desktop-portal-kde

same

@mbenlioglu
Copy link

Any progress on getting this working on X11?

@maltejur
Copy link
Owner

It seems there is some work happening in QtWebEngine:

https://bugreports.qt.io/browse/QTBUG-112142

When/if that work is merged and released, I will probably be able to implement a window/screen selector for X11.

@jvyden
Copy link
Contributor

jvyden commented Oct 26, 2023

Looks like it won't land in Qt5:
image

@maltejur
Copy link
Owner

maltejur commented Dec 16, 2023

It seems there is some work happening in QtWebEngine:

https://bugreports.qt.io/browse/QTBUG-112142

When/if that work is merged and released, I will probably be able to implement a window/screen selector for X11.

Just a quick update, this has been merged and could make it into Qt 6.7 (Release date: 2024-03-19). So once Qt 6.7 is hopefully available on Arch in march/april, I'll start working on this feature. That date also coincides pretty nicely with the Plasma 6 release in february, so I'll be able to move the whole client to Qt 6.

@ReazerDev
Copy link

ReazerDev commented Dec 16, 2023

It was merged after the feature freeze for 6.7 and it's scheduled for 6.8 (September 2024)
Screenshot_20231216-160805~2

EDIT: It was moved to 6.7.0 Beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants