Commit Graph

958 Commits

Author SHA1 Message Date
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
Zebediah Figura 3f27d91629 dsound/tests: Link directly to dsound.
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:09 +02:00
Jacek Caban af12270ac6 makefiles: Remove no longer needed explicit ucrtbase imports.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:21:52 +02:00
Akihiro Sagawa 70aeb7e4b0 dsound: Make GlobalHandle() for the sound buffer failed.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-11 15:54:49 +01:00
Akihiro Sagawa e28638afcc dsound/tests: Add a test whether the buffer is a valid global memory.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-11 15:54:44 +01:00
Francois Gouget 75a5107c96 dsound: Move make_fir to the dsound directory.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-09 12:10:52 +01:00
Zebediah Figura e091903999 dsound: Use an SRW lock for the buffer lock.
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-02-03 20:48:04 +01:00
Zebediah Figura 1308700843 dsound: Use an SRW lock for buffer_list_lock.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48408
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-02-03 20:48:04 +01:00
Michael Cronenworth fba65a1537 dsound: Global variable compatibility update for gcc 10.
Signed-off-by: Michael Cronenworth <mike@cchtml.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-24 18:13:58 +01:00
Alistair Leslie-Hughes 65488e6cf1 dsound/tests: Add media object query tests.
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>
2019-11-08 23:38:28 +01:00
Alistair Leslie-Hughes 594cc41e94 dsound/tests: Allow more time for an event to be signalled.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47868
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>
2019-10-03 22:58:06 +02:00
Alistair Leslie-Hughes b360cd67e8 dsound/tests: Add some GetStatus checks.
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>
2019-10-01 22:38:52 +02:00
Alistair Leslie-Hughes eabb3d444c dsound: Primary buffer doesn't support flag DSBCAPS_CTRLFX.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40740
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>
2019-09-27 14:50:23 +02:00
Alistair Leslie-Hughes ff4ef417b7 dsound: Trace each special effect as it's processed.
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>
2019-09-05 19:51:09 +02:00
Alistair Leslie-Hughes 54f1d8e750 dsound/tests: Add effect parameters tests.
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>
2019-09-04 17:11:15 +02:00
Alistair Leslie-Hughes 3ca3a06c98 dsound: Trace all DSBCAPS values.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-02 20:46:35 +02:00
Alexandre Julliard 4c018c32ce dsound: Make a qsort() callback function cdecl.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-22 09:56:53 +02:00
Jacek Caban d0bf94bf2d dsound: Build with ucrtbase.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-07 00:12:25 +02:00
Alexandre Julliard 3e80b93f90 dsound: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-03 10:34:35 +02:00
Nikola Pavlica fc84b8675a dsound: Added 7.1 to stereo downmix.
Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-25 17:28:11 +02:00
Nikola Pavlica 87eaa2f593 dsound: Revised 5.1 to stereo downmix.
Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-25 17:28:11 +02:00
Michael Stefaniuc 841541a6a6 dsound: Remove useless casts to self.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 14:49:58 +01:00
Sven Baars 9689d6e29e dsound: Add missing SetEventHandle error handling (Coverity).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-25 17:35:14 +01:00
Alistair Leslie-Hughes 9a258c5dd7 dsound: IDirectSoundNotify is only available when DSBCAPS_CTRLPOSITIONNOTIFY is specified.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45473
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>
2019-02-13 21:01:56 +01:00
Alistair Leslie-Hughes 061121b81a dsound: Trace ref in a consistent way.
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>
2019-01-11 17:01:31 +01:00
Sven Baars b3b1033541 dsound: Fix a memory leak (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-19 14:58:00 +01:00
Jacek Caban e8fd1c73b2 dsound: Wait on thread handle instead of dedicated event in DirectSoundDevice_Release.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 18:52:44 +01:00
Jacek Caban 158a2c96cc dsound: Close sleepev handle after releasing audio client.
It's used as audio client event handle, so it shouldn't be closed as
long as audio client is alive.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 18:52:28 +01:00
Michael Stefaniuc b21b6ad717 dsound: Primary buffers don't support IDirectSoundNotify.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-16 16:33:02 +01:00