Playback lag issues and messing with sound

please help me, my last animation I didn’t have this problem and i had over 700 frames, but I started a new animation and after around 100 frames it started lagging when I press play to watch the animation, I keep trying to replay it but it keeps lagging, and due to the lag it messes with the sound because some parts are supposed to be on beat but aren’t because it lags, when I export the movie I don’t get the issue, please note that I’m not using pencil 2d to actually draw the frames, I use an illustrating software, and later import the frames as images to pencil 2d, but I don’t think that’s the issue because i used that same technique last animation and I had no issues, please help me.

@helpme Hi. Unfortunately there are two different issues at play here.

The are as follows:

  1. Pencil2D uses a Memory Cache system which loads the frames into the RAM to be available for playback. By default the old number was 200 frames, but now it’s expressed in MBs and IIRC the default is 1GB (1024mbs) however with this in place you have to let the playback roll at least twice so the visual portion doesn’t stutter. This doesn’t affect sound AFAIK.
  2. Basically any sound lag you will experience is proportional to the amount of layers and frames the project has, and this is regardless of your computer specs (though it does help if the computer is “faster”). Consider that you are doing real-time playback so your computer will be constantly evaluating the project resources trying to catch up. No existing software does this properly. Even Adobe Animate has an offset problem.

    However lucky for commercial apps they have a preview or pre-render system. In Animate you have the “Test Movie” option, and in Harmony you have the “Pre-Render Movie” option. Pencil2D does not have a similar feature implemented at the moment (but it’s planned)

    It’s important to clarify that, from testing, no matter what you do the sound will never be properly synchronized during real time playback. The only way to listen to properly synchronized audio is to use the audio scrubbing feature or to render the movie (which we advice to do map a shortcut for export, and change the settings at the movie export dialog to lower the video resolution to 1/4th of the current size so it’s faster)

I personally recommend to use the sound scrubbing function for only lipsync and beat synchronization.

You can also read the Known Issues section on the following guide to learn a bit more about other potential problems that might be effecting your perception of sound during playback.

oh man all these big words i don’t really get I’m an artist not a genius, but many including me would argue that’s the same thing, but from what I understood this problem cant really be fixed but I will try sound scrubbing and see how it goes thank you for all the help man its greatly appreciated.

@helpme Apologies, didn’t mean to make it more difficult, rather the opposite. These are concepts that one has to learn and apply even as an artist.

Yes, as you surmised currently using audio scrubbing is the only in-editor solution to preview how the sound is actually synchronizing with the visuals.

Another way is to simply export a smaller preview video every now and then (change the resolution in the export dialog only). It’s probably faster if you only export parts you want to review.

(For future reference)

Basically any sound lag you will experience is proportional to the amount of layers and frames the project has…

The resolution of the project (specifically the size of the keyframes and the combined size of keyframes at a particular frame) also can have a big impact on playback speed. If you are thinking of playback speed relative to realtime, the fps of the project also has a big impact on how close you get to the expectation of realtime playback.

You can remove the lag, by deciding to render the animation to .mp4 format and then playing it using a video playback program for example vpn player.

There’s another potential problem with animation programs. That is they generate vast amounts of data files, which require management.

I’ve found on a recent project, which doesn’t yet have any sound file, that there were lag issue. These happened because I moved a single graphic from one side of the screen to the other. This graphic appears in 35 frames.

I saved the project and then pressed the ‘play button’! The first 6 or 7 frames played played correctly, but from then onwards the images contained the pre-edited image.

The problem was Pencil2D hadn’t had time to pre process these frames to allow efficient and correct display.

Thankfully Pencil2D didn’t crash and after a short wait, I pressed the ‘play button’ again and the frames displayed correctly. I was at fault for being in too much of a hurry.

Some programs like Animator, don’t respond to the play command until the pre processing is complete. When their ‘play button’ is pressed and as the command is accepted the button changes background to indicate this fact.

There are lots of background processes involved in animation software. Ultimately the best check is to export the animation to video and play it using a video display program. The video file formats are streamlined for efficient playback of sound and video images.