assurance-tunnel
assurance-tunnel
assurance-tunnel
assurance-tunnel

Preloading media before jumping scenes.


  • Tech Staff

    I am trying to figure out what the best practice is for preloading media.
    I have a lot of uncompressed wav files that I need to play, so I don't think that preload all (the full range) makes sense.
    I only need to play one at a time, and each one will be played in its own scene.
    The order of the scenes can change, and will be controlled by a menu scene (scene 1)
    Currently, I have the preload of the wav file started when the button is clicked that will jump to the scene for the loading media.
    I have delayed the jump by 1 sec, thinking this might help the preload??
    I am trying to watch my RAM to get a sense if the WAV is loading before starting to be played in the new scene (another 2 second delay .. again think to allow it to load) but I just can't tell what the status is.
    I am developing on a fast machine than will be used for execution, so I want to be sure preloading is working (I will be testing on the production machine, and have already confirmed that most things are solid)
    Can anyone recommend any improvements to my preloading approach, or Windows tools that will allow me to better see the memory status?



  • I think preloading is global, so I am using it (if at all) in the zero's scene, assuming it will affect the entire patch. I even think I was able to convince myself that that is the fact by some experimentation.

    --8

  • Tech Staff

    Thats my hope.. are you loading all media, or 1 at a time?



  • Yes, I am preloading everything specified in the media window. The preload actor has start index and end index -- I set them to 1 and the last media index correspondingly.

    --8

  • Tech Staff

    How do you determine the required loadtime before initiating scenes containing the media?



  • As I wrote above, my assumption is that the preloading is global, meaning that once the media is loaded it should be available in any scene. So I am opening the setup scene a few minutes before the actual run of all other scenes. Again, this is only my assumption, which I was able to convince myself in doing some experimentation, but somebody else (Mark) should be able to confirm it.

    --8

  • Tech Staff

    I think I will be loading to much if I preload all, so I will stick to loading one at a time for now.. without 'forever'
    I now found that i had the files being preloaded both before leaving the menu scene, and after entering the Play scene.
    Interesting fact, is this didn't cause any error on my pc development machine, but once moved to mac seems to trigger an error alert.


  • Tech Staff

    Hi DusX

    In the old Forum Mark says following: http://forum.troikatronix.com/cgi-bin/forum/gforum.cgi?post=1651#1651
    and for mac users since 1.3.0f15 preloading should be automatic, see here: http://forum.troikatronix.com/cgi-bin/forum/gforum.cgi?post=9979#9979

    Best
    Michel


  • Tech Staff

    @Michel Thanks for the links..
    seems like my approach should do the trick.
    I wish we had an actor to test for preload status, so I could wait for completed preload before playing the MOV (I switched to audio MOVs) but a few second pause should suffice.



  • @Michel Thanks for the links: so what I gather is

    1) Preloading is global, but can be hampered by the operating system, which may put the preloaded media temporarily back to disk. Although this will slow down the start of the playback, it still will be faster compared to no-preloading case.
    2) Although the Jump actor automatically preloads media, preloading will slow it down, and so its timing will not be guaranteed.
    Regarding 1) I guess that depends on the memory available to the system. The more the memory, the less the chances that OS will page the preloaded media back to the disk. On the other hand, if there is no plenty of memory, the OS can page the media back to disk even when the Preload actor is in the immediately preceding scene (the OS knows nothing about scenes).
    Bottom line: get as much of RAM as you can (twice (?) as the media size). 
    --8

  • Tech Staff

    Just incase it helps, this is from the manual.

    _"Some video formats can take a noticeable fraction of a second to start play; The Video Preload actor helps you to avoid that delay by "preloading" a small chunk of the specified movie or movies into your computer's main memory, thus reducing as much as possible the delay in starting playback. Note however that the preload function will only work if snd out, dir stage, and into RAM parameters exactly match the equivalent settings in the Movie Player used to play the movie._
    _Input Properties_
    • mode: This property can be set to either play or forever.

      When set to play, the video is kept in memory until a Movie Player actor starts and then stops playing it. Once that actor stops playing the video, it is removed from memory.

      _When set to forever, the video is kept in memory until it is preloaded again with the mode set to play, or until Isadora quits. Use this option with caution! It is easy to fill up your RAM with videos that you no longer need to play." _