New audio rendering code - please test!

Started by Saga Musix, March 25, 2013, 15:49:44

Previous topic - Next topic

Saga Musix

Recently, there has been some refactoring and bugfixing with regards to how audio rendering is done by manx (our latest developer on the team). This required some significant restructuring in the audio play/stop code and related things. Some of the main benefits are:
- Even with WaveOut devices and high latencies, "follow song" is now really smooth and truly in sync with the music, just like with ASIO!
- Live recording is now more reliable.
- Audio device is no longer closed and re-opened when switching between playback between modules (except for when "Restart module" is used, but this might be fixed later)

Some things in the sound card setup has changed. Instead of specifying a buffer size (which is not the same thing as latency, as it's just a fraction of the latency!), you can specify a desired latency and a GUI update interval. The GUI update interval should be low, something like 5ms should work just fine on most systems.
Old buffer settings are imported automatically. For WaveOut/DirectSound, the formula is: Latency = Buffer Size / 3, Update Interval = Buffer Size / 8. For ASIO it's Latency = Buffer Size, Update Interval is ignored (since the number of ASIO buffers is fixed to 2).

And as an added bonus for users of Windows Vista and later, manx has added WASAPI support, which is useful if you don't have ASIO (might also be a nice alternative to ASIO4All).

If you notice any crashes, deadlocks or whatever, please report them here. The new experimental build is available at http://sagagames.de/stuff/mptrack.exe
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Diamond

I haven't noticed any issues with this build yet.

Rakib

WASAPI has made wonders for me who hasn't really got to use ASIO4ALL.

Edit: No bugs to report, and thanks for all your hard effort on OpenMPT!
^^

Nahkranoth


Saga Musix

Using which driver? WASAPI? If OpenMPT uses a different sampling rate than the global rate specified in Windows for this device, it might fail to work (since PortAudio uses a low level WASAPI implementation with no resampling support). Anyway, the build above has been changed so that only supported sample rates are now displayed in OpenMPT's sound card dialog for WASAPI devices - this means that you can no longer select bogus sample rates that your device isn't set up for (and which would normally require resampling by the audio driver).
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Nahkranoth

#5
Thanks, will test soon!

[EDIT]
It works!
Thanks a bunch Jojo!

Saga Musix

Glad to hear that it's working. The new settings in the sound card dialog are now documented in the wiki as well. And again, propos go to manx for implementing all this, I didn't do any of this (apart from redesigning the options dialog). :)
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Nahkranoth

Quote from: Saga Musix on April 04, 2013, 13:30:00
And again, propos go to manx for implementing all this
Then my thanks go to manx too :-)

Saga Musix

Important FAQ item for all the people (not you) complaining that their previously used buffer length values don't work anymore: http://wiki.openmpt.org/Manual:_Frequently_Asked_Questions#OpenMPT_produces_clicks_at_a_buffer_length_that_previously_worked_just_fine
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.