Both come out to the same amount of target latency (as does 32x256, etc) however RageSoundDriver.h defines samples_per_block as 512, so this aims to have chunksize_frames equal 512.
It also defines a constant to define the quantity of buffers so it's not hardcoded in various places and puts the variables in an anonymous namespace.
From top to bottom,
- Fix incorrect gcc implementation in `SetThreadName`
- Static Cast in `StartThread`
- Fix `MutexImpl_Win32::Lock()`
- Remove unnecessary pre-winXP methods in PortableSignalObjectAndWait()
- Static Cast in `EventImpl_Win32::Wait`
These functions are based on "DecodePacket" and "ReadPacket". This
PR does not consume the new buffer or decoding functions yet. It also
preps the class for adding a fast cancel to decoding, in the case that
the movie texture is destroyed while decoding is still happening.
Mainloop lock needs to be held to access PulseAudio object from outside the
event loop thread, in particular in GetPosition() calls. Otherwise we might hit
a race condition and have the call fail. There's also a possibility that the
call might randomly fail if it's called before first timing data is received
for the stream, so handle that case as well.
Also fix the stream write callback to call Mix() with correct parameters, as
well as do the work in a loop in case pa_stream_begin_write() returns smaller
memory buffer than was requested.
Enforcing HIGH_PRIORITY_CLASS is best for Win10+ where Windows Update can interrupt the game and it also prevents streaming apps (OBS/Discord) from causing stutter by taking rendering priority away from ITGMania.
Update ArchHooks_Win32.cpp
Update ArchHooks_Win32Static.cpp
This code provided a 7x accuracy improvement over timeGetTime(). (0.2ms vs 1.4ms std dev*3)
Rename variables to fit with existing naming mechanism
PulseAudio driver used to report position of last frame written to audio stream
instead of actual playback position. This kind of worked, since on average the
write position doesn't diverge too much from actual elaped time, but it can
result in note stuttering and in general isn't very accurate. Change the
implementation to use actual playback position from PulseAudio stream.
Remove some compatibity code with old PulseAudio, since version 0.9.10 was
released in 2008.
Also, as an optimization to avoid unnecessary memory copying, use
pa_stream_begin_write() to mix audio directly into PulseAudio memory.
- Remove checking for standard functions from the build system
- Prefix all invocations with std::
- Replace suffixed functions with unprefixed versions
- Include <cmath> in all files that use it and remove the global include
e.g. floorf(x) -> std::floor(x)
Always build ITGmania with Minimaid
There's no harm in always having this built as it's configurable based on the LightsDriver field.
Update mmmagic.dll -> mmmagic64.dll to conform with the new dll filename
Also fix PacDrive.h header