[PATCH] dsound: Always resample buffers in mixer thread

Alexander E. Patrakov patrakov at gmail.com
Sat Dec 24 08:32:51 CST 2011

This patch sort-of reverts commit
3aeedea0b646a0b6a783a67069bedf00ce0131c8 and thus fixes bugs 9612,
28748, 16513 and many duplicates that mention "winetricks
dsoundbug9612". I want to see it in wine-1.4.

Currently Wine allows the user to select by editing the registry
whether to resample dsound buffers in the application thread on unlock
(default) or in the mixer thread on as-needed basis. However, there are
at least two unfixable problems (see below) in the "resample on unlock"

Problem 1: not all applications call IDirectSoundBufferImpl_Unlock.
Counterexample: Two Worlds (bug 28748).

Problem 2: implementing a high-quality resampler (i.e. anything
different from the current zero-order-hold approach) is impossible if
resampling is done on unlock, because of the "lock whole buffer"
scenario. To get correctly resampled audio at the edge of the buffer,
the interpolating resampler has to have access to old samples just
beyond the edge, and they may be already inaccessible e.g. because the
app locked and overwrote the whole buffer.

So let's just kill the problematic approach. I understand that this
might cause regressions, but here we are trading unfixable design
issues for fixable bugs.

Alexander E. Patrakov
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-dsound-Always-resample-buffers-in-mixer-thread.txt
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20111224/9245dd59/attachment.txt>

More information about the wine-patches mailing list