Commit graph

986 commits

Author SHA1 Message Date
Alexandre Julliard 20afe43832 Remove unused NONAMELESS defines. 2023-08-15 18:56:45 +02:00
Alistair Leslie-Hughes 0599292ce7 dsound: Remove DECLSPEC_HIDDEN usage. 2023-07-07 12:20:53 +02:00
Anton Baskanov 69d088ca5b dsound: Take distance and Doppler factor into account. 2023-05-26 11:08:09 +02:00
Anton Baskanov 23eca82ac3 dsound/tests: Test distance and Doppler factor. 2023-05-26 11:08:09 +02:00
Anton Baskanov ef2d8d8e5d dsound: Use the value from SetFrequency when 3D processing is disabled. 2023-05-26 11:08:09 +02:00
Anton Baskanov e7304f7dc6 dsound/tests: Test Doppler shift with 3D processing disabled. 2023-05-26 11:08:09 +02:00
Anton Baskanov 15de4251d1 dsound: Fix Doppler shift in head-relative mode. 2023-05-26 11:08:09 +02:00
Anton Baskanov aed3f7fb4d dsound/tests: Test Doppler shift in head-relative mode. 2023-05-26 11:08:09 +02:00
Anton Baskanov b923aea734 dsound: Clamp the shifted frequency to [DSBFREQUENCY_MIN, DSBFREQUENCY_MAX]. 2023-05-24 18:39:47 +02:00
Anton Baskanov 3d5f2f8796 dsound/tests: Test that the shifted frequency is limited to DSBFREQUENCY_MAX. 2023-05-24 18:39:47 +02:00
Anton Baskanov 315e998951 dsound: Limit the Doppler shift to +-0.5 speed of sound. 2023-05-24 18:39:47 +02:00
Anton Baskanov 8acc3b83e8 dsound/tests: Test that the Doppler shift is limited to +-0.5 speed of sound. 2023-05-24 18:39:47 +02:00
Anton Baskanov 81feccb7e3 dsound: Use relative velocity to compute Doppler shift.
It's less physically correct but closer to the native behavior.
2023-05-24 18:39:47 +02:00
Anton Baskanov 8c26e7e592 dsound/tests: Test Doppler shift with moving listener. 2023-05-24 18:39:47 +02:00
Anton Baskanov 64cdecc632 dsound: Avoid division by zero when calculating Doppler shift. 2023-05-23 14:43:12 +02:00
Anton Baskanov feaaa5bcc3 dsound: Change the speed of sound to 360. 2023-05-23 14:43:12 +02:00
Anton Baskanov 24fa177c00 dsound: Enable Doppler shift. 2023-05-23 14:43:12 +02:00
Anton Baskanov 3c349125ea dsound/tests: Add tests for Doppler shift. 2023-05-23 14:43:12 +02:00
Anton Baskanov ef275facac dsound: Store the frequency of 3D buffers separately. 2023-05-23 14:43:12 +02:00
Anton Baskanov 7e334a7a94 dsound: Allocate big enough committedbuff up front. 2023-04-27 18:33:57 +02:00
Anton Baskanov 136726501c dsound: Acquire the lock when setting 3D buffer parameters. 2023-04-27 18:33:57 +02:00
Anton Baskanov 4871cd032f dsound: Preserve freqAccNum value in DSOUND_RecalcFormat().
Resetting it results in position discontinuity. With frequent
SetFrequency() calls, this produces audible crackling. The issue
affects pedestrian voices in GTA: San Andreas.
2023-04-27 18:33:56 +02:00
Anton Baskanov c2563de512 dsound: Remove redundant assignments to freqAdjustNum and freqAdjustDen. 2023-04-27 18:33:56 +02:00
Anton Baskanov 7bd2e99b66 dsound: Remove the unused nAvgBytesPerSec field. 2023-04-27 18:33:55 +02:00
Alex Henrie 99396d4986 dsound: Use CRT functions for memory allocation. 2023-02-28 15:07:54 +01:00
Alex Henrie 08ec06da54 uuid: Add propkey.h.
Needed to compile Tera Term.
2022-11-08 20:07:51 +01:00
Brendan Shanks 28b6acd155 dsound: Set name of internal threads. 2022-11-08 20:07:51 +01:00
Rémi Bernon 164a4070db dsound: Avoid using pointer value after free.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-15 11:53:29 +02:00
Eric Pouech 5adca71cd7 dsound/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Eric Pouech 86bc819f07 dsound: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:40 +01:00
Eric Pouech c5b0974b93 dsound: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:55 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Florian Will 835dfaab02 dsound: Skip resampling/mixing inaudible buffers.
In some situations, "ZUSI 3" has a lot of secondary buffers in the
PLAYING state, but most of these buffers have a really low volume, so
these buffers are multiplied by 0 before mixing (and possibly after
resampling). There can be hundreds of inaudible buffers at the same
time.

In these situations, the dsound mixthread is unable to mix fast enough,
resulting in sound stuttering and generally poor performance.

To resolve this performance issue, skip the mixing (and possibly
resampling) step for all inaudible secondary buffers.

Signed-off-by: Florian Will <florian.will@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-06 22:55:07 +01:00
Eduard Permyakov 6806954251 dsound: Correctly report hardware audio buffers as unsupported.
Signed-off-by: Eduard Permyakov <epermyakov@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 17:59:26 +01:00
Eduard Permyakov 975d0632a1 dsound: Commit next audio chunk between play cursor and write cursor to playing.
This region of the audio buffer is forbidden to be written to by the
DirectSound specification. The documentation states: "The write cursor
is the point after which it is safe to write data into the buffer. The
block between the play cursor and the write cursor is already committed
to be played, and cannot be changed safely." However, some applications
still do this, which has lead to audio glitches only when using the Wine
DirectSound implementation. Experiments showed that the native DirctSound
implementation will still play the old audio the first time around when the
buffer region gets overwritten. Use an approach of copying the next forbidden
region into a "committed buffer" to add the same behavior to the Wine
implementation.

Out of performance considerations, only copy data to the committed buffer
when we detect that an overwrite is possible (i.e. the current mixing
region of the buffer gets locked).

Signed-off-by: Eduard Permyakov <epermyakov@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:48:41 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Hiroki Awata 8116d4e11c dsound: Notify DSBPN_OFFSETSTOP earlier.
Some games may not receive the DSBPN_OFFSETSTOP event and get stuck if
CloseHandle is called immediately after IDirectSoundBuffer::Stop.  To
solve this problem, IDirectSoundBuffer::Stop will immediately notify
the DSBPN_OFFSETSTOP event.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41292
Signed-off-by: Hiroki Awata <castaneai@by.black>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:21:31 +02:00
Alexandre Julliard 5d82baf974 winecrt0: Add a default implementation DllRegisterServer()/DllUnregisterServer().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Alexandre Julliard bd6b53740c winecrt0: Add a default implementation for DllCanUnloadNow().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Jacek Caban fa54a0b306 dsound/tests: Use nameless unions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 10:06:51 +02:00
Jacek Caban 0536299a99 dsound: Use nameless unions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 10:06:49 +02:00
Jacek Caban b39b9eea39 include: Don't default to WINE_NO_NAMELESS_EXTENSION for Wine build.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-22 21:48:38 +01:00
Alistair Leslie-Hughes 2e8bd2682a dsound: IDirectSoundBuffer8 GetStatus return DSBSTATUS_LOCSOFTWARE for deferred buffers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=21014
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Shawn M. Chapla c0026b5cf3 dsound: Send CaptureBuffer stop notification whenever stopping.
Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Michael Stefaniuc 716cfcb163 dsound: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-19 10:59:29 +02:00
Zebediah Figura 91625e43f4 dsound: Select the nth effect matching the given CLSID in GetObjectInPath().
Instead of selecting the nth effect overall and checking whether it matches.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 21:24:01 +02:00
Zebediah Figura 861cfee25d dsdmo: Stub IDirectSoundFXParamEq.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 12:59:27 +02:00
Zebediah Figura ac528a492b dsdmo: Add a stub equalizer effect.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-28 12:59:27 +02:00
Zebediah Figura afd6cc7297 dsound/tests: Move effect parameter tests to dsdmo.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:38:41 +02:00
Zebediah Figura 7893ef6b9f dsound/tests: Rewrite test_effects().
Use a custom DMO to show the interaction between dsound the DMO more clearly,
and add more tests for IDirectSoundBuffer8::GetObjectInPath().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:38:22 +02:00