Jump to content

[1.6.1] Soundtrack Editor 4.6 (2019-01-28)


pizzaoverhead

Recommended Posts

Looks like the per-song memory leak is still there.

 

I just came back from driving running while the computer here ran a 12 hour long test for me.  KSP had logged a commit size of 25.9 GB idling at the space center.  My computer was well into HDD Page Swap territory just to RUN.

(Silver lining, I can tell you with authority that the graphics system for KSP doesn't get bothered by page swapping.)

 

Post-track REALLY needs a ram cleanup/unload.

Link to comment
Share on other sites

  • 2 weeks later...

Looks interesting, although the memory leak reported has me concerned.

A few questions:

Why do you put libmpg123-0.dll into the KSP_Data/Mono directory?  Why not just include it in your Plugins directory?

For those people who reported the memory leaks, were you using a version compiled for the KSP you were playing?

 

Link to comment
Share on other sites

So, in testing this on a simple launch, I've seen the following errors in the log file:

Entering the editor:


ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[UnityEngine.AudioClip].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at MusicLogic+<PlayList>c__Iterator70.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 
UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
MusicLogic:ConstructionMusic(EditorFacility)
<OnLevelLoaded>c__Iterator6E:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
 

Getting into space:


[Progress Node Complete]: RecordsAltitude
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[UnityEngine.AudioClip].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at MusicLogic+<PlayFlight>c__Iterator72.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

 

On 6/4/2017 at 4:37 AM, AdmiralTigerclaw said:

Looks like the per-song memory leak is still there.

 

I just came back from driving running while the computer here ran a 12 hour long test for me.  KSP had logged a commit size of 25.9 GB idling at the space center.  My computer was well into HDD Page Swap territory just to RUN.

(Silver lining, I can tell you with authority that the graphics system for KSP doesn't get bothered by page swapping.)

 

Post-track REALLY needs a ram cleanup/unload.

Are you sure it is this?  What other mods were you running?

Link to comment
Share on other sites

On 04/06/2017 at 9:37 AM, AdmiralTigerclaw said:

Looks like the per-song memory leak is still there.

 

I just came back from driving running while the computer here ran a 12 hour long test for me.  KSP had logged a commit size of 25.9 GB idling at the space center.  My computer was well into HDD Page Swap territory just to RUN.

(Silver lining, I can tell you with authority that the graphics system for KSP doesn't get bothered by page swapping.)

 

Post-track REALLY needs a ram cleanup/unload.

There has been a post-track cleanup/unload for many versions now. I'm pretty sure it's the well known leak in the GUI system. Anything that uses the old GUI system will leak memory over time. The GUI is now one of the most complicated parts of Soundtrack Editor, so completely replacing it will be no easy task.

1 hour ago, linuxgurugamer said:

Looks interesting, although the memory leak reported has me concerned.

A few questions:

Why do you put libmpg123-0.dll into the KSP_Data/Mono directory?  Why not just include it in your Plugins directory?

For those people who reported the memory leaks, were you using a version compiled for the KSP you were playing?

 

It failed to load from anywhere else. I assume it's Mono doing the loading and searching for DLLs in its path. I'm not sure how to point it elsewhere.

56 minutes ago, linuxgurugamer said:

So, in testing this on a simple launch, I've seen the following errors in the log file:

Entering the editor:



ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[UnityEngine.AudioClip].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at MusicLogic+<PlayList>c__Iterator70.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 
UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
MusicLogic:ConstructionMusic(EditorFacility)
<OnLevelLoaded>c__Iterator6E:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
 

Getting into space:



[Progress Node Complete]: RecordsAltitude
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[UnityEngine.AudioClip].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at MusicLogic+<PlayFlight>c__Iterator72.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

 

Are you sure it is this?  What other mods were you running?

This is the stock music system. Once you unload the stock tracks, its music list is empty. It isn't built to handle that, and falls over. I had added a zero-length file to it in the past, but that may not be working currently.

Link to comment
Share on other sites

4 minutes ago, pizzaoverhead said:

It failed to load from anywhere else. I assume it's Mono doing the loading and searching for DLLs in its path. I'm not sure how to point it elsewhere

Oh, it's probably not a c# dll, but a system dll.

So it makes sense it has to be there.

Link to comment
Share on other sites

  • 3 weeks later...
1 hour ago, Kerbal101 said:

Thank you for this sound pack! This deserves so much more attention! Its absolutely must-have with this addon.

xD thank you so much :) I'm glad to hear you're getting some enjoyment out of it! If you have any suggestions I'd love to hear them. If I re-released it I'd probably make the building track run through flight mode as well, that way my playstyle (swapping in and out of flight mode every minute) isn't as intrusive to the playlists. That and adding planet-specific themes (already have them picked, not included because adding more than 10-ish tracks breaks things). I'm going on a bit of a tangent since no one has spoken of my add on for a few months :P thanks for the complements :)

Edited by Avera9eJoe
Link to comment
Share on other sites

@Avera9eJoe No, thank YOU, sir! I tried adding my own soundtracks and it was pretty .. difficult. I can see the amount of time and dedication, which went into assembling this pack together - which truly makes Pizza's mod shine. I have done Mun flybys, Kerbin tourist flights and rover science missions while listening to this pack so far, and it so much improves the atmosphere! I am doing it in permadeath playstyle, which is linear without reload where every action counts, and its been great joy to use! :)

Link to comment
Share on other sites

  • 3 weeks later...

@pizzaoverhead I don't understand what's going on here... I have been encountering situations, when SE randomly lists and plays no tracks.

ZSyTWcT.png

In career, with zero level launchpad - it never plays the "in atmosphere" and "flight" + any track, but on returning from atmosphere it usually does.
It also often does not play "not in atmosphere" and "flight" situation and upon reloading the game - does.

Link to comment
Share on other sites

  • 2 weeks later...
On 7/23/2017 at 4:22 AM, Kerbal101 said:

@pizzaoverhead I don't understand what's going on here... I have been encountering situations, when SE randomly lists and plays no tracks.

ZSyTWcT.png

In career, with zero level launchpad - it never plays the "in atmosphere" and "flight" + any track, but on returning from atmosphere it usually does.
It also often does not play "not in atmosphere" and "flight" situation and upon reloading the game - does.

I've had the same problem running KSP 1.3.0. After a bunch of experiments my conclusion is that, on loading the Flight scene (i.e. launching a craft, or switching to fly one already in the world) it only matches based on Scene, totally ignores Body and, to an extent, even InAtmosphere (i.e. it plays Space playlist for a second even with a playlist for Flight and InAtmosphere=True) but... then something happens and it stops playing music even if it momentarily matched while loading the craft in. And I haven't been able to get it to start playing tracks with playlists whose criteria become true later, whether that's playlists with min-max altitude or speed ranges reached after flying, or using KRASH simulation to put a craft into orbit. Whatever this mystery trigger is that stops the music, it basically prevents anything fun happening. 

I hadn't tried returning from atmosphere or reloading the game with a vessel in orbit yet.

Personally, I suspect until this is updated for 1.3 then it's going to remain broken.

Link to comment
Share on other sites

I've been doing more testing, focused on atmo flight playlist parameters.

The worst discovery, which I'm still pinning down the causative variable for, is a playlist that becomes true after reaching X altitude and/or X speed (again, still figuring this out) results in the player rapid-fire reloading a song so it's just a ~1/3 second of noise repeating, and before long KSP hard crashes to desktop.

However, I have been able to get an atmo flight playlist to go with another craft orbiting in space, yes. It plays automatically if the no other parameters are set, but thematically I don't like my Top Gun going while I'm sitting parked on the Runway, i.e. situation: PRELAUNCH. I've had limited success with a playlist that becomes true after reaching X altitude (seems to override the speed parameter, if speed is checked at all). The trouble is I have to pause ( Esc ) and then it starts playing. Hardly the intended usage. But you might try that, @Kerbal101, vs triggering by re-entry.

Edited by Brendan_
@ tagging
Link to comment
Share on other sites

I've done a lot more testing. More testing than I should have -- I'm not really playing the game at this point. But here are my notes:


Having a minimum speed results in the rapid reload stutter.
	playWhen
	{
		inAtmosphere = True
		scene = Flight
		minVelocitySurface = 200
	}

Same problem when exceeding a maximum surface velocity.
	playWhen
	{
		inAtmosphere = True
		scene = Flight
		maxVelocitySurface = 200
	}

Potentially useful, the playlist will play automatically and normally, then stop at a set maximum orbital velocity.
	playWhen
	{
		inAtmosphere = True
		scene = Flight
		maxVelocityOrbital = 270
	}
However, if a playlist has to become true (false at prelaunch), it has to be triggered by pausing/esc or switching camera mode (IVA). Does stop at greater than maxVelocityOrbital value.
	playWhen
	{
		inAtmosphere = True
		minAltitude = 100
		scene = Flight
		maxVelocityOrbital = 270
	}

Since playlists with "scene = Flight" either don't play automatically (have to manually pause to start) or have game-crashing bugs if you include variables this system supposedly supports (i.e. only works if same music sitting prelaunch as flying 1,000m/s at the edge of space), plus it has the wonky need of another craft in orbit (maybe just unloaded; needs more testing), this mod really is only usable for adding or removing tracks to and from KSP's default playlists, not any new ones.

Edited by Brendan_
Link to comment
Share on other sites

In further adventures of not-actually-playing-KSP, @Kerbal101's observation that having another vessel in orbit before an otherwise valid playlist will play can be handled much closer to home! As in, having literally anything else in the Flight scene counts.

At the Runway I tried the pause/unpause trick, no music, then staged a couple of radial decouplers off the wings leaving debris, and as soon as I paused, the playlist started up.

 

So, yeah, still bugged, but maybe this info will help narrow down the cause.

Edited by Brendan_
Link to comment
Share on other sites

Even more needless testing reveals another flaw.

Normally, in the SPH and the VAB there is a "room tone" background ambience that gets lost with this mod. These tracks are named KSP_SPHAmbience and KSP_VABAmbience and sound like construction work happening in a big hangar. I found the names by feeding an invalid playlists.cfg and the in-game UI shows a list of I guess default playlists.

I'm not quite sure how this mod operates, but looking at KSP's debug console logs, it appears that "[STED]" or SoundTrack EDitor inserts the playlists when it detects a Scene Change from [HighLogic] or [UIMasterController] ShowUI messages, including "Game Paused!" Not that I can think of a better way to intercept KSP's default sounds, but this does line up with finding that pausing will start up a playlist whose conditions have become true sometime after launch.

 

I also found a probably useless "feature" in that changing from one scene whose playlist includes "pauseOnGamePause = False" to another scene with a playlist that has no valid tracks listed (either no tracks or file not found), then the previous playlist keeps playing. This is appealing only because in normal KSP, opening the Pause menu (like at the Space Center scene) doesn't make the track start over from the beginning, and in the Main Menu, the music keeps playing when you enter Settings AND when you exit. This trick only got me halfway to normal behavior.

 

One wishlist item for @pizzaoverhead is detecting Situations like FlyingHigh or InSpaceLow which experiments detect, though I don't know how they do it...

Link to comment
Share on other sites

So, I've been digging into the STED source code @pizzaoverhead has shared over on GitHub. I'm on Linux and also not a programmer anyway, but took a crack at learning to at least compile the buggy buggy code as it exists now (I have a new, horrible bug to report, so I feel it's fair commentary on my part). I'm taking a breather after running Mono's "msbuild" command revealed just a bewildering array of C# .NET MS-stack Visual Studio dependencies I would have to figure out how to get, or get around. Again, I've never compiled anything in my life; I've just been around programmers enough to know the concepts. Apparently I've become obsessed enough with a dumb playlist editor to finally take the plunge?

 

NEW BUG!!!

The rapid-reload CTD bug I've encountered before can fire when hitting an altitude on Kerbin that's specified as minAltitude in another playlist that also specifies it's only for "bodyName = Mun".  Specifically, 60000m, which also means "inAtmosphere = True" and my Mun playlist specifies that "inAtmosphere = False" (kind of unnecessary, but I test thoroughly) so on TWO counts, there should be no question that the Mun playlist shouldn't come up, and the playlist it rapidly reloads is a Kerbin inAtmosphere minAltitude=18000 (tried with and without max=70000) that it actually changed to from Kerbin in space low automatically, and was playing just fine until hitting 60km. Removed the Mun minAltitude, and no rapid-reload at 60k.

 

My take, as an idiot who can't code and has done zero work, is that the way STED monitors conditions is totally broken. The minAltitude in my Mun list was added because moonwalking crashed the whole game!! That's the opposite of what moonwalking should ever do -- it is always a good and appropriate action in every situation imaginable.

There are also a lot of unused stubs of features floating around in active code. We're all looking forward to fade in, fade out, crossfade -- gg Pizza. But the bug where another vessel has to exist in the Flight scene is because incomplete functionality for playlists based on being close to another vessel (i.e. Interstellar's Hans Zimmer space station docking music) is in there and I don't yet understand WHY it's behaving as a mandatory check blocking all other functionality, but it is, so the code should be commented out. That clean up is an early goal, if I can first manage to get an MS development stack working on a free operating system, for free, because I'm not buying Visual Studio for this. ...probably.

Link to comment
Share on other sites

5 hours ago, Brendan_ said:

That clean up is an early goal, if I can first manage to get an MS development stack working on a free operating system, for free, because I'm not buying Visual Studio for this. ...probably.

Brendan, I really appreciate your commitment, and would like to hint you to this: Visual Studio Community

It might be helpful. =)

 

Cheers

SchrottBot

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...