#this is the current code meant to enable

1 messages ยท Page 1 of 1 (latest)

stark goblet
small flax
#

have a look at the link I sent

#

it patches Discord's code with regex

#

have a look at the code and you want to use regex to add the options

stark goblet
#

But for now I gotta sleep. Thanks for pointing me in the right direction though!

small flax
#
codec === Codecs.OPUS && media.fmtp.push({
                config: "minptime=10;useinbandfec=1;usedtx=".concat(sendingVideo ? "0" : "1").concat(sendingVideo ? ";stereo=1;sprop-stereo=1" : ""),
                payload: payload
            }),
#

this is what vencord does

stark goblet
#

Yeah, and my current implementation modifies the RTCPeerConnection prototype to add exactly stereo=1;sprop-stereo=1 to the oups line(s) in the SDP. I haven't yet fully understood what the effective difference is, so I'll use the prototype overwrite tomorrow to check what the actual differences in the description sent is. Then I should be able to pin down what exactly is going wrong with the current vencord fix.

stark goblet
#

Quick check shows that the vencord solution does nothing

#

When connecting to a voice chat.

#

Might when streaming

small flax
#

well it does check sendingVideo so might be that

#

idk if that only applies to your streams or all streams

#

the reason for that boolean is that we don't want it to patch your microphone audio

#

try removing the boolean check and just always adding it and see if that fixes it

stark goblet
#

Don't havet he chance right now to test it with a stream

#

This will probably cause a regression in some other ways though. I do remember reading about people having the issue that their microphone turned one-sided for everyone else when they started streaming

#

This might trigger that again

small flax
#

but maybe there's a better way to detect that

stark goblet
stark goblet
#

I found the issue. The current fix only affects answers, not offers.

#

From what I've found, some offers don't include the usedtx= at all.

The SDL there contains

a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1

Even with the video flag removed from the patch.
My plugin solution results in the following

a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1

The latter results in a stereo stream

#

Searching through the discord client code, I can't find any spot other than the one that's already patched where this is set.

stark goblet
#

No smart answer from me yet, but the patched code does not get called when creating an offer

#

Only for the answer

#

Yup. I've added a comment in the PR. I am not familiar enough and am getting a litte sick of stepping in/through functions for now. Evidence shows that the patch doesn't apply to offer SDPs, only to answers

#

From what I've seen the WebRRCPeerConnection.createOffer function is native code - that's where the sdp comes from for offers