Commit graph

21 commits

Author SHA1 Message Date
antoniou79
c9016cb2f2 BLADERUNNER: Notes and minor fixes for sound
Also added a dedicated debugSound channel for debugging

Fixes include closer conformance to original code (for entering/exiting ESPER and VK), and a change in assigning a track slot to a new track with priority equal to the lowest existing (it will now take the place of the old stored track). Also Music::adjustVolume() now takes the target volume as argument and stores it in the track volume field similar to how Music::adjustPan works.
2023-04-24 09:43:51 +03:00
Peter Kohaut
fc98faf01a BLADERUNNER: Mark enhanced edition as unsupported 2022-06-28 23:48:22 +02:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
antoniou79
5f09a046d1 BLADERUNNER: Support mixer sound type for ambient sounds
And set custom sounds for RC outtake FLYTRU_E.VQA to use kSpeechSoundType as do all outtakes
2021-07-02 16:38:49 +03:00
antoniou79
45d9ee85d2 BLADERUNNER: Allow audio stream to start at requested second
This will be used in Restored Content mode
2021-06-14 16:27:18 +03:00
antoniou79
7cb8dc53d6 BLADERUNNER: Fix clearing loop value of queued track
This is an original bug. The loaded queued track becomes _current.

The new _current's loop value should not be forcedly cleared there.
2021-06-12 14:58:07 +03:00
antoniou79
d11765138c BLADERUNNER: Fix bugs for adjustpan, adjustvolume.
This is based in the original code. The bugs were ScummVM Engine specific, probably due to mistyping.
2021-06-12 14:58:07 +03:00
antoniou79
5ab6c92f99 BLADERUNNER: Add a reset() method for Music
Similar to the original source code
2021-06-12 14:58:07 +03:00
antoniou79
1a25c2b69a BLADERUNNER: Remove timerprocs for next track and fadeout
The timers are replaced with "application" timers, which are checked in AudioMixer::tick()

The timerprocs for next and fadeout could potentially cause a game freeze.
This is because they could, under certain race conditions, come to a deadend
while trying to lock the mutexes for access to AudioMixer and Music methods.
The particular use case (non-deterministic) for this was loading a save game
while playing a game that had a music track playing (eg. at MA05, McCoy's balcony).
Here's a rough explanation of a possible lock situation (others could also be possible)
The "Main Thread" and "SDLTimer" threads (as reported from MSVC debug) could become hardlocked.
::Main Thread::
	A. LoadGame() calls _music->stop(0u);
		A1. Locks a Music::_mutex
		A2. Calls vm->_audioMixer->stop()
		A3. AudioMixer::stop() locks AudioMixer::_mutex [THIS DONE]
		A4. calls the endCallback for the music which is Music::ended()
			at Music::ended,
			A41. lock a Music::_mutex (presumably this is ok, even though it's a second lock, because it's the same thread(?))
			A42. call installTimerProc()
				A421. which tries to lock DefaultTimerManager::_mutex from default-timer [THIS FREEZES] - conflict with B11
::SDLTimer::
	B. calls timer_handler,
		B1. calls DefaultTimerManager::handler()
			B11. locks the DefaultTimerManager::_mutex from default-timer [THIS IS DONE]
			B12. we try to service the callbacks from TimerProcs that are currently entered in the TimerSlots queue
				B121. Such a slot is the AudioMixer BladeRunnerAudioMixerTimer, which has the AudioMixer::timerCallback()
				B1211. which calls the at AudioMixer::tick().
						tick() tries to lock the AudioMixer::_mutex [THIS FREEZES] conflict with A3
2021-06-12 14:58:07 +03:00
Thanasis Antoniou
c19336e469 BLADERUNNER: Prevent cause assertion fault and no subtitles for #11294
Bug #11294 is a case where output audio hardware is disabled

If the output sound device is disabled or no hardware output device is connected (eg. Windows 10 may disable output audio hardware when no output device is attached/available), then the game should still be playable. We now use the duration of the tracks (in ms) to detect a track's ending.
Also isReady is checked for mixer when playing VQA videos (it wasn't before).
2020-02-18 00:58:53 +02:00
Thanasis Antoniou
af9ec2f691 BLADERUNNER: Revert uint32 vars to int32 if they could be init to -1 2019-07-22 01:09:23 +03:00
Thanasis Antoniou
caa4578add BLADERUNNER: Use unsigned 32bit diff for time durations 2019-07-17 19:09:15 +03:00
Thanasis Antoniou
a0beaa6f4e BLADERUNNER: SFX named constants and MissSound fix
Still pending cleaning up Ambient_Sounds_Add_Sound and Ambient_Sounds_Add_Looping_Sound calls
2019-04-05 21:35:55 +03:00
Peter Kohaut
ae039b0648 BLADERUNNER: Fixed unexpected music playback 2019-03-04 19:43:45 +01:00
Peter Kohaut
d8eb3c14a4 BLADERUNNER: Removal of memory leaks 2019-02-12 23:07:14 +01:00
Peter Kohaut
b14fbaa72b BLADERUNNER: Cleanup of audio code
Separated audio cache.
Fixed bug in the audio cache where still used sound might get freed.
Fixes crashes when engine is unloading which were caused
by a race condition between the timer code and engine teardown code.
2019-02-11 22:48:07 +01:00
Peter Kohaut
1384afd0f6 BLADERUNNER: Use ScummVM functionality for audio volume management 2019-02-10 16:55:38 +01:00
Peter Kohaut
5e9985bd6e BLADERUNNER: Load game methods
save methods update
replaced few char* with Common::String
changed few pointers to references
2018-03-24 17:28:34 +01:00
Peter Kohaut
62b75b9990 BLADERUNNER: Added Generic Walker actors
Fixed isseue of duplicating items in world
Fixed fog issue with incorrect rendering in special occasions
Added basic debugger console
Refactored looping code for better readability
2018-02-25 22:38:52 +01:00
Peter Kohaut
1e5f9d3078 BLADERUNNER: Added basic KIA interface
Settings works
Help works
Clue database works
Fixed code for inserting objects into scene
Reorganization of few files
Unification & code formatting of few older files
2018-01-28 10:57:16 +01:00
Peter Kohaut
f79d8cc1fe BLADERUNNER: Added music support & added Maggie
added async walking
named some of the game flags & variables
renamed aesc to screen effects
2017-09-10 20:55:30 +02:00