From 521e5dc51dd01ab206ae21473e7fdeabc3208b4a Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Tue, 18 Dec 2018 23:18:04 +0100 Subject: [PATCH] Document audio settings, fix units for fragment size, fix audio dialog width. --- docs/index.html | 34 +++++++++++++++++++++++++++++----- src/gui/AudioDialog.cxx | 16 ++++++++-------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/docs/index.html b/docs/index.html index 8c9511c96..8d5a8417f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2657,7 +2657,7 @@
-

TODO! Audio Settings dialog:

+

Audio Settings dialog:

@@ -2665,11 +2665,35 @@
- - - - + + + + + + + +
ItemBrief descriptionFor more information,
see CommandLine
VolumeSelf-explanatory-volume
Sample size (*)Set size of audio buffers-fragsize
Frequency (*)Change sound output frequency-freq
Enable soundSelf-explanatory-sound
Enable audioSelf-explanatory-audio.enabled
VolumeSelf-explanatory-audio.volume
ModeSelect an audio preset or choose 'custom' for manual configuration-audio.preset
Fragment sizeThe number of samples in a single fragment processed by the audio driver. Smaller values mean less latency, but may lead to dropouts (depending on OS and hardware).-audio.fragment_size
Sample rate + Output samples per second. Higher values reduce artifacts from resampling and decrease latency, + but may lead to dropouts (depending on OS and hardware). + -audio.sample_rate
Resampling quality + Chooses the algorithm used for resampling (= converting TIA output to the target sample rate). + 'High' and 'ultra' use a high-quality Lanczos filter + but require slightly more CPU, while 'low' may lead to audible screeching artifacts in + some games (notably Quadrun). + -audio.resampling_quality
HeadroomNumber of frames to buffer before playback starts. Higher values increase latency, but reduce the potential for dropouts.-audio.headroom
Buffer sizeMaximum size of the audio buffer. Higher values increase maximum latency, but reduce the potential for dropouts-audio.buffer_size
+

+ IMPORTANT: In order to maintain a stable stream of audio data, emulation speed must be + synchronized with the audio hardware. Buffering happens in multiple places (OS = fragment size, Stella = + headroom and buffer size) and improves the tolerance to speed fluctuations, but introduces latency which + manifests as a lag between audio and video. +

+ Too aggressive settings for your combination of hardware and software (high sample rate, + low fragment size, low headroom, low buffer size) may lead to audio dropouts whose effect may range from + isolated popping artifacts to garbled audio. You can check the system log for related messages. If you + get recurring messages about audio overruns and underruns (isolates underruns / overruns are normal + and a consequence of host system activity), you might have to adjust your settings. +

diff --git a/src/gui/AudioDialog.cxx b/src/gui/AudioDialog.cxx index 09dc0cfe1..ad1fe5c30 100644 --- a/src/gui/AudioDialog.cxx +++ b/src/gui/AudioDialog.cxx @@ -52,7 +52,7 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent, VariantList items; // Set real dimensions - _w = 46 * fontWidth + HBORDER * 2; + _w = 48 * fontWidth + HBORDER * 2; _h = 11 * (lineHeight + VGAP) + VBORDER + _th; xpos = HBORDER; ypos = VBORDER + _th; @@ -87,15 +87,15 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent, xpos += INDENT; // Fragment size - pwidth = font.getStringWidth("512 bytes"); + pwidth = font.getStringWidth("512 samples"); lwidth = font.getStringWidth("Resampling quality "); items.clear(); - VarList::push_back(items, "128 bytes", 128); - VarList::push_back(items, "256 bytes", 256); - VarList::push_back(items, "512 bytes", 512); - VarList::push_back(items, "1 KB", 1024); - VarList::push_back(items, "2 KB", 2048); - VarList::push_back(items, "4 KB", 4096); + VarList::push_back(items, "128 samples", 128); + VarList::push_back(items, "256 samples", 256); + VarList::push_back(items, "512 samples", 512); + VarList::push_back(items, "1 kSamples", 1024); + VarList::push_back(items, "2 kSamples", 2048); + VarList::push_back(items, "4 KSamples", 4096); myFragsizePopup = new PopUpWidget(this, font, xpos, ypos, pwidth, lineHeight, items, "Fragment size", lwidth);