Spiked frames during streams while StreamCompanion is running.
AriizuCA opened this issue · 9 comments
For a while I'd been experiencing spiked frames while streaming osu! and decided a couple weeks ago to add to one of the submitted issues that was similar to mine on the github page for the osu! client. After a number of tests, and eventually a patch, StreamCompanion was isolated as one of the largest contributing factors to those spiked frames. Not sure why that is the case but if you want examples of what the spikes looked like, many videos are linked here on my comments: ppy/osu-stable-issues#816
Basically, Cutting Edge 20220306 and Stable 20220307 broke StreamCompanion and with it disabled, the spiked frames disappeared. Over a week, I tested the new patch out without StreamCompanion until there was an update v220309.20 that reenabled StreamCompanion to work again. As soon as StreamCompanion was operational, the spiked frames returned and I've disabled it ever since.
We'll need to troubleshoot this a bit - for as long as I've been running osu!, SC is running alongside it 99% of the time and I've never encountered lag spikes during gameplay severe enough to cause a shutter in osu!. This might be specific to your SC config (settings.ini in install location) - please share it unless you use osu!post - you'll need to remove username and password from the file beforehand then.
You can try gutting SC by removing non-essential plugins. Based on your messages from other issue you seem to be using "only" live UR output of SC. Go to Plugins folder in SC location, create folder inside and move all .dll files that aren't on this screen:
Please test if lag spikes still happen with these plugins active.
And while I just wrote I never encountered such lag spikes myself, I also never specifically looked for them - I'll keep an eye for these from now on.
Here is the settings.ini file.
I've also took screenshots of the disabled .dll files as well as what remains in the plugin folder.
In the past, I used to run a lot of different tokens from StreamCompanion in older versions of streams with this being back in May of 2020. Since then, I've cut down to a limited information setup. Now that I think about it, the other output that I used from StreamCompanion is the map URL link as a command through StreamLabs Chat Bot but the spiked frames do not occur when people type that command as it's rarely used.
Will test later tonight how StreamCompanion runs with the .dll files disabled. Not sure if the extra .json files also need to be in the plugin folder or if I should remove all files in that folder until it looks like the image that you provided above.
Not sure if the extra .json files also need to be in the plugin folder or if I should remove all files in that folder until it looks like the image that you provided above.
These can be left as-is or removed - these were mistakenly included in the setup.
Token output on StreamCompanion was present but was not being read by OBS, so there was no output of UR during my test. I do have the plugin installed on OBS, but it just wasn't detecting StreamCompanion. When I tried making a new text source [00:10:52], text would automatically appear as "Set mapping in settings" and not change no matter what SC source name I used. I tried all combinations of event statuses and none updated the text.
The web overlay also seemed to be broken as background for any of the overlay templates. Overall, there was no issues of spiked frames until after the 4 hour+ mark; 04:19:34, 04:19:38, 04:20:36, which was probably due to something else as it was the exception for the night and only lasted for one map. Normally, if the spiked frames were caused by one of the streaming apps, it would have been present throughout the whole stream.
So overall, removing some of those plugins seems to have stopped the spiked frames on my end caused by StreamCompanion but it also seems to have broken the ability of OBS to read the live tokens as well as StreamCompanions ability to read the map BG's.
Great to hear these spikes are not caused by core SC code or memory reading at the very least. From now on you can try slowly adding these plugins back. Suggested order (in order to fix obs/background issues first):
-
Fix for the issues mentioned:
FileMapDataSender.dll - will allow OBS plugin to work again - this is running constantly during gameplay, while at the moment I don't see how... this might be the reason for these.
BackgroundImageProvider.dll - will fix background issues, no way this causes spikes -
Might be the reason for lag spikes - please test 1 by 1:
LiveVisualizer.dll - my bet is on this, especially since in your config visualizer was enabled
ClickCounter.dll - this hooks into keyboard presses, might also be somehow the reason for these? This is already running on a separate, high-priority application thread from the rest of SC. -
Very unlikely for these cause these spikes:
Gamma.dll -
These run code that executes only when ingame map changes, pretty much impossible to be the cause of the spikes:
ModImageGenerator.dll
BeatmapPpReplacements.dll
PlaysReplacements.dll
MSNEventSource.dll - disabled by default
osuPost.dll - disabled by default
Added all of the plugins from the list above. No spiked frames were present in todays stream and OBS and background issues were fixed. For the plugins that were outside of the list above, I only managed to add StreamCompanion.Common.dll and there was no issues with it in the plugins folder before I ended stream. Will add one by one the rest of the list in the disabled folder tomorrow.
Added the rest of the disabled plugins into the main plugin folder and didn't really get much spiked frames. There was one moment (03:20:40) within the stream where my framerate dipped to half of what it should have been. Only happened once though and had no other issues during the stream for a four+ hour period.
Not sure what had changed but it seems like StreamCompanion doesn't cause the spiked frames anymore. One thing to note is that since enabling StreamCompanion, I still do get the occasional framerate drop. During the whole week that I was testing without StreamCompanion, I didn't experience any framerate drops for any of the four+ hour long streams. Will try again next stream with all plugins in folder to see if any spiked frames/framerate drops occur during a full stream as the previous test only had all of the plugins moved into the folder for a short period of time (10 minutes) before I ended my stream today.
Another issue that I also noticed because I have begun to use the StreamCompanion web overlays, is that certain backgrounds for maps aren't being read by the app. Not sure why certain ones aren't being read but in the clip I posted above, you can see that the background isn't correct on the SC Live Overlay or the VictimCrasher Compact Overlay at the end of the clip. Instead, there is a picture of a sunflower in place of the souljaboy and cirno background for the SC Live Overlay and an unloaded picture in left corner of the VictimCrasher Compact Overlay. The sunflower was loaded by the previous map.
Over the last couple streams of tests, I feel confident that StreamCompanion is not causing any spiked frame rate issues anymore. This was after testing for several hours each day with no spiked frames during any of the stream sessions. It seems that removing the plugins from the folder and replacing them back one by one has fixed any issues I had with StreamCompanion while streaming.
I could not reproduce the missing background issue with any of the maps I've tested, including one shown in your last clip. If you do have a reproducible case, please raise a separate issue.
It seems that removing the plugins from the folder and replacing them back one by one has fixed any issues I had with StreamCompanion while streaming.
Meaning your SC installation hasn't changed since raising this issue. I'm fairly confident this can be closed.