-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[NOSQUASH] Move soundmanager into its own thread #13633
Conversation
Uh, looks like |
1a3984a
to
2f321b8
Compare
I've decided to just bump clang. clang 7 is available in ubuntu 20.04 (focal) and debian 10.0 (buster). |
This PR does make proper use of a whole new action queue but I think this is way too overengineered for the edge-case it tries to solve. |
Too long server steps are irrelevant here, the server does not send stream instructions or anything like that (yet).
It's configurable via compile constants (see The thing is tough that in practice we reach higher client dtimes.
It's not the first use of I thought about passing arbitrary |
That's true but I don't think it's a major concern to pause the audio while something intense is being loaded. What about std::vector<std::function<void()>> queue;
auto f1 = std::bind(&MyClassName::my_function, class_ptr, ARG1, ARG2, ....);
queue.push_back(f1);
queue[0](); This is less code and at least to me this looks simpler. What do you think? |
The bind approach is what I meant with the std::function thing.
|
Reverted the last commit, because it was not good, as said above. |
The warning messages for "sound queue ran empty" do get a bit much. Searching through my debug.txt yielded over 420000 such warning lines withhin less than 14 days. Help! |
Added to milestone, because I consider the warnings a regression. If the PR won't be considered mergable in reasonable time, an alternative temporary fix could be to put the warnings to inforstream. |
std::variant is broken in clang < 7.0.1 with libstdc++ see: llvm/llvm-project#32569
Fixes sound queues running empty on client step hiccups.
0de2cd2
to
8d3ce40
Compare
(Trivially rebased.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue reproduced. The sound now stops properly after a while when the lag is too high.
Thanks! |
8d3ce40
to
c6a6850
Compare
Did the manual squash, to remove the std::function commit and its revert. Click on the compare button to see that it changed nothing. |
Sweet. Good work, Desour. Sound has definitely needed attention, and it's always great to see progress in this area. |
You forgot to change this: Line 17 in 12e9867
|
Oops, thx for noticing. #13889 |
It's also nice to leverage more cpu cores, and not take time from the main client thread's step time for loading sounds.
This PR also bumps the minimum clang version to 7, because older clang has issues with
std::variant
.To do
This PR is a Ready for Review.
How to test
.lua local gut=core.get_us_time local t0 = gut() while gut()-t0 < 2e6 do end