sound: print verbose message if module doesn't support audio_latency option,

docs: small update, remove references to dsound
This commit is contained in:
hap 2025-05-31 12:25:31 +02:00
parent ce38627640
commit 6fbb9dc728
5 changed files with 23 additions and 15 deletions

View File

@ -907,7 +907,7 @@ Split full screen image across monitors. Default is OFF (\-nouseallheads).
.SS Sound options
.\" *******************************************************
.TP
.B \-sound\fR [\fIsdl\fR|\fIportaudio\fR|\fIcoreaudio\fR|\fIdsound\fR|\fIxaudio2\fR|\fInone\fR]
.B \-sound\fR [\fIsdl\fR|\fIportaudio\fR|\fIcoreaudio\fR|\fIwasapi\fR|\fIxaudio2\fR|\fInone\fR]
Specifies which sound subsystem to use for audio output:
.br
\fBsdl\fR uses the Simple DirectMedia Layer audio output system
@ -919,14 +919,15 @@ output and multiple audio APIs.
\fBcoreaudio\fR uses the Core Audio API which supports low-latency
output and AudioUnit effects (only available on macOS).
.br
\fBdsound\fR uses the DirectSound API (only available on Windows).
\fBwasapi\fR uses the Windows Audio Session API (WASAPI) (only available
on Windows).
.br
\fBxaudio2\fR uses the XAudio2 API which supports low-latency output
(only available on Windows).
.br
\fBnone\fR produces no audio output.
.br
Default is 'dsound' on Windows, 'coreaudio' on macOS or 'sdl' on other
Default is 'wasapi' on Windows, 'coreaudio' on macOS or 'sdl' on other
platforms.
.TP
.B \-samplerate, \-srf \fIvalue

View File

@ -1937,9 +1937,9 @@ Core Performance Options
half speed, and a *<factor>* of 2.0 means run at double speed. Note that
changing this value affects sound playback as well, which will scale in
pitch accordingly. A very low speed will introduce sound glitches, this
can be prevented by increasing **-audio_latency**. The internal precision
of the fraction is two decimal places, so a *<factor>* of ``1.002`` is
rounded to ``1.00``.
can be prevented by increasing the :ref:`audio latency
<mame-commandline-audiolatency>`. The internal precision of the fraction is
two decimal places, so a *<factor>* of ``1.002`` is rounded to ``1.00``.
The default is ``1.0`` (normal speed).
@ -2977,17 +2977,16 @@ Core Sound Options
Specifies which sound module to use. Selecting ``none`` disables sound
output and input altogether (sound hardware is still emulated).
Available features, performance and latency vary between sound modules. The
exact interpretation and useful range of the :ref:`latency option
<mame-commandline-audiolatency>` varies between sound modules. You may have
to change the value of the latency option if you change the sound module.
Available features, performance and latency vary between sound modules.
You may have to change the value of the :ref:`latency option
<mame-commandline-audiolatency>` if you change the sound module.
When using the ``sdl`` sound subsystem, the audio API to use may be selected
by setting the *SDL_AUDIODRIVER* environment variable. Available audio APIs
depend on the operating system. On Windows, it may be necessary to set
``SDL_AUDIODRIVER=directsound`` if no sound output is produced by default.
The default is ``dsound`` on Windows. On Mac, ``coreaudio`` is the default.
The default is ``wasapi`` on Windows. On Mac, ``coreaudio`` is the default.
On all other platforms, ``sdl`` is the default.
Example:
@ -3072,10 +3071,9 @@ Core Sound Options
interruptions. A value of 0.0 will use the default for the selected sound
module.
The exact interpretation and useful range of values for this option depends
on the selected sound module. You may need to change the value of this
option if you change the sound module using the :ref:`sound option
<mame-commandline-sound>`.
You may need to change the value of this option if you change the sound module
using the :ref:`sound option <mame-commandline-sound>`. This option is
unsupported on sound modules ``pipewire``, ``pulse``, ``sdl``.
The default is ``0.0``.

View File

@ -497,6 +497,9 @@ int sound_pipewire::init(osd_interface &osd, osd_options const &options)
if(!m_core)
return 1;
if(options.audio_latency() > 0.0f)
osd_printf_verbose("Sound: %s module does not support audio_latency option\n", name());
pw_core_add_listener(m_core, &m_core_listener, &core_events, this);
m_registry = pw_core_get_registry(m_core, PW_VERSION_REGISTRY, 0);

View File

@ -389,6 +389,9 @@ int sound_pulse::init(osd_interface &osd, osd_options const &options)
if(m_generation >= 0x80000000)
return 1;
if(options.audio_latency() > 0.0f)
osd_printf_verbose("Sound: %s module does not support audio_latency option\n", name());
return 0;
}

View File

@ -95,6 +95,9 @@ int sound_sdl::init(osd_interface &osd, const osd_options &options)
char const *const audio_driver = SDL_GetCurrentAudioDriver();
osd_printf_verbose("Audio: Driver is %s\n", audio_driver ? audio_driver : "not initialized");
if(options.audio_latency() > 0.0f)
osd_printf_verbose("Audio: %s module does not support audio_latency option\n", name());
// Capture is not implemented in SDL2, and the enumeration
// interface is different in SDL3
int dev_count = SDL_GetNumAudioDevices(0);