Yoshify / DiscJockey

DiscJockey - An all-in-one custom Boombox solution for Lethal Company
1 stars 1 forks source link

Makes the game take to long to open #10

Open TheLegendofSaram opened 8 months ago

TheLegendofSaram commented 8 months ago

The phase of loading the custom songs takes a while, i tried with a playlist of 154 songs and it took a solid 10 min. Plus it gives me an Unknow error in the log that doesn't seem to affect anything, at least that i see

[Info :Yoshify.DiscJockey] [17:36:58.99] DiscJockey 1.1.3: NetworkedAudioReceiver: Starting playback - buffer resizing buffer to new sampleLength 15427583 [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error [Info : Trace] Fail: Unknown error

Yoshify commented 8 months ago

154 songs is a lot of songs. All of those songs needed to be loaded and stored in memory. DiscJockey is already very efficient at this (it doesn't even uses Unity AudioClips, which are slow). It'd be hard to make it much faster than it already is unfortunately.

The slowness could be caused by other factors though. Out of curiosity, with 154 songs loaded, what does your RAM usage look like?

Yoshify commented 8 months ago

The Unknown Errors I have no idea the source of. It only started in v49 and it doesn't seem to effect anything so I just ignore them lol.

TheLegendofSaram commented 8 months ago

Yeah the load on the RAM during the loading songs phase is pretty insane. Here Baseline Captura de pantalla 2024-01-13 004835 During loading Captura de pantalla 2024-01-13 005111 And after that it goes to a normal 60% usage during gameplay, is only during loading phase that it comes to that degree of RAM usage and slowness PS: I'm really enjoying your mod dude, keep going you are doing a great job

TheLegendofSaram commented 8 months ago

Hello, its me again, i been looking more in to the ram usage issue and have some questions regarding the custom songs thing. So I notice that no matter the size of the files or how many songs I had, the usage of ram skyrockets if it loads songs. I don't know if I'm explaining my self well, so i'll give a demonstration: Here is the game running, in the ship, with 0 custom song loaded and no cache songs. Captura de pantalla 2024-01-16 212204 Here is the game running, in the ship, with 1 2,44MB custom song which I had already transcoded using ffmpeg to a 96kbps 48Khz mp3 file, stereo and without metadata. Captura de pantalla 2024-01-16 213313 So a 138,7 MB difference, that seems ok... Until you load more songs.

Here is the game running, in the ship, with 10 different custom songs that have all been transcoded using ffmpeg with the same preset as before, amounting to 33,1MB in mp3 files Captura de pantalla 2024-01-16 214202 As you can see a 1615,3MB difference to the baseline of 2015,1MB, so each song is adding 161 MB (approx) of load to the RAM

Here it is with 50 songs, and same treatment with ffmpeg. 133MB of MP3 files Captura de pantalla 2024-01-16 215522 Again 6506,2MB difference with the baseline, and 130MB per song approx.

This is all to ask. Is this normal behavior? What's causing that high usage of RAM? I don't really know how the mod loads the songs, but in my unga bunga brain i thought it was loading the MP3 files as is with some more overhead for the underlaying process of the mod. But hey, I hope this data helps in the development of the mod.... and here is the LOG file for the 50 songs one LOL LogOutput.log PS: Me and my friends have been loving your mod, Keep it up!!

Yoshify commented 8 months ago

Curious - what's your modlist look like?

TheLegendofSaram commented 8 months ago

Is quite a bit. Here it is:

I had this exact mod list active while doing the tests shown above

DeathWrench commented 6 months ago

Custom Boombox Music has the same issue only when joining/starting lobbies. It has this in the config file though:

Requires less memory and takes less time to load, but prevents playing the same song twice at once.

Setting type: Boolean

Default value: false

Stream Audio From Disk = true

This fixes the problem with taking forever to load in. But like it says, prevents playing the song from playing on 2 jukeboxes at the same time. Perhaps this could be implemented into this mod.

TheLegendofSaram commented 6 months ago

Yeah I also notice that the custom boombox music mod had quite less ram usage but didnt even notice the part about not beeing able to use 2 boomboxes at one, and so I think it'll be a fine addition to the mod