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

Named threads causes performance regression on Windows #892

Open
Sean-Der opened this issue May 21, 2023 · 3 comments
Open

Named threads causes performance regression on Windows #892

Sean-Der opened this issue May 21, 2023 · 3 comments

Comments

@Sean-Der
Copy link
Contributor

I only have access to macOS/Linux so I am not able to reproduce this myself unfortunately.

Windows developers report that with these commits they are seeing significant amount of packet loss. When reverted things work again.

@pkviet Does that match with what you saw?

@pkviet
Copy link

pkviet commented May 21, 2023

it's not packet loss; it's a threading issue where the rendering pipeline is blocked for a constant 2 second, so we miss frames (ex: 100 frames at 50 fps). There's no issue on linux, nor with datachannel + mbedtls compiled on MSVC. I haven't checked against openssl. The frames are passed to libdatachannel from what I can see though. So it's unclear to me where it's stalling.
I'd need to breakpoint in datachannel but our cross compiled dlls have no pdb.

@paullouisageneau
Copy link
Owner

Thread naming is a no-op on Windows so I don't think it could explain the behavior.

The libjuice update d3938a7 introduces the implementation of ICE PAC (RFC 8863), which may result in different ICE nomination timings. I think it could trigger such frame drops as I'm not sure that the WHIP output pipeline properly waits for an open connection: obsproject/obs-studio#7926 (comment)

@pkviet
Copy link

pkviet commented Jul 19, 2023

Got a clue. The bug occurs also with msvc builds of libdatachannel if mbedtls is build with multithreading enabled.
So the core issue lies with multithreading in mbedtls. If multithreading is disabled, the bug is gone.
Points to something in mbedtls support in libdatachannel @Sean-Der

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

No branches or pull requests

3 participants