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

overhaul & improve Linux screenshare #489

Merged
merged 52 commits into from
Apr 17, 2024

Conversation

catgirlcataclysm
Copy link
Contributor

@catgirlcataclysm catgirlcataclysm commented Apr 7, 2024

basically what the title says. streaming is now smooth on linux. finally.

TODO before merge:

  • Fix resolution and framerate selection
  • Fix bug that stops users from changing the streamed window (created by allowing resolution changes)
  • Fix bug where changing windows allows you to lower the fps but not raise it
  • Beautify modal for starting a stream(show preview and content type as a dropdown)
  • Fix issue where stream quality overlay does not update to show the current quality of the running stream
  • Enable contentHint and allow the user to choose between "motion" and "detail"
  • Allow users to start streams while watching another stream

@catgirlcataclysm
Copy link
Contributor Author

FINALLY
im bad at regex

@NextWork123
Copy link

NextWork123 commented Apr 7, 2024

Seem having issues with these things i compile with your pull request and i start and it crash i tried too to start on terminal and i have an error "SIGSEGV (Address boundary error)" with terminal it loading and when it loads two second and crash again :/

i only merged your pull on the fork i do

oh and i found another issue:

[27296:0100/0000.225934:ERROR:broker_posix.cc(41)] Recvmsg error: Connection broken by correspondent (104)

update: i fucked my electron installation now is working

package.json Outdated Show resolved Hide resolved
src/main/index.ts Outdated Show resolved Hide resolved
@IlChitarrista
Copy link

Okay, I'm testing this, the original theory I had on #191 (comment) seems to be correct.

So, what this MR does is remove the artificial limit to 2500kbps.
On my system the limit, as shown by the Bitrate(Target) in the debug menu, is not updated to 80.000kbps but only 4623 with some variability.
This improves things as now 1440p can hold 10-20fps and 1080p almost locked to 30 but it's still being throttled at some other level.

The workaround (moving the cursor) to temporarily prompt updates still gives some result but it's not needed anymore on my system, at 1080p.

The next step would be figuring out why the resolution selector is not working properly as setting the resolution to one that can be handled and supported by most clients, especially when not using nitro, would totally solve this on sufficiently powerful connections.

@Vendicated
Copy link
Member

On my system the limit, as shown by the Bitrate(Target) in the debug menu, is not updated to 80.000kbps but only 4623 with some variability.

perhaps because it can only keep up with that much bitrate? iirc hardware encoding may not work with nvidia gpus, so you may be stuck with software encoding and thus have a bottleneck

@IlChitarrista
Copy link

Also, on a secondary note, there seems to be something off about multimonitor setups on Wayland.
If I disable the secondary monitor I get ~25fps at 1440p. It seems that, on multimonitors, the primary one gets somehow throttled when there isn't cursor movement.
Lastly, I think we should also look into contentHint.

Still, once this is ready, it will be a nice step in the right direction.

@catgirlcataclysm
Copy link
Contributor Author

On my system the limit, as shown by the Bitrate(Target) in the debug menu, is not updated to 80.000kbps but only 4623 with some variability.

perhaps because it can only keep up with that much bitrate? iirc hardware encoding may not work with nvidia gpus, so you may be stuck with software encoding and thus have a bottleneck

I've just been able to recreate the same problem. I don't exactly know what's caused it, but it's definitely not limited to one client.

@IlChitarrista
Copy link

IlChitarrista commented Apr 7, 2024

Also, on a secondary note, there seems to be something off about multimonitor setups on Wayland. If I disable the secondary monitor I get ~25fps at 1440p. It seems that, on multimonitors, the primary one gets somehow throttled when there isn't cursor movement. Lastly, I think we should also look into contentHint.

Still, once this is ready, it will be a nice step in the right direction.

The cursor issue isn't present when streaming an individual app.

src/main/index.ts Outdated Show resolved Hide resolved
src/main/index.ts Outdated Show resolved Hide resolved
src/main/index.ts Outdated Show resolved Hide resolved
src/main/index.ts Outdated Show resolved Hide resolved
src/main/index.ts Outdated Show resolved Hide resolved
kaitlynkittyy added 2 commits April 7, 2024 17:55
@catgirlcataclysm
Copy link
Contributor Author

I still want to try and raise the bitrate, as its somehow locked at 4696kbps right now. and during one of my tests it randomly jumped to 8000kbps

@catgirlcataclysm
Copy link
Contributor Author

catgirlcataclysm commented Apr 7, 2024

I still want to try and raise the bitrate, as its somehow locked at 4696kbps right now. and during one of my tests it randomly jumped to 8000kbps

this has since been resolved, everything looks good to me

@Curve
Copy link
Member

Curve commented Apr 16, 2024

Any support for soundsharing on MacOS?
It would be nice to be able to pick from the list of Mic-in inputs to share.

This would probably require additional routing through BlackHole, or is there a system API for this? I vaguely remember something

@EndenDragon
Copy link

EndenDragon commented Apr 16, 2024

not in this pr, no. I can look into it now that I have a macos device to test on, but I cannot confirm anything, as I have absolutely no idea how that would be done.

Thank you!

This would probably require additional routing through BlackHole, or is there a system API for this? I vaguely remember something

I use loopback, but that's the plan!

@lewisakura
Copy link
Member

Can you build this PR as a Flatpak (https://github.com/flathub/dev.vencord.Vesktop) and validate it works? We have a decent amount of users using it via Flatpak now so it needs to be tested

@catgirlcataclysm
Copy link
Contributor Author

Can you build this PR as a Flatpak (https://github.com/flathub/dev.vencord.Vesktop) and validate it works? We have a decent amount of users using it via Flatpak now so it needs to be tested

I also use it as a flatpak, and I just confirmed that I am able to build and run it as a flatpak, with the streaming modifications. I didn't do any sort of rigorous testing, but I did confirm that it works.

src/renderer/components/ScreenSharePicker.tsx Outdated Show resolved Hide resolved
src/renderer/components/ScreenSharePicker.tsx Outdated Show resolved Hide resolved
src/renderer/components/ScreenSharePicker.tsx Outdated Show resolved Hide resolved
src/renderer/components/ScreenSharePicker.tsx Outdated Show resolved Hide resolved
src/renderer/components/ScreenSharePicker.tsx Outdated Show resolved Hide resolved
src/renderer/components/screenSharePicker.css Show resolved Hide resolved
src/renderer/patches/screenShareFixes.ts Outdated Show resolved Hide resolved
@Vendicated
Copy link
Member

thanks all for working on this!!

@Vendicated Vendicated changed the title Rework entire screensharing code to allow for proper functioning of streams overhaul & improve Linux screenshare Apr 17, 2024
@Vendicated Vendicated merged commit 8eaa520 into Vencord:main Apr 17, 2024
1 check passed
@PolisanTheEasyNick
Copy link
Contributor

Thank you all for work and help ^-^

@BuonHobo
Copy link

When will this reach the flathub version?

@Venefilyn
Copy link

When will this reach the flathub version?

When a new release is pushed for Vesktop itself, which needs to happen first, you can check the updates on the flathub repo

https://github.com/flathub/dev.vencord.Vesktop

@Vendicated
Copy link
Member

Vendicated commented Apr 18, 2024

expect a release some time in the next few days. still want to land a few things in vesktop before making it, and maybe experiment with electron 30

if you want new changes earlier, you can always build from source following the instructions in the readme

@TheRsKing
Copy link

How do i build the flatpak from source

@Venefilyn
Copy link

Venefilyn commented Apr 18, 2024

How do i build the flatpak from source

@TheRsKing https://github.com/Vencord/Vesktop?tab=readme-ov-file#building-from-source


For others who want this ASAP please follow this link above and refrain from more offtopic conversations. Lots of people who follow this PR and if possible lets not spam everyone's inboxes. If you run into issues there's the Discord and GitHub issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.