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

Screenshare with audio enabled breaks video quality #528

Closed
sysrq-reisub opened this issue Apr 20, 2024 · 62 comments
Closed

Screenshare with audio enabled breaks video quality #528

sysrq-reisub opened this issue Apr 20, 2024 · 62 comments
Labels
bug Something isn't working upstream related to a dependency, for example electron wontfix This will not be worked on

Comments

@sysrq-reisub
Copy link

Describe the bug

I can stream fine with or w/o Hardware Acceleration enabled until I turn on the audio source for any application, choosing entire audio or specific applications does not matter

To Reproduce

  1. Start a screenshare
  2. Add an audio source before or after starting the screenshare
  3. Video quality breaks completely

Expected behavior

Video quality remains the same when an audio source is selected.

Screenshots

  • Streaming output

Those are the streams output, in both cases the frame rate is terrible, a single frame is refreshed after a couple of seconds
Quality changes depending whether "prefer smoothness or "prefer clarity" is selected

photo_2024-04-20_19-22-06
photo_2024-04-20_19-22-05

  • RTC Debug

Screenshare without selecting an audio source
Schermata del 2024-04-20 19-07-18
Frame rate is stable, quality is excellent, tried a fast pacing video game, encoding works correctly as nvtop shows.
Schermata del 2024-04-20 19-07-12

This is after selecting an audio source after the screenshare was started, with "Prefer clarity" choosen
You can see a sudden drop in frame rate
Schermata del 2024-04-20 19-11-52

This is when "Prefer smoothness" is choosen, video resolution drops to 480x270

Schermata del 2024-04-20 19-13-23

This is the audio section. Doesn't change much I think.

Schermata del 2024-04-20 19-13-28

Desktop (please complete the following information):

  • OS/Distro: Fedora Linux 39 (Workstation Edition)
  • Desktop Environment (linux only): GNOME
  • Version: GNOME Shell 45.5

My setup also includes

  • DX3 USB DAC, my primary audio output
  • Blue Snowball USB Microphone
  • 170Hz Gigabyte M27Q monitor on DP-1, freesync disabled
  • Benq XL2411Z Second monitor on DP-2 (Video input)-> to HDMI Adapter
  • GPU: Radeon RX 7800 XT
  • CPU: AMD Ryzen 5 5600

Vesktop versions tried:

Command line output
Started with the following parameters, also enabled venmic debug in case you need it:

VENMIC_ENABLE_LOG=1 pnpm start

> [email protected] start /home/luca/Documenti/GIT/Vesktop
> pnpm build && electron .


> [email protected] build /home/luca/Documenti/GIT/Vesktop
> tsx scripts/build/build.mts

[2024-04-20 19:13:42.432] [MANGOHUD] [error] [overlay_params.cpp:1003] Failed to read presets file: '/home/luca/.config/MangoHud/presets.conf'
[2024-04-20 19:13:42.432] [MANGOHUD] [error] [overlay_params.cpp:840] Unknown option 'io_stats'
[arRPC > ipc] listening at /run/user/1000/discord-ipc-0
[arRPC > websocket] listening on 6463
[arRPC > process] started
[Vencord] Installed React Developer Tools
(node:79532) ExtensionLoadWarning: Warnings loading extension at /home/luca/.config/vesktop/ExtensionCache/fmkadmapgofadopljbjfkapdkoienihi:
  Manifest version 2 is deprecated, and support will be removed in 2024. See https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline for details.

(Use `electron --trace-warnings ...` to show where the warning was created)
[arRPC > process] detected game! VA-11 HALL-A
[79570:0420/191344.102905:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[79570:0420/191352.149720:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[79570:0420/191354.294553:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

Output too long. The rest is here:
cmdline_output.txt

Additional context

What I tried excluding was:

  • My DNS server
  • My internet connection, I tried my mobile LTE hotspot.
  • My operating system, I tried a fresh install of Ubuntu and looks like it's still affected, may need further testing though.
  • Changing VA-API drivers on my distro
  • Excluding my DX3 Pro DAC and switching to integrated audio
  • My secondary monitor

Also

  • Reinstalled vesktop completely from scratch
  • Removed all user data in .config/vesktop

OBS correctly records with audio when using the VA-API Video encoder, looks like only Vesktop is affected.

vainfo output:

Trying display: wayland
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 23.3.6 for AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 17.0.6, DRM 3.57, 6.8.7-250.vanilla.fc39.x86_64)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc

However, it looks like even after disabling "hardware acceleration" on the settings and turning off the encoding support cmdline flags in index.ts the issue is still present.

May not be related to VA-API video encoding.

I haven't found any issue similar to mine

Sorry for the TL;DR

@sysrq-reisub sysrq-reisub added the bug Something isn't working label Apr 20, 2024
@PolisanTheEasyNick
Copy link
Contributor

PolisanTheEasyNick commented Apr 20, 2024

FPS and resolution drops because of insane low bitrate when selected audio source.
I will retest it on my machine in around 3-4 hours.
Edit: I was able to reproduce issue.

@sysrq-reisub
Copy link
Author

sysrq-reisub commented Apr 20, 2024

This is a footage of the actual screenshare output from another computer.

test.mp4

Audio was enabled later on. Absolutely perfect before as you can see. GPU Encoding was working fine for 30% of usage, after the audio was enabled, dropped to 0%.

@sysrq-reisub
Copy link
Author

FPS and resolution drops because of insane low bitrate when selected audio source. I will retest it on my machine in around 3-4 hours.

I also have noticed this on the developer console when a stream w audio is started. Doesn't happen otherwise. If that can be useful
(removed some useless info)
immagine

@Curve
Copy link
Member

Curve commented Apr 20, 2024

Could happen because the screen share picker for audio adds an audio track - maybe the video properties are reset here somehow?

@PolisanTheEasyNick
Copy link
Contributor

PolisanTheEasyNick commented Apr 20, 2024

About stream preview error I think it's okay because I received it even when my bitrate was ok.
About adding audio track to stream it may cause bitrate drops, but we need to retest it. I will try to reproduce issue and investigate it further.
30 kbit looks like normal bitrate for audio, maybe bitrate for added audio track accidentally set to video too?

@Nazo96
Copy link

Nazo96 commented Apr 20, 2024

Hi,
I also have this issue and I'd like to add one thing.
When streaming and NO ONE is watching my stream, the bitrate target is 8000 kpbs and the actual bitrate hovers around 7k and 8k (1080p 60fps prefer clarity and with an audio souce)

As soon as someone joins the stream, the bitrate goes to 28kpbs.

This issue is not present when streaming without an audio source.

@Curve
Copy link
Member

Curve commented Apr 20, 2024

About stream preview error I think it's okay because I received it even when my bitrate was ok. About adding audio track to stream it may cause bitrate drops, but we need to retest it. I will try to reproduce issue and investigate it further. 30 kbit looks like normal bitrate for audio, maybe bitrate for added audio track accidentally set to video too?

That's what I thought as well ^^

@Curve
Copy link
Member

Curve commented Apr 20, 2024

Hi, I also have this issue and I'd like to add one thing. When streaming and NO ONE is watching my stream, the bitrate target is 8000 kpbs and the actual bitrate hovers around 7k and 8k (1080p 60fps prefer clarity and with an audio souce)

As soon as someone joins the stream, the bitrate goes to 28kpbs.

This issue is not present when streaming without an audio source.

@PolisanTheEasyNick Maybe that's caused by the same discord call that messes with the video source shortly after it's started (for which you added the setTimeout call)

@EtereosDawn
Copy link

EtereosDawn commented Apr 21, 2024

fedora 40 gnome 46 latest update

I'm using the PR where the bitrate fix was added to the main branch, I can confirm it has the same issue. I haven't run a git pull until now. I'm using the same versions of the latest merge fix for the main branch so far. however, crashes and delays are fixed when launching from the terminal. any changes to the main branch do not come from any changes to the source code. Maybe it's something related to the discord side. When using the flags the problem is fixed on my side:

vesktop --enable-features=VaapiVideoDecoder,VaapiVideoEncoder

If anything gets confusing, I apologize, after all, it's not my native language. but the latest merges do not affect the problem of lags in streams, after all, the PRs that corrected this are also affected by problems with lags and crashes.

i use amd 6750 xt freeworld vaapi

@EtereosDawn
Copy link

EtereosDawn commented Apr 21, 2024

this is the pr I'm using, #489 the most recent ones suffer from the same problem. some also do not play sound in the case of the "main branch" currently.

something interesting to say is that when using the official web discord my friends got lags. "https://discord.com/channels/@me" something I've never seen when using discord web through Google Chrome.

--enable-features=VaapiVideoDecoder,VaapiVideoEncoder

audio not capture in vesktop error main branch:

> [email protected] start /home/user/Vesktop
> pnpm build && electron . "--enable-features=VaapiVideoDecoder,VaapiVideoEncoder"


> [email protected] build /home/user/Vesktop
> tsx scripts/build/build.mts

[arRPC > ipc] listening at /run/user/1000/discord-ipc-0
[arRPC > websocket] 6463 in use!
[arRPC > websocket] listening on 6464
[arRPC > process] started
[19370:0421/030412.634286:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19370:0421/030422.774461:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait()
[2024-04-21 03:04:23.642] [venmic] [info] [patchbay] (get) running venmic 3.4.2
[2024-04-21 03:04:23.646] [venmic] [info] [patchbay] (handle) found default metadata: 41
[2024-04-21 03:04:23.646] [venmic] [info] [patchbay] (meta_update) speaker name: "alsa_output.usb-Solid_State_System_Co._Ltd._USB_Audio_Device_000000000000-00.analog-stereo"
[2024-04-21 03:04:26.995] [venmic] [info] [patchbay] (create_mic) created: 139
[19370:0421/030434.012842:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait()
[19321:0421/030440.305050:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_NOT_INITIALIZED
[19321:0421/030440.305064:ERROR:shared_screencast_stream.cc(940)] Dropping DMA-BUF modifier: 144115188486904579 and trying to renegotiate stream parameters
[19321:0421/030440.321678:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_NOT_INITIALIZED
[19321:0421/030440.321691:ERROR:shared_screencast_stream.cc(940)] Dropping DMA-BUF modifier: 144115188084250882 and trying to renegotiate stream parameters
[19321:0421/030440.338645:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_NOT_INITIALIZED
[19321:0421/030440.338660:ERROR:shared_screencast_stream.cc(940)] Dropping DMA-BUF modifier: 144115188075858177 and trying to renegotiate stream parameters
[19321:0421/030440.355329:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_NOT_INITIALIZED
[19321:0421/030440.355344:ERROR:shared_screencast_stream.cc(940)] Dropping DMA-BUF modifier: 0 and trying to renegotiate stream parameters
[19321:0421/030440.372195:ERROR:egl_dmabuf.cc(608)] Failed to record frame: Error creating EGLImage - EGL_NOT_INITIALIZED
[19321:0421/030440.372209:ERROR:shared_screencast_stream.cc(940)] Dropping DMA-BUF modifier: 72057594037927935 and trying to renegotiate stream parameters
'loop->recurse > 0' failed at ../src/pipewire/thread-loop.c:426 pw_thread_loop_wait()

I hope it helps

@sysrq-reisub
Copy link
Author

sysrq-reisub commented Apr 21, 2024

In case you want to hear a funny story to tell your friends or family, here is one

So for some reason today I was not able to reproduce the issue anymore
Also, the latest commits broke audio sources at all (I swear it worked yesterday????) so I'm currently on #489 where it works

And... I couldn't reproduce it anymore... I was starting to think my account was limited yesterday somehow, BUT then the only thing that changed from yesterday was the discord client where I was testing the stream output with my discord alt account...

It turns out when I use my other computer I just fixed today which has Vesktop, the stream mostly looks fine, then if I try again using an android device the stream messes up the same way as yesterday, it also messes up with a web client... AND with ANOTHER computer using a regular discord client on Ubuntu.

So to be sure I'm not crazy, I had an old windows install, I started a screenshare from a regular discord install, then joined again with my other account on the phone I was testing the stream with, and it was working fine from all those devices.

Then again, I switched to the official discord client on my laptop which was showing the stream just fine with Vesktop, then the issue came back again.

So long story short, it all depends from the client you are using to watch the stream, AND if you have selected an audio source...

I also tried an old version of Vesktop and fired up a stream the same way, so it always happened for me.

What changes when looking at the RTC debug, is the following:
(Examples ALL with audio source selected from the screenshare)

  • Bitrate target remains high when the stream is watched from a Vesktop client

Schermata del 2024-04-21 13-12-30

  • Bitrate target drops insanely when the stream is watched from a Android phone

Schermata del 2024-04-21 13-13-08

Also I noticed that the bitrate section disappears and reappears after a couple of seconds, meaning it may be resetting itself somehow?

@sysrq-reisub
Copy link
Author

sysrq-reisub commented Apr 21, 2024

immagine

Red stripe is when my android phone joined the stream. Dropped the bitrate to ~30Kbps

I'm re-testing with a couple of friends, totally client dependent, I had my friend join with a Windows discord client first, and he was watching the stream correctly, then another friend with an android phone joined, the stream was still fluent.

Re-made the stream with the same friend with the android client ONLY and the bitrate was back to 30 Kbps~ and quality totally crap.

Also, if my friend with the Windows computer joins later, the entire stream bitrate fixes itself.
Another test was my other friends phone, which was not the previous one.

  • Discord client on an Huawei P Smart 2021: Correct bitrate, acts like a windows client
  • Discord client on an Realme 8: Bitrate craps up

I made them also change the connection from wifi to LTE but nothing changes. Probably depends on the phone capabilities and what video or audio decoder they use... I suppose

EDIT:
Another thing I just discovered. if the Windows client disables Hardware Acceleration the bitrate is a mess again.

@Nazo96
Copy link

Nazo96 commented Apr 21, 2024

@sysrq-reisub Can confirm.
With my alt account the stream works with audio, no bitrate drops.

EDIT: I tried streaming from my alt account (Vesktop) to my main account (Official Discord) and the bitrate drops again.

@catgirlcataclysm
Copy link
Contributor

@sysrq-reisub Can confirm. With my alt account the stream works with audio, no bitrate drops.

EDIT: I tried streaming from my alt account (Vesktop) to my main account (Official Discord) and the bitrate drops again.

i believe the bitrate drop only occurs when someone starts watching

@PolisanTheEasyNick
Copy link
Contributor

Retested with friend on Windows and when he started watching stream bitrate dropped to 30, so most probably it's not depending on client.
Still looks like somewhere bitrate takes from audio track content instead of video :c

@sysrq-reisub
Copy link
Author

@sysrq-reisub Can confirm. With my alt account the stream works with audio, no bitrate drops.
EDIT: I tried streaming from my alt account (Vesktop) to my main account (Official Discord) and the bitrate drops again.

i believe the bitrate drop only occurs when someone starts watching

It does but from what I have experienced happens only when a client has a specific decoder.

Retested with friend on Windows and when he started watching stream bitrate dropped to 30, so most probably it's not depending on client. Still looks like somewhere bitrate takes from audio track content instead of video :c

So far 100% of the times the stream fixes itself whenever I join with the Vesktop client on my laptop with my alt account or with a Windows client with hardware acceleration enabled (but in this case depends from the video card decoder I suppose)

Tried with Windows myself, also found another Discord bug whether the Hardware Acceleration its not enabled anymore after toggling it off an on, and requires local user data to be deleted... But in any case the windows client acts differently every time, I couldn't 100% reproduce it, sometimes the decoder is ffmpeg, other times "electron" as seen from the debug page and hardware usage

However, one thing I am certain of is Vesktop uses 100% of the times WebRTC as video decoder, and the stream is always perfect in that case, and fixes it for everyone else

@tcharchar
Copy link

tcharchar commented Apr 21, 2024

Attempt using --enable-features=WebRTCPipeWireCapturer, perhaps. Using 720p60 and sometimes 1080p60 according to my friends runs perfectly well. My full vesktop launch command is the following:

vesktop --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform-hint=auto --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,WebRTCPipeWireCapturer

NOTE: Uncertain if the VaapiVideoDecoder and VaapiVideoEncoder ones do anything, I've just added them for safety's sake. Also, these are both with sound enabled and disabled.
NOTE 2: I'm using the latest vesktop version, built literally ~45 minutes ago with pnpm package --linux pacman

@Nazo96
Copy link

Nazo96 commented Apr 21, 2024

NOTE 2: I'm using the latest vesktop version, built literally ~45 minutes ago with pnpm package --linux pacman

I built the latest vesktop version and now there is no audio channel, even if I choose it in the audio source list.
The bitrate is fine, but no audio :(

@Vendicated
Copy link
Member

try building #531 instead

@Nazo96
Copy link

Nazo96 commented Apr 21, 2024

try building #531 instead

Thank you!
The audio channel is back, but the main issue persists. Bitrate drops to 30kbps as soon as someone watches the stream.
I tried @tcharchar launch commands with no luck.

EDIT: My brother installed Vesktop on his Windows 11 PC and my stream works perfectly with audio source.
The issue is present only if I stream to users that are using the official Discord client.

@catgirlcataclysm
Copy link
Contributor

i have been able to confirm that the bitrate is lowered to 29.17kbps on my machine when streaming with audio AND someone is watching, but as soon as someone else starts watching (total of 2 viewers) the bitrate gets raised to around 1400kbps. This issue is even more strange than before, and I am entirely at a loss as to how we should go about fixing this. Here's to hoping someone has an idea lol.

@catgirlcataclysm
Copy link
Contributor

i have been able to confirm that the bitrate is lowered to 29.17kbps on my machine when streaming with audio AND someone is watching, but as soon as someone else starts watching (total of 2 viewers) the bitrate gets raised to around 1400kbps. This issue is even more strange than before, and I am entirely at a loss as to how we should go about fixing this. Here's to hoping someone has an idea lol.

Also, I cannot confirm that this is the case, as it was very sporadic as to whether or not it happened, but it seemed to not be an issue when I had someone watching from a web client. This needs more testing to be solidified as a cause though, but if it is, it may be an issue/change to discord's server systems.

@tcharchar
Copy link

NOTE 2: I'm using the latest vesktop version, built literally ~45 minutes ago with pnpm package --linux pacman

I built the latest vesktop version and now there is no audio channel, even if I choose it in the audio source list. The bitrate is fine, but no audio :(

Oh yeah you're right. Audio indeed does not work. My apologies.

@sysrq-reisub
Copy link
Author

sysrq-reisub commented Apr 21, 2024

So I upgraded to the latest git repo, audio now works fine
In any case what it came to my understanding is it totally depends from the client video decoder, somehow they influence the stream bitrate for everyone

"Bad" clients:

  • Windows ones work sometimes as long they are using hardware decoders
  • Some android clients, my Pixel 8 for example and a couple of other phones break the stream
  • Some web clients in my case I was using Firefox
  • Regular Discord clients on Linux distros (they probably have basic software decoding)

"Good" clients:

  • Vesktop which uses WebRTC is fine in both windows and linux
  • Some Windows discord clients

Also, apparently you just need one of the "good" clients to fix the stream for everyone. I made my alt join my streams so everyone can look at them without it being a slideshow

This is what you see when using Vesktop as a client, then rejoining the stream with a regular discord client on a Linux dsitro, and joining again with Vesktop fixing the stream again.

34f1234f1.mp4

This is what was happening on my computer where the screenshare started while I was recording the previous video, you can see the drop to 30Kbps then it up again.

f3wwdfsd.mp4

@Curve
Copy link
Member

Curve commented Apr 21, 2024

NOTE 2: I'm using the latest vesktop version, built literally ~45 minutes ago with pnpm package --linux pacman

I built the latest vesktop version and now there is no audio channel, even if I choose it in the audio source list. The bitrate is fine, but no audio :(

Oh yeah you're right. Audio indeed does not work. My apologies.

With the latest commit audio should work

@Curve
Copy link
Member

Curve commented Apr 21, 2024

So I upgraded to the latest git repo, audio now works fine In any case what it came to my understanding is it totally depends from the client video decoder, somehow they influence the stream bitrate for everyone
~snip

I am lost for words lmao

@tcharchar
Copy link

So I upgraded to the latest git repo, audio now works fine In any case what it came to my understanding is it totally depends from the client video decoder, somehow they influence the stream bitrate for everyone
~snip

I am lost for words lmao

This might be more of an issue on Discord's side than Vesktop or really anyone; besides the audio issues I suppose. There's literally an ongoing bug in Discord Canary which makes voice chats absolutely unusable as it plays back garbage, unintelligible data.

@Cynosphere
Copy link
Contributor

Cynosphere commented Apr 21, 2024

There's literally an ongoing bug in Discord Canary which makes voice chats absolutely unusable as it plays back garbage, unintelligible data.

It was caused by a broken build of discord_voice and was fixed in ~24 hours. Anyone who still has the issue has not updated since. An irrelevant point nonetheless as it does not pertain to WebRTCMediaEngine.

@visor841
Copy link

"Bad" clients:

* Windows ones work  _sometimes_ as long they are using hardware decoders

* Some android clients, my Pixel 8 for example and a couple of other phones break the stream

* Some web clients in my case I was using Firefox

* Regular Discord clients on Linux distros (they probably have basic software decoding)

"Good" clients:

* Vesktop which uses WebRTC is fine in both windows and linux

* Some Windows discord clients

Also, apparently you just need one of the "good" clients to fix the stream for everyone. I made my alt join my streams so everyone can look at them without it being a slideshow

This worked for me on the latest Vesktop flatpak. As weird as the workaround is, at least there's something we can do until this gets fixed.

@PeaceNira
Copy link

has anyone found a solution to this?

@Nazo96
Copy link

Nazo96 commented Apr 27, 2024

I tested this in a windows vm with stock discord web in chrome, and the issue persists when streaming to stock discord desktop clients (also on windows) so we can pretty confidently say that this is discord's issue to fix on their end

This issue was not present before #489 though.
I used to stream low intensity games and youtube videos with audio without bitrate drops to any Discord user (web clients and official clients) The resolution would never decrease (720p 30fps) and the quality was good most of the times.
The only issue was huge frame drops when streaming fast paced games where the camera makes sudden movements (FPSes, MOBAs, fast platformers).

Now the issue is completely different.
Choosing to stream with audio completely breaks the stream, where before it did not make a difference.
To be honest this is a downgrade for those who want to stream to non-Vesktop users.
But if you're planning to stream without audio or to Vesktop users, it's a huge upgrade instead.

@PolisanTheEasyNick
Copy link
Contributor

PolisanTheEasyNick commented Apr 27, 2024

This issue was not present before #489 though.

This bug is not regression after #489 because Discord did something on their side right after we fixed almost all of screensharing. You can try to install Vesktop at df05d12 commit before #489 merge, and you will get the same bitrate drop. Also, as mentioned upper, this bug is reproducible even in native discord web version without Vencord and/or Vesktop.

@Nazo96
Copy link

Nazo96 commented Apr 27, 2024

This bug is not regression after #489 because Discord do something on their side right after we fixed almost all of screensharing.

Oh shoot, you're right.
What a bummer, if Discord did not push that update on their side we would have perfect streaming now.
I have no words :(

@PolisanTheEasyNick
Copy link
Contributor

PolisanTheEasyNick commented Apr 27, 2024

Oh shoot, you're right.
What a bummer, if Discord did not push that update on their side we would have perfect streaming now.
I have no words :(

We actually had perfect streaming while developing for about 2-3 days :D

@Nazo96
Copy link

Nazo96 commented Apr 27, 2024

We actually had perfect streaming while developing for about 2-3 days :D

YES! Then I'm not crazy!!!!
The very first day everything was working!
You people did an amazing job anyway!
Hoping that discord reverts whatever they've done.

@GijsvandenHoven
Copy link

GijsvandenHoven commented Apr 27, 2024

So the issue affects people streaming from Windows to Windows? Then there's actually a good chance they'll fix it quickly

Specifically for Web Clients, but it looks like it.
I found this page after having the same issue with bitrate and audio, on Linux Mint with X11.

I was trying to stream to 3 unmodified, desktop Windows discord clients, at least one of which is using hardware acceleration.
Thus making that a 'good client' ? (hardware acceleration setting = using hardware decoder like some in the issue mention helps it?)

One of the windows users tried to stream the same thing instead, absolutely zero issues for anyone.

I know this isn't a very detailed report, I haven't really chased down the others for their discord settings that much.

Either way, this last week there's been plenty of streaming in my group, and I'm the only one having issues. I am also the only one using Linux & Vesktop.


I'm a little more pessimistic about Discord fixing it quickly, personally. How big is the user-base of 'web client users that are trying to stream' ? I vaguely estimate it's less or equal in size of 'Linux users trying to stream'.

That user-base has not been able to stream properly for years, Discord doesn't seem to care. (1) The only way to stream with audio on Linux is through the awesome community effort of Vencord and other 3rd party clients.

(1) They acknowledge as much on their support site, near the start: Unfortunately, audio sharing is unavailable on Linux. https://support.discord.com/hc/en-us/articles/360040816151-Go-Live-and-Screen-Share

@ArbitraryRenaissance
Copy link

I tested this in a windows vm with stock discord web in chrome, and the issue persists when streaming to stock discord desktop clients (also on windows) so we can pretty confidently say that this is discord's issue to fix on their end

Have you submitted a bug report to Discord? I haven't found anyone talking about this issue outside of this thread.

@PolisanTheEasyNick
Copy link
Contributor

PolisanTheEasyNick commented Apr 27, 2024

Have you submitted a bug report to Discord? I haven't found anyone talking about this issue outside of this thread.

I submitted, but I do not believe that they will do anything about it.

@catgirlcataclysm
Copy link
Contributor

Have you submitted a bug report to Discord? I haven't found anyone talking about this issue outside of this thread.

I submitted, but I do not believe that they will do anything about it.

I hope they do, as this is quite a large problem for all web users

@Sphirye
Copy link

Sphirye commented Apr 29, 2024

I though my laptop performance magically just died until i found this, glad to know im not crazy! Im totally experiencing the same main deal, screensharing was perfectly working until i switched from fedora 37 to 40 and gnome 6, because of this i was already blaming the entire os

Having discord releasing update almost after fedora 40 came out really blured up everything

@Vendicated Vendicated added wontfix This will not be worked on upstream related to a dependency, for example electron labels May 1, 2024
@PolisanTheEasyNick
Copy link
Contributor

Okay, here are some updates.
Yesterday (30.04) Discord updated web version from 287337 to 289103. Kaitlyn noticed that streaming from Vesktop to Browser (and some clients) was fixed (if we can say so). At that time I was able to stream from Vesktop to another account on Chromium without bitrate loses, however while streaming from Vesktop to Firefox I could see drops to 29.17 kbit/s.
Today(? 01.05) Discord updated web version to 289379 and rn I'm able to stream from Vesktop to friend on Windows, which uses native Discord client.
So it means that Discord team actually doing some job with all this stuff.
What also interesting, sometimes I had 29.17 kbit/s issue when stream is created with sound but no sound actually transmitted, but when I enable video, for example, which starts transmitting sound, I receive bitrate raising:
image
Summarizing, I think we need more tests. For not spamming at this thread, if you did some tests then please react at this post with 👍 if you CANNOT reproduce this issue and with 👎 if you still have 29.17 kbit/s issue.
Anyway, we need to wait more time for Discord team to fix it completely, because it may still be buggy.

@catgirlcataclysm
Copy link
Contributor

Okay, here are some updates. Yesterday (30.04) Discord updated web version from 287337 to 289103. Kaitlyn noticed that streaming from Vesktop to Browser (and some clients) was fixed (if we can say so). At that time I was able to stream from Vesktop to another account on Chromium without bitrate loses, however while streaming from Vesktop to Firefox I could see drops to 29.17 kbit/s. Today(? 01.05) Discord updated web version to 289379 and rn I'm able to stream from Vesktop to friend on Windows, which uses native Discord client. So it means that Discord team actually doing some job with all this stuff. What also interesting, sometimes I had 29.17 kbit/s issue when stream is created with sound but no sound actually transmitted, but when I enable video, for example, which starts transmitting sound, I receive bitrate raising: image Summarizing, I think we need more tests. For not spamming at this thread, if you did some tests then please react at this post with 👍 if you CANNOT reproduce this issue and with 👎 if you still have 29.17 kbit/s issue. Anyway, we need to wait more time for Discord team to fix it completely, because it may still be buggy.

It looks to me like the consensus is that this is entirely fixed. I think this is ready to close :3

@Curve
Copy link
Member

Curve commented May 3, 2024

Awesome :D

@Curve Curve closed this as completed May 3, 2024
@sysrq-reisub
Copy link
Author

sysrq-reisub commented May 30, 2024

Looks like it was fixed between Vesktop and some Android clients, a week ago, but now I'm reproducing the issue again, same with Vesktop and Firefox, Vesktop and Windows works fine though.
Am I the only one?

@clanps
Copy link

clanps commented Jun 1, 2024

I'm also having this issue, turning off audio on the stream makes the bit rate go back up.

@PrimalPimmy
Copy link

This is still a problem. Using Fedora KDE with latest version of Vesktop

@ff7freddy
Copy link

ff7freddy commented Jun 22, 2024

I'm also experiencing this problem in Bazzite Fedora KDE, using Vesktop. Updating Vesktop to the latest did not fix for me. Viewers of my streams say the picture looks much better when audio is disabled.

@Cherryda
Copy link

I'm also experiencing this problem in Bazzite Fedora KDE, using Vesktop. Updating Vesktop to the latest did not fix for me. Viewers of my streams say the picture looks much better when audio is disabled.

Same issue in my setup, looks like Discord upstream broke screensharing again.

@Nazo96
Copy link

Nazo96 commented Jun 23, 2024

Yes, the issue came back, but it does not to seem as problematic as before.
I can stream normally with audio to some people, but not to others.
Depends on the "viewer"'s client.

@AlephNought0
Copy link

So I found a workaround for this problem.

When you start a stream with audio on vesktop a new audio node is created called vencord-screen-share which connects to Chromium input-1 (which was also created). After cutting the connection between vencord-screenshare and Chromium-input 1 (using qpwgraph for example), making the stream have no audio basically, the stream started to have proper quality. When I connected vencord-screen-share to the original Chromium-input (so basically your microphone) people could hear the audio nicely and see the video without lags and without the bad quality. This only works when starting the stream with audio chosen and then reconnecting it. The audio sounds bad when vencord-screen-share isn't connected to some node basically. Do note that you won't be heard properly when audio is playing because it is going over you.

Stream with Chromium-input 1
image
image

Stream with Chromium-input
image
image

@Curve
Copy link
Member

Curve commented Jul 17, 2024

While this is a little dumb we could also automate this (wait until Bitrate Hits a specific threshold and only then start Venmic)

@pavelgrigoriev
Copy link

pavelgrigoriev commented Jul 21, 2024

So I found a workaround for this problem.

When you start a stream with audio on vesktop a new audio node is created called vencord-screen-share which connects to Chromium input-1 (which was also created). After cutting the connection between vencord-screenshare and Chromium-input 1 (using qpwgraph for example), making the stream have no audio basically, the stream started to have proper quality. When I connected vencord-screen-share to the original Chromium-input (so basically your microphone) people could hear the audio nicely and see the video without lags and without the bad quality. This only works when starting the stream with audio chosen and then reconnecting it. The audio sounds bad when vencord-screen-share isn't connected to some node basically. Do note that you won't be heard properly when audio is playing because it is going over you.

Stream with Chromium-input 1 image image

Stream with Chromium-input image image

I have the same problem, and your solution helped me, maybe, to reopen the issue?

@AlephNought0
Copy link

So I found a workaround for this problem.

When you start a stream with audio on vesktop a new audio node is created called vencord-screen-share which connects to Chromium input-1 (which was also created). After cutting the connection between vencord-screenshare and Chromium-input 1 (using qpwgraph for example), making the stream have no audio basically, the stream started to have proper quality. When I connected vencord-screen-share to the original Chromium-input (so basically your microphone) people could hear the audio nicely and see the video without lags and without the bad quality. This only works when starting the stream with audio chosen and then reconnecting it. The audio sounds bad when vencord-screen-share isn't connected to some node basically. Do note that you won't be heard properly when audio is playing because it is going over you.

Stream with Chromium-input 1 image image

Stream with Chromium-input image image

I have the same problem, and your solution helped me, maybe, to reopen the issue?

I do believe that the issue should be reopened. It is still clear that people still suffer from this, including me.

@Curve
Copy link
Member

Curve commented Jul 23, 2024

So I found a workaround for this problem.

When you start a stream with audio on vesktop a new audio node is created called vencord-screen-share which connects to Chromium input-1 (which was also created). After cutting the connection between vencord-screenshare and Chromium-input 1 (using qpwgraph for example), making the stream have no audio basically, the stream started to have proper quality. When I connected vencord-screen-share to the original Chromium-input (so basically your microphone) people could hear the audio nicely and see the video without lags and without the bad quality. This only works when starting the stream with audio chosen and then reconnecting it. The audio sounds bad when vencord-screen-share isn't connected to some node basically. Do note that you won't be heard properly when audio is playing because it is going over you.

Stream with Chromium-input 1 image image

Stream with Chromium-input image image

I have the same problem, and your solution helped me, maybe, to reopen the issue?

I do believe that the issue should be reopened. It is still clear that people still suffer from this, including me.

This is not something we can fix. This is either a discord web (more likely) or electron / chromium issue - I don't see why this issue should be re-opened, raise an issue on the corresponding project-side instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream related to a dependency, for example electron wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests