Commit Graph
91 Commits
Author SHA1 Message Date
Miro Kropacek fda1ce1672 BACKENDS: ATARI: Change dma playback to interrupt-driven
This not only decreases the amount of XBIOS calls but also avoids
repeating the sample buffer in case of a heavier CPU load.

Also clean up the mixer code.
2024-02-24 03:54:54 +01:00
Eugene Sandulenko f1a8595d6d BACKENDS: Add missing override keyword 2023-11-10 15:22:26 +01:00
Miro Kropacek 15a1455e0d BACKENDS: ATARI: Allow mixing into mono
Please note that Falcon 16-bit playback doesn't allow only one channel.
2023-11-09 18:20:06 +01:00
Miro Kropacek f7d78ec70a BACKENDS: ATARI: Implement internal downsampling to 8-bit
So we don't rely on STFA's questionable algorithms and we can use
X-SOUND, too.
2023-11-09 18:20:06 +01:00
elasota bd857272f4 BACKENDS: SDL: Use null mixer if audio initialization fails, and add a flag to forcibly disable it for testing. Add an alternate call that returns true if the mixer manager is a null device.
SDL audio init will fail on Windows if all audio output devices are disabled.
Only about 10 engines are checking for this case and numerous pieces of common code (EmulatedOPL, VideoDecoder) fail as well, so this acts as a fallback to prevent instability.
2023-11-07 02:45:49 +01:00
Miro Kropacek 360ddb45e5 BACKENDS: ATARI: Silence remaining samples on playback 2023-10-25 22:23:25 +02:00
Miro Kropacek d4d9307a69 BACKENDS: ATARI: Use atari_sound_setup code 2023-09-24 17:48:54 +02:00
Miro Kropacek 5a756fe2f4 BACKENDS: ATARI: Restore key click 2023-08-12 17:38:49 +02:00
Miro Kropacek d9a5de0fe6 BACKEND: ATARI: Screen shaking and some fixes
- surface setup for optimized 4-bit C2P routine wasn't properly detected

- STFA pretends to support Falcon sampling frequencies on TT leading to
  suboptimal sample mixing

- delayMillis() should check also for other events (fixes Future Wars)
  but avoid doing it for SCI as its MIDI timer would call itself in a
  recursive loop

- SuperVidel doesn't need to use VsetScreen() in VBL anymore

- Wetlands, Teen Agent, Shivers and Private Eye need non-aligned
  surface  widths

- However Wetlands and Private Eye use setCursorPalette, see
  https://bugs.scummvm.org/ticket/14524

- Added warning for Phantasmagoria's 630x450, nothing can be done there
  as the game also requires non-aligned surfaces and at the same time
  the buffer has to be aligned on 16 bytes.

- BDF scaling disabled by default
2023-07-19 22:22:11 +02:00
Miro Kropacek 2ce02658ec BACKENDS: ATARI: DMA playback is not always active
E.g. in the overlay there's no need to steal cycles for playing empty
sample buffer.

Also make STMIDI default audio driver for the slim version.
2023-06-15 22:57:55 +02:00
Miro Kropacek 5537759c53 BACKENDS: ATARI: Rework
- Atari TT support
- all video and audio is now handled via XBIOS
- reworked IKBD handling using Kbdvbase vectors, esp. Kbdvec()
- video uses proper triple buffer
- arbitrary game screen size support
- many fixes and optimizations
2023-06-15 22:57:55 +02:00
Miro Kropacek 9ed3d0b5fe BACKENDS: ATARI: Avoid depletion of mixer slots
This was a bad idea from the beginning (see https://github.com/scummvm/scummvm/pull/4687/files#r1096804842)
but fortunately there is an easy and safe workaround: providing a buffer
with zero length. That way mixCallback() is always called while mixing
is avoided.

Also rename "output_samples" to "audio_buffer_size" to be on par with
the official documentation: https://docs.scummvm.org/en/latest/advanced_topics/understand_audio.html#buffer.
2023-04-07 17:31:40 +02:00
Miro Kropacek 4d21a496d2 BACKENDS: ATARI: Add new backend (graphics, mixer, platform)
Compile as:

./configure --backend=atari --host=m68k-atari-mint --enable-release --disable-mt32emu --disable-lua --disable-nuked-opl --disable-16bit --disable-scalers --disable-translation --disable-eventrecorder --disable-tts --disable-bink --opengl-mode=none --enable-verbose-build --prefix=/usr --bindir=/ --datarootdir=share --datadir=data && make -j 16 && m68k-atari-mint-flags -S -r ./scummvm && make install DESTDIR=$PWD/_release/ && mv $PWD/_release/scummvm $PWD/_release/scummvm.ttp
2023-03-04 23:38:42 +01:00
Miro Kropacek 387ceddef1 AUDIO: Use 49170 Hz instead of 44100 Hz for the FreeMiNT platform 2023-03-04 23:38:42 +01:00
Cameron Cawley 749fd8b490 SDL: Allow selecting the audio channel count from the command line 2022-11-18 17:17:00 +01:00
Cameron Cawley 9f4f22b3bf AUDIO: Support mono audio output in the mixer 2022-11-18 17:17:00 +01:00
Eugene Sandulenko 5e05f93f36 ALL: Remove Symbian port 2022-05-28 12:32:29 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Andrea Boscarino f37489dd80 AUDIO/BACKENDS: Store output audio buffer size in Mixer 2021-12-09 22:03:40 +01:00
Orgad Shaneh 44219dfa1a BACKENDS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Cameron Cawley 811a80d279 DS: Fix crash on exit 2021-08-26 17:05:14 +01:00
Cameron Cawley 659ee35acd DS: Avoid deleting the mixer twice 2021-08-25 01:05:01 +01:00
Cameron Cawley 0a9bf3708f DS: Update the MaxMod callback manually 2021-06-19 14:32:10 +02:00
Martin Gerhardy 99d26579a0 BACKENDS: fixed mismatched new[] vs delete call in NullMixerManager
used in the EventRecorder
2021-02-20 22:37:19 +01:00
Cameron Cawley 1c40d79732 DS: Begin modularizing the DS backend 2021-02-04 01:59:14 +01:00
Cameron Cawley 8b55134547 DS: Re-add audio support using MaxMod 2021-02-04 01:59:14 +01:00
Cameron Cawley e16844b6e9 NULL: Make use of NullMixerManager 2020-08-24 14:22:35 +02:00
Cameron Cawley d1bfa2c4ec BACKENDS: Modify the null mixer manager to not require SDL 2020-08-24 14:22:35 +02:00
Cameron Cawley 697d1a8672 BACKENDS: Added an abstract MixerManager class 2020-08-24 14:22:35 +02:00
Eugene Sandulenko 9a2ba16767 BACKENDS: Shut down individual SDL subsystems 2020-08-20 01:25:55 +02:00
athrxx 43678ae0c8 SDL: fix --output-rate commandline option
The commandline otion was ignored. The code would only query the scummvm.ini setting but not the transient domain (=commandline) setting.
2020-06-18 18:35:25 +02:00
Eugene Sandulenko 75ba54aa3e BACKENDS: Remove LinuxMoto port.
This was a relatively short-lived port. We have it broken and
disabled on the buildbot since 2016. Also, the last builds
were provided in 2011. Thus, it makes a little sense to continue
to keep the code in the repository, as it gets bitrot.
2020-03-09 14:31:14 +01:00
Cameron Cawley 2048c9cc78 AUDIO: Remove unused parameter from the MixerImpl constructor 2019-11-30 17:47:34 +02:00
Cameron Cawley f2b9f7bb76 BACKENDS: Remove the Windows CE port 2019-11-17 22:33:56 +01:00
Cpasjuste 488bbb267a SWITCH: add nintendo switch support 2019-05-12 11:59:44 +03:00
Cameron Cawley bcef809e61 WINCE: Fix compilation 2019-04-15 08:06:39 +03:00
Thierry Crozat 20e628cac3 SDL: Remove code for unused DoubleBufferSDLMixerManager 2017-09-12 21:46:20 +01:00
Colin Snover fa52df018e SDL: Fix DoubleBufferSDLMixerManager doubling audio latency
If it turns out that everything that had previously been fixed by
this manager is broken by this change, everything that had been
fixed probably could have been fixed by just increasing the audio
buffer size in SdlMixerManager. :\
2017-09-12 11:35:50 -05:00
Colin Snover 4a75fbab1b SDL: Reduce audio playback latency
The previous default buffer size of 4096 samples for 44kHz mixer
would add up to 93ms of audio latency, which is fine for early
adventure games, but this is significantly more latency than is
acceptable for games with full motion video. For these games,
the latency needs to be kept within roughly +15ms and -45ms of
video frame presentation to avoid lip sync problems. With this
change, the default audio buffer size is calculated to be 1024
samples at 44kHz (which happens to match what DOSBox uses).

There is a possibility that the reduced latency may cause issues
that did not previously exist with things like the MT-32 emulator,
where a larger buffer size allowed for a larger window where
high-complexity synthesis that could not be generated in realtime
could be balanced out by low-complexity synthesis that could be
generated faster than realtime. In this case, rather than
increasing the system mixer buffer size again, please move the
MT-32 emulator into its own thread and give it its own larger ring
buffer into which it can generate more sample data in advance,
independently from the rest of the audio system.

For other systems where this buffer size reduction might cause a
problem with audio drop-outs, a new audio_buffer_size
configuration option has been added to allow users to tweak the
audio buffer size to match their machine's ability to generate
audio samples.

Fixes Trac#10033. Also improves playback of samples in SCI that
were programmed to restart across several consecutive frames,
relying on lower audio latency in the original engine for this to
not sound bad, like the hopping sound at the start of chapter 1
of KQ7, and the sound of turning on the power in the digger train
in the Lighthouse volcano.
2017-09-12 11:30:01 -05:00
Colin Snover eb4e9fe1d4 GUI: Remove mostly-broken audio output sample rate control
Removing this GUI control was suggested as far back as 2011 at
<http://lists.scummvm.org/pipermail/scummvm-devel/2011-November/010416.html>.
There were no objections, but it was never removed. When working
on audio latency bugs, I independently rediscovered that the GUI
option was broken: the per-game options would *never* work, and the
option would not take effect until ScummVM was restarted because
there is no API for interacting with the backend audio mixer. So
now, it is finally gone.

Primarily for the sake of future troubleshooting, configurability
of the audio sample frequency within SdlMixerManager is maintained
for the moment, but now users will need to edit their ScummVM
configuration file manually to change it.
2017-09-12 11:27:45 -05:00
cpasjuste 70988527c6 PSP2: Add Playstation Vita (PSP2) support 2017-03-04 15:42:19 -06:00
Bastien Bouclet f37fb24caa PS3: Set the default audio output rate to 48000 Hz
SDL does an awful job at resampling 44100 -> 48000 Hz
2015-12-15 20:10:19 +01:00
Bastien Bouclet aa9191c4c4 PS3: Remove the SDL2 mixer manager.
It was only used by the PS3 backend, and the standard SDL mixer was fixed
to work in the PS3 case.
2015-12-15 20:10:19 +01:00
Bastien Bouclet f985a039d5 SDL: Ensure the audio sample format is supported
When SDL returns an unsupported audio sample format, ask
SDL to do resampling to the one ScummVM expects.

This is needed for the PS3 which natively only supports
32 bits floating point as a sample format.
2015-12-15 20:10:19 +01:00
Bastien Bouclet b9a1074999 PS3: Make use of an updated SDL2 version
This version, available at https://bitbucket.org/bgK/sdl_psl1ght, is based on SDL 2.0.3.
2015-12-15 20:10:19 +01:00
Einar Johan Trøan Sømåen 07623530f3 SDL: Special case the call to SDL_CreateThread for SDL2, since SDL2 requires threads to be named.
- Fixes compilation on OS X with SDL2 enabled, SDL1 builds should be entirely unaffected.
2015-03-06 02:27:48 +01:00
Johannes Schickel 99f4dafa72 SDL: Also print audio driver used when built with SDL2. 2015-01-25 21:23:26 +01:00
Johannes Schickel 8530997fff SDL: Add experimental support for SDL2.
This is based upon skristiansson's change set to make ScummVM work with SDL2.
2015-01-25 20:23:25 +01:00
Johannes Schickel e80bdfc5b4 PS3: Default to 44kHz sound output. 2014-06-22 18:23:05 +02:00
Johannes Schickel cd306f194c SDL: Default to 44kHz sound output. 2014-06-22 18:22:50 +02:00