Author Topic: New audio rendering code - please test!  (Read 2886 times)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,247
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
New audio rendering code - please test!
« on: March 25, 2013, 15:49:44 »
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
« Last Edit: April 06, 2013, 14:29:30 by Saga Musix »
» 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.

Offline Diamond

  • Workaholic artist
  • ***
  • Posts: 271
Re: New audio rendering code - please test!
« Reply #1 on: March 30, 2013, 22:31:24 »
I haven't noticed any issues with this build yet.

Offline Rakib

  • Crazy artist
  • ****
  • Posts: 885
  • Operating System: win7x64
Re: New audio rendering code - please test!
« Reply #2 on: March 31, 2013, 21:40:42 »
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!
^^

Offline Nahkranoth

  • Crazy artist
  • ****
  • Posts: 551
  • Gender: Male
Re: New audio rendering code - please test!
« Reply #3 on: April 03, 2013, 10:32:35 »
Unable to open sound device.

Win7 x86.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,247
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
Re: New audio rendering code - please test!
« Reply #4 on: April 03, 2013, 14:30:34 »
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.

Offline Nahkranoth

  • Crazy artist
  • ****
  • Posts: 551
  • Gender: Male
Re: New audio rendering code - please test!
« Reply #5 on: April 04, 2013, 06:37:59 »
Thanks, will test soon!

[EDIT]
It works!
Thanks a bunch Jojo!
« Last Edit: April 04, 2013, 07:37:14 by Nahkranoth »

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,247
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
Re: New audio rendering code - please test!
« Reply #6 on: April 04, 2013, 13:30:00 »
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.

Offline Nahkranoth

  • Crazy artist
  • ****
  • Posts: 551
  • Gender: Male
Re: New audio rendering code - please test!
« Reply #7 on: April 04, 2013, 13:34:02 »
And again, propos go to manx for implementing all this
Then my thanks go to manx too :-)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,247
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
Re: New audio rendering code - please test!
« Reply #8 on: April 04, 2013, 22:02:52 »
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.