#๐Ÿ–ฅ-vesktop-development

1 messages ยท Page 2 of 1

azure verge
#

oh this is new

#

idk what caused it to start logging

#

but uh

#

this now repeats semi-regularly while i stream with hardware accel stuff enabled

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
marsh hinge
simple groveBOT
humble mortar
#

were you ever able to do this

hot juniper
simple groveBOT
#

I may have phrased that wrong. Discord is Electron + a bunch of proprietary stuff, such as their rich status API and screen sharing (which is why it didn't work with Wayland and why it doesn't have sound in the official client). I would assume (I am assuming here) that this would be another custom component that would instead have to be implemented manually.

upper pine
# hot juniper

Is that what you expected? Or did you expect it to be mapped different?

#

We currently map the ports by their name (i.e. FL -> FL)

#

Or did you expect this mapping?

#

If so, I'll have to adjust the mappings a bit

upper pine
#

Yes to what xd

hot juniper
#

idk what I was expecting

hot juniper
simple groveBOT
simple groveBOT
humble mortar
#

this is the mapping that I got ๐Ÿ’€

simple groveBOT
#

Might be a long-standing chromium bug that we could work around

Okay, I might have something interesting to note about this.
I've found a way to push the framerate up from ~5 to ~25 and this workaround would explain what @MiMillieuh was initially seeing, i.e., focus playing some sort of role.
This is unrelated to hardware acceleration so if the maintainer agrees we could move this to a new issue.

When screencasting, the fr...

#

Might be a long-standing chromium bug that we could work around

Okay, I might have something interesting to note about this. I've found a way to push the framerate up from ~5 to ~25 and this workaround would explain what @MiMillieuh was initially seeing, i.e., focus playing some sort of role. This is unrelated to hardware acceleration so if the maintainer agrees we could move this to a new issue.

When screencasting...

vernal lintel
#

i feel like it would make more sense to make a discord thread for this

azure verge
#

that sounds like a good idea tbh

simple groveBOT
#

Might be a long-standing chromium bug that we could work around

Okay, I might have something interesting to note about this. I've found a way to push the framerate up from ~5 to ~25 and this workaround would explain what @MiMillieuh was initially seeing, i.e., focus playing some sort of role. This is unrelated to hardware acceleration so if the maintainer agrees we could move this to a new issue.
When scr...

#

Might be a long-standing chromium bug that we could work around

Okay, I might have something interesting to note about this. I've found a way to push the framerate up from ~5 to ~25 and this workaround would explain what @MiMillieuh was initially seeing, i.e., focus playing some sort of role. This is unrelated to hardware acceleration so if the maintainer agrees we could move this to a new issue.
...

simple groveBOT
#

Might be a long-standing chromium bug that we could work around

Okay, I might have something interesting to note about this. I've found a way to push the framerate up from ~5 to ~25 and this workaround would explain what @MiMillieuh was initially seeing, i.e., focus playing some sort of role. This is unrelated to hardware acceleration so if the maintainer agrees we could move this to a new issu...

simple groveBOT
simple groveBOT
upper pine
simple groveBOT
simple groveBOT
#

From the people i tested with, they didn't perceive much of a difference with a video playing or not. I didn't collect any specific numbers but I was told that it looked to be around 10-15fps no matter what.

Interesting, what hardware are you using?
I've also noticed that when there isn't much of a difference per-frame the stream will be decently smooth already; this only seems to help on games with a lot of per-frame differences.

This is a simpler example with no camera, then camera...

simple groveBOT
simple groveBOT
#

not completely sure. i'm using wayland (experimental) on linux mint

Wayland support on Linux Mint is still currently highly experimental and prone to breakage. Make sure to run a stable version of provided software before issuing such bug reports, and bugs related to Linux Mint itself should be reported to the Linux Mint project.

simple groveBOT
#

I have some new findings; I've done some tests while in debug mode for the screenshare.

My current theory is that the fundamental issue that drops the framerate is hitting the bitrate cap; this is presented as two independent components:

  • max bitrate is set at 2.500kbps
  • resolution setting is broken (#463) sending more data than required

So, first of all, in Vesktop's [source code](https://github.com/Vencord/Vesktop/blob/4abae9c7082081dcae667916d9608e23adf688a9/src/renderer/componen...

simple groveBOT
azure verge
vernal lintel
#

i already did :p

azure verge
#

okay good

#

i have no words

#

if that's the issue that is wack as hell

#

(obv its not the only issue i think because its recreatable in other screen recording apps on electron/chromium)

vernal lintel
#

tbh i just took the bitrate values from discord desktop lol

azure verge
#

that's probably a good idea

#

to avoid discord from rate limiting

#

but uhhh

#

we may want to look into raising that bitrate limit from 2.5kbps

#

cuz rn chromium is still limited even tho you used 80kbps according to that issue

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
#

Just want to add that I'm runnning EndeaviorOS (Arch linux based), with Flatpak Vesktop 1.5.1 and fcitx5 5.1.8-1 installed from pacman, I'm able to use IMEs inside the app with the flag

/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=startvesktop dev.vencord.Vesktop --enable-wayland-ime

So the bug about chromium flags not being passed mentioned in previous replies might have been fixed.

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
azure verge
#

so uh

#

progress has been made

#

im going to try and rewrite parts of the screensharing logic in the RTCRtpSender API

#

doing that should hopefully fix the framerate issues

#

Ive been talking with IlChitarrista

#

this seems to be the API that discord desktop uses

#

which would explain a lot

simple groveBOT
azure verge
elder epoch
#

does vesktop have a custom navigator? (browser thingy thing i forgot the name of)

#

agent*

vernal lintel
#

it uses the default chrome user agent

elder epoch
#

hmmm

#

is there any way to indicate that a user is on vesktop

vernal lintel
#

why

elder epoch
#

i was going to attempt to make a fork that adds vesktop to platformindicators because currently it shows all vesktop users are on web which is technically true, (also 99% of the time i see a web icon its either a scammer or someone doing dev work (or vesktop)) venniecozycat

#

idk if that's impossible to perform due to privacy reasons or etc

elder epoch
simple groveBOT
hot juniper
# elder epoch aww

solution: make pr to mark vesktop as desktop platform (and watch it get denied)

azure verge
#

@vernal lintel the issue with screensharing is believed to be because
this is applied to the first connection through portals
which is then broken
and then a new connection is made to start the stream

#

i believe if we were to either re-apply or just only apply those here before the callback, it may work

#

if not we may have to look into creating an instance of RTCRtpSender

#

and apply the settings to that

simple groveBOT
vernal lintel
#

that's in nodejs

azure verge
#

yeah

vernal lintel
#

it doesn't support any of that stuff

azure verge
#

we've looked around a bit more

#

we have a few options that make sense

#

we either make a new instance of RTCRtpSender

#

and use that

#

or we monkeypatch the one electron uses by default somehow

azure verge
#

not sure how to make electron use it for a WebRTC stream though

azure verge
#

the fps holds high until the bitrate cap of like 2500kbps gets hit

#

and then it throttles

hot juniper
#

2500kbps bitrate limit husk

azure verge
#

yeah its a hardcoded limit in chromium

hot juniper
#

what the FUCK

azure verge
#

it can be bypassed by setting maxBitrate

#

which isnt correctly being applied

hot juniper
#

how do you do that

#

oh

azure verge
#

once its correctly applied

#

itll work

#

hopefully

#

alright

#

does anyone know where RTC connections are made

#

in this code

azure verge
#

@vernal lintel im really sorry to bother you again i just cannot for the life of me understand what api this connection is from/ what it even is and how it can be modified

vernal lintel
#

discord

azure verge
#

yea but like

#

is it an rtc connection?

#

or is it some sort of proprietary thing that makes no sense to anyone

vernal lintel
#

you tell me

#

look at it with the debugger or log it and see

azure verge
#

sob

#

alright

#

i just wondered if you knew because well

#

yk

#

you wrote it lmao

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
#

Describe the bug
Apps do not appear in my profile through Discord RPC. They do appear when using the regular discord client.

To Reproduce
Steps to reproduce the behavior:

  1. Launch Vesktop
  2. Launch Minecraft
  3. Check the area on Vesktop where the "Currently Playing" should appear
  4. Nothing is there

Expected behavior
Expected to see Minecraft Java in the currently playing area on discord.

Screenshots

**Desktop (please complete the following information)...

simple groveBOT
vernal lintel
#

that's just not true??

hot juniper
#

since when husk

#

when was this changed

#

this was added in some update i never read about afaik

simple groveBOT
hot juniper
#

@vernal lintel am I getting it mixed up with the web arrpc

vernal lintel
#

arrpc has supported process scanning forever

hot juniper
#

huh i didnt know

#

so in that case

#

how does it detect what processes are registered?

#

there's no settings in vesktop for it

#

figured it out

#

i will now document my findings

#

@vernal lintel you will husk so hard when you read what i discovered

simple groveBOT
#

Hi, sorry about that earlier. I was (previously) unaware that this functionality existed in arRPC. After you read this, you will probably understand why I wasn't even aware this was a feature.

I have done some research, and I think I might be able to explain why Minecraft doesn't get registered through arRPC.
Looking at https://github.com/OpenAsar/arrpc/blob/main/src/process/index.js#L43 we see that it only strictly checks the [full process path on Linux](https://github.com/OpenAsar/arrpc...

hot juniper
#

your horror has been delivered

vernal lintel
#

why post that here and not arrpc repo

hot juniper
#

i will file there too now

#

or i could attempt to fix it

#

should I try to fix it myself?

hot juniper
#

fuck just remembered wmic is depreciated

simple groveBOT
hot juniper
#

love shit not working for no reason.

simple groveBOT
#

I'm new to the project, and would love to try to set the contentHint to "motion" for the mediaStreamTrack in addition to the stream settings, but I haven't found a function in vesktop / vencord. This would favour available bitrate to be used for new frames instead of quality on existing ones.

Is there a way to set those?

I've been experimenting with setting not just contenthint, but fixing the ...

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
azure verge
#

damn
always sad seeing new messages here and its just "star added"

#

i always think someone has some new crazy stuff LMAO

boreal warren
#

That's what I've been saying for ages

simple groveBOT
simple groveBOT
simple groveBOT
tulip hare
simple groveBOT
simple groveBOT
simple groveBOT
#

the web app loads krisp as wasm module, while the desktop uses a native node module for it. that's why I asked whether it works in web browser. whether it works on discord desktop is irrelevant, because vesktop also uses the wasm module, just like web. or rather, vesktop doesn't even handle krisp itself, it's just purely discord that does it

ah i thought they were referring to the desktop app.

azure verge
simple groveBOT
#

I'm new to the project, and would love to try to set the contentHint to "motion" for the mediaStreamTrack in addition to the stream settings, but I haven't found a function in vesktop / vencord. This would favour available bitrate to be used for new frames instead of quality on existing ones.

Is there a way to set those?

Oh and I didn't fully answer this, I understand what you mean, but I be...

simple groveBOT
hallow trail
#

Anyone got a lead on that 2.5kbps value chromium sets?

#

I can just patch and rebuild it for a quick test of the encoder

#

But I did not get much on my own searches of the codebase, it's a pretty thick tome

vernal lintel
#

@azure verge

azure verge
#

aAH

#

hi

hallow trail
#

Heyo

#

I can spare the compile on my gentoo slab

#

And probably whip up a PKGBUILD for arch use

azure verge
#

ive been trying to test it but GOD trying to worm through how id remake the api on vesktop is a pa i n

#

so

azure verge
hallow trail
#

chromium

#

Gonna just patch at the damn source and see

azure verge
#

oh

#

lmao

#

uhhh

#

im not sure where it's set in chromium

#

but yeah basically

#

if you test a stream, in the debug menu itll show a fuck ton of stats

#

the framerate is stable 30 with hw accel

#

but the framerate drops like a rock as soon as the bitrate goes above 2500kbps(idk if its 2.5 or 2500 the number is different in different places) until the bitrate goes down and then the framerate goes back up

hallow trail
#

Cloning repo to search on my own disk

azure verge
#

alright !

azure verge
#

that'd be what I do

simple groveBOT
hallow trail
#

media/video/vpx_video_encoder.cc

#

Worth looking at

#

media/base/video_encoder.cc

#
uint32_t GetDefaultVideoEncodeBitrate(gfx::Size frame_size,
                                      uint32_t framerate) {
  // Let's default to 2M bps for HD at 30 fps.
  const uint32_t kDefaultBitrateForHD30fps = 2'000'000u;
  const uint32_t kHDArea = 1280u * 720u;
  const int kMaxArea = 8000 * 8000;
  const uint64_t kMinBitrate = 10000;
  const uint64_t kMaxBitrate = std::numeric_limits<uint32_t>::max();

  // Scale default bitrate to the given frame size and fps
  base::ClampedNumeric<uint64_t> result = kDefaultBitrateForHD30fps;
  result *= std::clamp(framerate, 1u, 300u);
  result *= std::clamp(frame_size.GetArea(), 1, kMaxArea);
  result /= kHDArea * 30u;  // HD resolution, 30 fps
  return std::clamp(result.RawValue(), kMinBitrate, kMaxBitrate);
}```
azure verge
#

interesting

#

im pretty sure i just need to edit the bitrate through the RTCRtpSender

#

but its wack

#

you could try and build with that file edited

hallow trail
#

Why doesnt the call just normally work, we enter all the correct parameters

Are we not entering them into RTCRtpSender and instead something else?

#

Give me a primer, all this is new

#

What function in that class initiates the stream?

azure verge
#

which class?

#

most of the screensharing logic is in src/main/screenShare.ts

#

but

#

the bitrate is applied in src/renderer/components/ScreenSharePicker.tsx

#

the issue (i believe) is that a portal is used to get access to the screen

#

that connection is then modified

#

and then closed

#

and another connection starts

#

and that one no longer has the modified settings

#

i could be wrong

#

that's just a hypothesis

simple groveBOT
azure verge
#

this is helpful and may have more useful information on this topic

#

this is really interesting

#

there are like a billion RTC handshakes

#

the bitrate gets set to 8000000

#

and then

#

undefined

#

also the discord website forces it to 30fps due to it not being registered as desktop and yk

#

being registered as web discord

#

at least

#

i assume that's why it does it

#

this is something of note btw

azure verge
azure verge
#

uhm

#

and then instantly

#

wtf

#

and yep

#

bitrate undefined again

#

oh my god

#

the first call to start stream

#

gives

#

720p30

#

at 2.5mbps

#

that's the fucking problem i think

#

wait no what the hell is that stream

#

is it my friend's camera?????

#

i am so confused lmao

#

okay so resolution is instantly removed

#

odd

#

for a basic solution

#

if may be worth making a button or something

#

to see if we can force reapply

#

the bitrate

simple groveBOT
#

i recommend moving this discussion to the vesktop development channel on our discord server

How does one actually get access to talk in the dev channels? I only see core and plugin dev and both say I dont have permission to send messages in channel. There does not appear to be a role that's self assignable for developers/contributors and if we have to jump through several hoops just to discuss on discord it might just be easier to discuss our findings on th...

ionic gust
azure verge
#

i mean like

#

i get it

#

if you're not super familiar with discord but you know electron and you know how to fix the issue but

ionic gust
#

i still dont fully think WebRTCMediaEngine issues lie at an electron issue, but they very much could which is why discord just opted to make discord_voice

azure verge
#

true

#

wait

#

so how much does discord_voice implement

#

isnt it just voice stuff

#

or is it literally like

#

a shit ton of webrtc

ionic gust
#

yes

azure verge
#

oh god

ionic gust
#

the first issue is its a partial black box because no one has cared to reverse engineer it, which i dont blame them

azure verge
#

oh g o d

#

i hope we dont have to update venmic to patch webrtc to force bitrates and shit

#

lmao

#

heh

#

welp gonna keep working on it eventually

ionic gust
#

discord_voice has arbitrary limits that would need to be patched out if anything if anyone cared enough but no one does

#

because the big one is stereo voice which has been more of a nuisance than used for constructive purposes

azure verge
#

may i ask what you mean by it being a nuisance

ionic gust
#

theres a "scene" of mostly annoying kids that use stereo voice to be as loud as possible, known as "packing"

azure verge
#

oh god

#

that sounds like a mess

ionic gust
#

lightcord used to be used for it after they patched stereo voice in discord_voice because of lightcord version pinning native modules

#

but anyways

azure verge
#

interesting

ionic gust
#

discord_voice also handles special encoders as well like av1

#

and hardware accelerated encode via cuda, nvenc and amf

#

which all have kamoji strings for the respective encoders

azure verge
# azure verge

oh uhh i just kind of wondered if you had any idea if you knew about this at all because you seem to kind of understand webrtc
it seems to reset the streams to default settings about 1-2 seconds after they start

azure verge
ionic gust
azure verge
ionic gust
#

like the fact that if you're already watching a stream and you try and screenshare for whatever reason the order of your packets get flipped

#

and thus your screenshare doesnt start properly

azure verge
#

what the fuck

#

what the actual fuck

#

how the hell do you program a bug like that into existence

ionic gust
#

vanilla bug btw

azure verge
#

that seems like it had to have been

#

like

#

put there

#

like

#

i mean obv it wasnt

#

but

#

how the hell

ionic gust
#

ive tried to fix it and have no idea where the fuck to even start

azure verge
#

yeah that's

#

reasonable

#

god i am

#

honestly like

#

so fucking confused as to how to start even trying to fix this issue

#

because i dont know why it's un-applying

#

for all i know it could be discord's servers overwriting something but that wouldn't explain setting resolution to undefined

ionic gust
#

ive also tried to fix resolution being wrong and have gotten nowhere with that

#

changing the values just changed them in the print and the actual data sent had no effect

#

not even the "720p 30 FPS" label changed

azure verge
#

interesting

#

the label is different for me

#

its whatever you set it to in vesktop

ionic gust
#

or i mightve gotten that to change at one point idr

azure verge
#

but the actual streamed res is

ionic gust
#

this was like, a year or two ago so

azure verge
#

i have a 1440p monitor

#

discord streams at 1440p no matter what

#

and 30fps

#

its really weird

#

also low as shit bitrate

#

with the setting set to maintain-quality

#

so it

#

drops to like 3fps

#

instead of looking bad

#

this debug menu is super helpful

#

it gets throttled if it goes above 2500kbps

#

and instantly gets the framerate lowered to hell and back

ionic gust
#

ill see what happens on native

azure verge
#

btw

#

h264 is used if hw accel is found

#

if not disc uses vp8

#

afaik

#

idk when av1 is used

azure verge
#

i havent tested tho

ionic gust
#

im on windows so

azure verge
#

oh gl

ionic gust
#

ah cool its broken

azure verge
#

whar

ionic gust
azure verge
#

bruh ๐Ÿ˜ญ

#

that could've been quite helpful

ionic gust
azure verge
#

interesting

ionic gust
#

we love 10p5fps

azure verge
#

omfg

#

okay

#

the debug menu works on linux

#

but

#

screensharing doesnt

ionic gust
#

actually

#

i think i know why its "broken"

#

i purposely disabled voice hooking to stop stacktrace polution but i might need to disable that patch

azure verge
#

ooh

#

possible

ionic gust
#

nvm its just broken ๐Ÿ˜”

azure verge
#

damn

#

i hopped on xorg to fix streaming

#

lemme check now

#

discord broke it

ionic gust
#

aha

#

it doesnt update if no one's watching

#

which makes sense

azure verge
#

ohhhhhh

#

interesting

#

it updates on vesktop

#

maybe that has some wack random shit to do with it

ionic gust
azure verge
#

oh??

#

not a fixed target??

#

also h265????????

ionic gust
#

nope its fluxuating a lot but staying around 7.5k

azure verge
#

discord on windows is so weird

azure verge
ionic gust
azure verge
#

ahhhh

ionic gust
#

but also thats only to the voice server

#

itll transmit back remuxed into like h264

azure verge
#

for reference

ionic gust
#

or not

#

i guess to web it will

#

but desktop -> desktop its still h265

azure verge
#

i turned a 290mb file from h264 into h265 with ffmpeg

#

and it

#

went to 9.7

#

mb

ionic gust
#

yeah

azure verge
#

like holy hell

ionic gust
#

the problem is most browsers dont and wont officially support h265/hevc playback though because of licensing

azure verge
#

which is annoying

ionic gust
#

which is why google is trying to push av1 but its still too early for support as it requires hardware decode

azure verge
#

"ooh look at us we made a good thing but made it a hell of a lot harder for anyone to use it"

azure verge
#

i mean

#

vaapi on linux and whatever shit windows has

#

mesa almost has full av1 support

simple groveBOT
azure verge
#

almost

#

its still early

#

i mean it works but idk how well

#

probably could be somewhat backported

ionic gust
#

gonna try enabling the av1 experiment even though i think its only meant for nvidia cards

azure verge
#

yep

#

almost

#

instantly after starting a stream

ionic gust
azure verge
ionic gust
#

nothing, its still just h265

simple groveBOT
azure verge
azure verge
#

god i hate webpack

ionic gust
#

thats the logger class itself

azure verge
#

its the squiggle line that the console pointed to

#

yeah

#

thought so

#

i have NO idea how to read minified code

ionic gust
#

findByCode("UnifiedConnection")

azure verge
#

in console?

ionic gust
#

actually that prob wont work as well cause i dont think that gives module id nvm

azure verge
#

oh lol

#

eh findbycode isnt defined in console anyways
i probably should have done it somewhere else but debugging this shit is wack to me

ionic gust
#

old is constraints max width adn height

#

new is encodingVideoWidth/Height

azure verge
#

whar

#

ooh

#

i wonder what i can do with this

#

hehhehehe

#

i didnt realize i could use findbycodelazy to grab the BaseWebRTCConnection

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
azure verge
#

oml lmao

#

the stream itself is UnifiedConnection(stream) on every device

#

that may be useful

simple groveBOT
simple groveBOT
ionic gust
#

that stream class is not used on desktop when discord_voice is available

simple groveBOT
azure verge
#

that's sustainably the same

#

and i feel it could reliably be used

#

as if we got discord_voice

#

well

#

we would rewrite streaming anyways

humble mortar
#

@upper pine did some testing and it appears to only scuff out when switching the audio output of the specific program (via plasma settings in my case) so this is very much an edge case

upper pine
humble mortar
#

also changing the audio output twice on the streamed application breaks venmic entirely and does not connect to any application until vesktop is restarted

simple groveBOT
#

Is your feature request related to a problem? Please describe.
I tried vesktop as it's being advertised as a lightweight discord client without having to worry about potential issues with discord's TOS. But then I noticed that by default, we can stream in higher resolution then 720p even if I am not having any nitro subscription. This could be easily detected by discord and I think this could lead to my account being banned. But I still want to stream my screen in 1080p with 5ps (I don't...

simple groveBOT
#

what's the point of ๐Ÿ˜• reacting? i was simply stating how it is. yes, they could detect streaming with a quality you're not supposed to. but they could also just push code that detects vencord and other client mods. in fact, they already have such code. it detects betterdiscord, vencord, and a few other mods. but it is only used to disable error reporting for such devices and for nothing else

discord has nothing to gain and so much to lose by banning people who use mods. millions of people ...

#

Yeah you are absolutely right. My reaction was not meant to be provocative in any way. Sorry if it happened to be somewhat provocative for you. It was more of a reaction that I was not satisfied with the possibility of 5fps being disregarded completely. I mean in my opinion it would be a great option, even if it's hidden somewhere in the settings for rare users of 5fps like me. Just so that I would feel better not using any potential bandwidth that I am not paying for. I agree with you that t...

simple groveBOT
#

Yeah you are absolutely right. My reaction was not meant to be provocative in any way. Sorry if it happened to be somewhat provocative for you. It was more of a reaction that I was not satisfied with the possibility of 5fps being disregarded completely. I mean in my opinion it would be a great option, even if it's hidden somewhere in the settings for rare users of 5fps like me. Just so that I would feel better not using any potential bandwidth that I am not paying for. I agree with you that...

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
upper pine
#

Can also not reproduce breaking with changing twice

#

Ohhh

#

Wait

#

I think I might know what's causing it though

#

Are you changing the systems default speakers @humble mortar?

#

Because that might cause problems

upper pine
#

But yeah with whole system audio I can reproduce venmic not sharing an application that is not playing to the default speakers

simple groveBOT
simple groveBOT
#

Describe the bug

It first started with me not being able to view messages in servers/DMs. Tried restarting and it didn't fix so I decided to reinstall.
After I reinstalled it prompted me to login, and I can't log in. so I tried running it through the command line, and it says that I've been rate limited.
This bug only happens on Vesktop and not on the web version of Discord.

To Reproduce

I don't know how to reproduce, it just happened while I was doing something else.

**...

vernal lintel
#

gg

simple groveBOT
azure verge
#

it may be worth it to not crash on failed update check

simple groveBOT
#

Describe the bug
When sharing the screen during high activity the stream turns into what others referred to as "a total slideshow" rather consistently. Notably this does not happen with the regular Discord client.

To Reproduce

  1. Start a stream
  2. Do something where the screen changes a lot, e.g. playing a fast-paced game

Expected behavior
The same streaming experience as with normal Discord, which in my case is smooth even on higher resolutions

**Screensho...

simple groveBOT
#

Describe the bug
when screensharing with a game open then the screensharing is lagging

To Reproduce
Steps to reproduce the behavior:

  1. open Vesktop
  2. Start Screensharing
  3. Open a Game

Expected behavior
that the screensharing is not laggy

Screenshots

Desktop (please complete the following information):

  • OS/Distro: [Arch Linux x86_64]
  • Desktop Environment (linux only): [KDE]
  • Kernel Version: [6.8.2-zen2-1-zen]
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
real glade
#

this is something they used to kinda care about

#

don't seem to anymore though

vernal lintel
#

i have found nothing and like it's been in vencord for ages lol

real glade
#

don't have one sorry
so take it with a grain of salt ig

#

this predates vencord

vernal lintel
#

i take any "fake nitro gets banned" with a massive grain of salt

#

misinfo spread by various people who want to justify their own rules with it

real glade
#

nah this is specifically for screenshare quality

#

not other nitro stuff

vernal lintel
#

so i don't believe anything without proof :p

#

but yeah we've had no issues whatsoever even tho we've had it for more than a year

#

what i don't really understand is why they even let u do it lol

#

why not just add server side check and 403/400 ๐Ÿ˜ญ

real glade
#

how do you 403 over a udp connection silly

#

it's very hard to do with their architecture

real glade
#

and i don't blame you lol

#

i just remember a few incidents so there's a chance i'm wrong

simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
simple groveBOT
#

Is your feature request related to a problem? Please describe.
I can't seem to find anywhere in the git that breaks down where or how Vesktop differs from differs from Vencord. Is it Vencord with better Linux/Wayland support? No idea, that's the vibe I get but it's not made clear anywhere.

Describe the solution you'd like
Something in the Readme that makes it clear what this offers that Vencord doesn't.

Describe alternatives you've considered
I've checked Google and Redd...

humble mortar
#

I'd record a video but ive been experiencing constant random freezes with plasmashell and im too busy IRL to figure it out :p

simple groveBOT
simple groveBOT
simple groveBOT
azure verge
#

okay i may or may not have found something interesting

#

either that or the connection is just unloggable

#

nope

#

alright

#

major progress

#

the stream connection doesnt exist at all

#

until after the stream has started

#

so it cannot be updated

#

this whole function is useless lmao

vernal lintel
#

please read the comments

azure verge
#

i did

vernal lintel
#

it's not useless

azure verge
#

it is where its currently at
the connections array only has one element when its called

vernal lintel
sour muralBOT
# vernal lintel if you're creating a stream connection for the first time, there will only be 1 ...

**ScreenSharePicker.tsx: **Lines 54-83

addPatch({
    patches: [
        {
            find: "this.localWant=",
            replacement: {
                match: /this.localWant=/,
                replace: "$self.patchStreamQuality(this);$&"
            }
        }
    ],
    patchStreamQuality(opts: any) {
        if (!currentSettings) return;

        const framerate = Number(currentSettings.fps);
        const height = Number(currentSettings.resolution);
        const width = Math.round(height * (16 / 9));

        Object.assign(opts, {
            bitrateMin: 500000,
            bitrateMax: 8000000,
            bitrateTarget: 600000
        });
        Object.assign(opts.capture, {
            framerate,
            width,
            height,
            pixelCount: height * width
        });
    }
});
azure verge
#

omg

#

okay new idea time

simple groveBOT
upper pine
azure verge
#

wHAT

#

without that patch

#

the resolution may not be

#

higher than 720p

#

but its actually not just

#

forced to screen res

azure verge
#

to recap

azure verge
#

ahm

#

why is this set

#

oh

#

okay

#

uhhh

#

for testing i want to try something but i have no idea how to do it

vernal lintel
azure verge
#

yeah

#

i think its set for web clients

#

one of my friends has the same streaming issues when they stream from chrome on windows

vernal lintel
#

yeah seems like the code controls it

#

search for it in discord code

azure verge
#

call me dumb but uhhh how bceStupidFrog

vernal lintel
#

ctrl shift f

#

in sources tab

azure verge
#

oh like

#

oh

#

ohh

#

lmao

#

the only occurence

vernal lintel
#

yep that's it

#

check what u is defined at

azure verge
#

god i hate minified code

#

its a fucking nested mess

#

so its equal to e

#

holy shit literally everything in this file takes e

#

omfg

#

literally 99% of the functions in the file

#

including the very first line of the file

#

they all take e

azure verge
#

would that mean its in another file....?

#

okay welp

#

this didnt help

#

interesting

#

its definitely correct

#

same ID

#

just didnt apply

#

(yes i relaunched)

#

this is why i need to learn how the patches work LMAO

vernal lintel
#

with your cursor there it looks like you edited it with devtools lol

#

that doesn't work

azure verge
#

i made an override to the file and relaunched but yeah i assumed it didnt work

#

im gonna make a patch rq

#

although idk where the patch should be called from

#

same place as bitrate i assume

vernal lintel
#

just throw it anywhere for testing, doesn't matter

#

i can give u a patch in a bit (not at my pc rn)

azure verge
#

im gonna test but idk if i can do it properly lmao

#

patch helper is way more useful than i realized tho

vernal lintel
#

but it's really easy like

find: "x-google-max-bitrate",
replacement: {
    match: /"x-google-max-bitrate".concat\(\i\)/,
    replace: '"x-google-max-bitrate".concat(8_000_000)'
}
azure verge
#

are the underscores ignored i assume?

#

just for visual understanding of 8,000,000

vernal lintel
#

you can use underscores as separators in numbers, yes they're ignored

azure verge
#

oki

#

nice

vernal lintel
#

it's the same function as commas in english

#

but comma already has a different function in js so they used _

azure verge
#

ahhhh

#

it worked

#

LETS FUCKING GO

#

YES

vernal lintel
#

remove the second half

#

a === S.Codecs

azure verge
#

it edits stuff there too

vernal lintel
#

oh you also want the b=AS:8000000

#

?

azure verge
#

yeah

vernal lintel
#

so does this patch improve stuff

azure verge
#

a lot of stuff ive seen says it needs both

#

lets tes

#

t

#

gimme a moment

azure verge
#

yes

#

yes it does

#

the only issue now is fuckin

#

res selector

vernal lintel
#

how did u even figure this stuff out

azure verge
#

i dont fucking know

#

i was reading stuff in the webrtc debugger

#

and noticed it was set to 2500 for max bitrate

#

so i set it a fuck ton higher

#

ill find a better setting in a bit

#

but i just set it to like

#

8gbps

azure verge
vernal lintel
#

btw is this using hardware encoding or software?

azure verge
#

hardware

vernal lintel
#

like did u add the vaapi flags too?

azure verge
#

yeah

vernal lintel
#

try without vaapi

azure verge
vernal lintel
#

im curious

azure verge
#

oki

azure verge
#

its not great

#

not as bad as before this whole ordeal tho

vernal lintel
azure verge
#

resolution selection isnt applying

vernal lintel
#

๐Ÿค”

azure verge
#

its the other issue

vernal lintel
#

honestly now i wonder why discord sets max bitrate to 2.5k

#

is this on purpose so you use their desktop app

azure verge
azure verge
#

we definitely should forward this to other clients

#

do you want me to pr with this once i get some better settings?

vernal lintel
#

sure

#

i can help u with it

#

good finding MenheraFlower

azure verge
#

:D

#

i take like 50% credit

#

@broken solstice helped me a good bit

#

alright

#

because the value is in kbps

#

ill set the max to 80,000

#

which would be 80mbps

#

that's what it was set to in your previous code at least

#

well

#

hmm

#

it seems to not use much more than 5mbps so maybe we set it to like 15

#

just to keep it low

azure verge
#

also uhhh

#

@vernal lintel do you think it would maybe be worth it to add this patch to vencord instead of vesktop?

#

it would still apply

#

but it would also help browser users

vernal lintel
#

meh

#

maybe

#

it's a bit meh to have code for the same feature in both codebase

azure verge
#

i meant like

#

not in vesktop

#

just in vencord

#

it'd still be applied to vesktop

#

just

#

also would apply to browser users

vernal lintel
#

i know

azure verge
#

oh

azure verge
#

oh

#

wait

#

what if i just make it a plugin

#

and we make it a core plugin on web clients or something

#

*required

#

not core

#

couldn't remember the word

vernal lintel
#

that would work but it's still meh to have the code fragmented across different codebases

azure verge
#

yeah

#

i know what you mean

#

do you think there's a good way to implement this for browser users?

vernal lintel
azure verge
#

i just imagine like

#

vencord logo on a skyscraper

#

"big vencord"

#

be careful or big vencord will get you

simple groveBOT
real glade
#

cuz 2.5k is probably enough for the free stream qualities

#

and the web client doesn't allow you to change quality

azure verge
#

its almost enough

#

but not perfect

real glade
#

interesting

#

i should really spend some time trying to figure out voice

#

nobody knows how it works fully

azure verge
#

@vernal lintel question about patches

#

actually wait

#

nvm

#

ill just split this into 2 patches

real glade
#

lemme take a look at this webrtc code

#

oh wow

#

there's a lot of options

#

don't think i've ever looked at this before

#

dear god this is terrifying

simple groveBOT
real glade
#

looks like this is where the bitrates are hardcoded

#

wonder if audio could use a bump too

real glade
#

@azure verge you can use \i

azure verge
#

wait does it just

#

select ANY variable

real glade
#

any minified var

#

yeah

azure verge
#

omfg

#

one moment

real glade
#

custom vencor functionality

simple groveBOT
#

Okay, I'm testing this, the original theory I had on https://github.com/Vencord/Vesktop/issues/191#issuecomment-2030694090 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.

Th...

#

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.

#

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.

#

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

simple groveBOT
#

I read over this a few times before making my post. Nothing really answers the question of "why Vesktop?"

The first point is that vencord is pre-installed. To me, that says "you can skip the step of manually having to patch Discord with Vencord".

The second point states it's more lightweight and faster than Discord, but doesn't mention if it's also more lightweight and faster than if I were to just download Discord and then patch it with Vencord myself.

The third point is about Scre...

#

Describe the bug

Vesktop has worked fine for me in the past, and still works fine if I use ethernet or my old Brostrend USB wifi adapter, but I recently got a new wifi card to use instead of the adapter, as it's much faster and I only have ethernet available to me around 70% of the time due to my housing situation. When I use vesktop and enter a call with this new wifi card, the other person in the call will constantly break up, wont hear me while I hear them, and eventually the call...

azure verge
#

@vernal lintel i cannot for the life of me figure out what you mean by this

vernal lintel
#

that line is there twice now

azure verge
#

which line specifically

#

or that entire thing you mean?

vernal lintel
#

yes

azure verge
#

wtf

#

its not for me

#

lemme

#

rm -rf and get a fresh pull

#

omfg

#

its duplicated now

#

welp

#

fixed

simple groveBOT
simple groveBOT
azure verge
#

well

#

@broken solstice figured out the issue with resolution selection not working
at least

#

they found out how to fix it

#

not in code just

#

basically you can do a thing and itll stream at the right resolution

#

(start stream button twice, select application/window, stream, and then close the second portal that opens)

#

framerate is always 30 though

#

and bitrate is still locked to 4696

simple groveBOT
azure verge
#

SHITCORD

#

HAHAHHAHHA

#

I MADE SHITCORD

vernal lintel
#

huh

azure verge
#

1fps

simple groveBOT
vernal lintel
#

so removing those not needed flags fixed the bitrate?

simple groveBOT
azure verge
#

its still

#

iffy here and there

vernal lintel
#

why add this

#

dont

#

theres no reason to enable it

azure verge
#

oh wait really?

#

is it set to that by default

vernal lintel
#

no it isnt

#

but why do you need that flag

#

it just makes electron run in Wayland instead of XWayland

#

Wayland electron still has many issues so making it the default isn't that good

azure verge
#

that's fair

vernal lintel
#

i for one still use it in XWayland cause Wayland electron has positioning issues for me

azure verge
#

okay so

#

when someone starts watching a stream

vernal lintel
#

you dont need to run in wayland for pipewire capturer to work

azure verge
#

it locks the bitrate to 4696kbps

#

it wasnt webrtcpipewirecapturer

vernal lintel
#

interesting

azure verge
#

its such an odd issue

real glade
#

have you searched for that number in the code

azure verge
#

that

#

is a good idea

real glade
#

curious if there's another target/cap anywhere

azure verge
#

nothing

vernal lintel
#

might be on backend

real glade
#

maybe it's 5000

real glade
vernal lintel
#

it seems plausible to limit bitrate

#

otherwise people might send crazy bitrate and maybe crash electron

real glade
#

their rtc workers were not made to handle any more than the 720p web discord streams

azure verge
#

backend limit is 8mbps for 1080p60 afaik

real glade
#

so this could be an rtc worker limit only

azure verge
#

not discord backend

simple groveBOT
azure verge
#

a

#

then how do they support 1080p60

vernal lintel
azure verge
#

5e3????

#

is that

#

hex for 5000 or some shit

vernal lintel
#

??????

#

girl?

#

are you not paying attention in math / physics class ๐Ÿ˜ญ

#

maybe you're more used to seeing it with capital E

#

5E3

azure verge
#

OH

#

OH

#

OMFG

#

OMFG

#

im

vernal lintel
#

๐Ÿ˜ญ

azure verge
#

im not used to seeing it with an e ๐Ÿ˜ญ

#

we always write it 5x10^3

vernal lintel
#

yeah E just means that in short

#

scientific notation

azure verge
#

mhm

#

its just not common here

vernal lintel
#

js supports it and 5e3 is one byte less than 5000 so the minifier uses it

azure verge
#

OH

#

interesting and good to know

azure verge
real glade
#

my calculator has an E button for short

azure verge
#

interesting

#

mine has a x10^y

#

okay so

#

it seems the reason 8mbps isnt enough for streaming

#

is because its lowering the framerate instead of the quality when it cannot keep up

#

i need to figure that out

real glade
#

isn't that desktop behavior too

azure verge
#

it usually lowers quality

#

and looks really blurry and blocky

#

which id honestly prefer

#

to framerate going to 7fps

real glade
#

that's probably an option somewhere

#

search for isEmbedded() or whatever

#

might be isPlatformEmbedded()

azure verge
#

wdym

#

why isEmbedded

real glade
#

it's the check for native

simple groveBOT
azure verge
#

wtf is this function

#

hmm