Commit Graph

28 Commits

Author SHA1 Message Date
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
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
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
Alex Henrie 06d9c7e25e libport: Move rint fallback implementations from msvcrt to libport.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-08 20:39:04 +01:00
Huw Davies e6f8f136fa dsound: Pass sample count to the normfunction.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-01 23:35:42 +01:00
Detlef Riekenberg 443130c4cf dsound: Mark a multiplication factor as float.
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-05 23:27:38 +09:00
Andrew Eikum 1def346bab dsound: Support downmixing quadraphonic to stereo.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 23:42:06 +09:00
Andrew Eikum 88dd3b4f6e dsound: Support downmixing 5.1 to stereo.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-19 23:42:02 +09:00
Maarten Lankhorst 09890d7142 dsound: Mix float natively.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-14 14:39:52 +09:00
Francois Gouget 359fbe829a dsound: Remove unneeded NONAMELESSXXX directives. 2015-03-11 22:10:31 +09:00
Mark Harmstone 77b2ab21f4 dsound: Support 5.1 sound. 2015-01-09 17:37:50 +01:00
Mark Harmstone 3ba100d81c dsound: Support quadraphonic sound. 2015-01-09 17:37:48 +01:00
Andrew Eikum 98c653bc8b dsound: Resample to float, not device format. 2012-05-15 16:26:31 +02:00
Andrew Eikum e0ccd9e399 dsound: Change mix_buffer to float instead of INT. 2012-05-15 11:17:46 +02:00
Alexander E. Patrakov 93a0ca7c6c dsound: Clean up channels. 2012-05-01 19:16:23 +02:00
Alexander E. Patrakov f88f3d4149 dsound: Replace convert() functions with get() and put(). 2012-05-01 19:15:49 +02:00
Alexander E. Patrakov 0195e01990 dsound: Clean up MixToTemporary(). 2012-05-01 19:15:12 +02:00
Andrew Eikum b1fdaa81b0 dsound: Remove hardware acceleration support. 2011-09-26 18:38:07 +02:00
Owen Rudge d6f3ca9589 dsound: Add support for 32-bit IEEE float buffers. 2011-01-20 17:50:04 +01:00
Henri Verbeet 5570a1da8e dsound: Don't convert single samples at a time.
This gives a minor performance improvement.
2009-01-15 12:43:37 +01:00
Henri Verbeet 07f9991062 dsound: Const correctness fixes. 2009-01-12 13:22:14 +01:00
Jeff Zaroyko bea7933d95 dsound: Fix a typo in convert_32_to_24. 2009-01-02 11:54:22 +01:00
Alexandre Julliard 80f39e6119 dsound: Avoid use of stdint types. 2008-10-17 13:02:32 +02:00
Maarten Lankhorst 179990ac36 dsound: Remove int24_struct from conversion routines. 2008-08-19 13:36:10 +02:00
Maarten Lankhorst a938f69360 dsound: Add mixing and normalization functions. 2007-11-09 12:23:54 +01:00
Maarten Lankhorst fa3663d6c7 dsound: Add support for 24/32 bits input sound buffers. 2007-11-09 12:20:20 +01:00