Sound is laggy/stuttering

The worst monsters in the Hearthlands warp the fabric of space and time...
User avatar
noindyfikator
Posts: 1478
Joined: Fri Jul 15, 2011 11:10 am

Re: Sound is laggy/stuttering

Post by noindyfikator »

noindyfikator wrote:I think it's time to fix laggy sound/stuttering
IT IS HAPPENING! AFTER 8 YEARS!!!

Image

Image
User avatar
Nightdawg
Posts: 2633
Joined: Fri Feb 28, 2020 12:31 am

Re: Sound is laggy/stuttering

Post by Nightdawg »

but loftar already fixed this, one year ago
Image
jorb wrote: I do not want to over-promise or hype up stuff that could be months out.
"Our primary development direction is toward object-controlled-objects"
User avatar
dafels
Posts: 3071
Joined: Sun Nov 14, 2010 7:49 pm
Yahoo Messenger: davis

Re: Sound is laggy/stuttering

Post by dafels »

noindyfikator wrote:I think it's time to fix laggy sound/stuttering
would be nice, but I don't see it happening until 2030 when AI will be in charge of the codebase
User avatar
Mashadar
Posts: 379
Joined: Thu Jan 20, 2011 9:34 am

Re: Sound is laggy/stuttering

Post by Mashadar »

dafels wrote:
noindyfikator wrote:I think it's time to fix laggy sound/stuttering
would be nice, but I don't see it happening until 2030 when AI will be in charge of the codebase
That may be the case since I encountered the sound issue only on Windows, while loftar develops on Linux.
One likely reason for this is that Windows uses 16ms scheduler time slices, while Linux-based systems usually use 1ms slices.
With this tick rate of 60Hz the audio buffer drains at a rate of ~735 samples per tick. That means if there are scheduling issues or another application takes away the CPU from the audio thread for even one tick the result can be fatal when the audio buffer is small.

The first step would be to make the default audio buffer at least 4096 on Windows.
Another thing that can improve the situation are the WinAPI functions timeBeginPeriod() and timeEndPeriod() from mmsystem.h that allow you to request a higher resolution of e.g. 1ms for your application.
There is probably some way to call them from a Java application.

And then there seems to be a separate issue that affects the audio when the client runs in the background at a reduced frame rate of 5 fps.

Return to “Bugs”