diff --git a/README.md b/README.md index 9673da20..fdd06842 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== +**Bugfixes and features included in the next upcoming release [1]:** + +* Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) + + **Bugs fixed in Wine Staging 1.7.31 [101]:** * ATL IOCS data should not be stored in GWLP_USERDATA ([Wine Bug #21767](https://bugs.winehq.org/show_bug.cgi?id=21767)) diff --git a/debian/changelog b/debian/changelog index af84b77c..7648b149 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ wine-compholio (1.7.32) UNRELEASED; urgency=low * Added patch to ensure dbghelp always checks for debug symbols in BINDIR. + * Added patch for pulseaudio exclusive mode support. * Removed patch to close server fd is there is no space in thread inflight fd list (accepted upstream). * Removed patch to fix bugs in StrStr functions (accepted upstream). * Removed patches to avoid sending messages in FindWindowExW (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index bb037420..7a130831 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -1673,6 +1673,7 @@ winemenubuilder-Desktop_Icon_Path.ok: # | # | This patchset fixes the following Wine bugs: # | * [#10495] Support for PulseAudio backend for audio +# | * [#37042] Implement exclusive mode in PulseAudio backend # | # | Modified files: # | * configure.ac, dlls/mmdevapi/main.c, dlls/mmdevapi/tests/render.c, dlls/winepulse.drv/Makefile.in, @@ -1708,6 +1709,7 @@ winepulse-PulseAudio_Support.ok: $(call APPLY_FILE,winepulse-PulseAudio_Support/0026-winepulse-add-support-for-IMarshal.patch) $(call APPLY_FILE,winepulse-PulseAudio_Support/0027-winepulse-handle-stream-create-failing-correctly.patch) $(call APPLY_FILE,winepulse-PulseAudio_Support/0028-winepulse-expose-audio-devices-directly-to-programs.patch) + $(call APPLY_FILE,winepulse-PulseAudio_Support/0029-winepulse-implement-exclusive-mode.patch) @( \ echo '+ { "Maarten Lankhorst", "winmm: Load winealsa if winepulse is found.", 1 },'; \ echo '+ { "Maarten Lankhorst", "winepulse: Add initial stub for pulseaudio support.", 1 },'; \ @@ -1737,6 +1739,7 @@ winepulse-PulseAudio_Support.ok: echo '+ { "Maarten Lankhorst", "winepulse: add support for IMarshal.", 1 },'; \ echo '+ { "Mark Harmstone", "winepulse: handle stream create failing correctly.", 1 },'; \ echo '+ { "Mark Harmstone", "winepulse: expose audio devices directly to programs.", 1 },'; \ + echo '+ { "Mark Harmstone", "winepulse: implement exclusive mode.", 1 },'; \ ) > winepulse-PulseAudio_Support.ok # Patchset winex11-CandidateWindowPos diff --git a/patches/winepulse-PulseAudio_Support/0029-winepulse-implement-exclusive-mode.patch b/patches/winepulse-PulseAudio_Support/0029-winepulse-implement-exclusive-mode.patch new file mode 100644 index 00000000..5321e6d9 --- /dev/null +++ b/patches/winepulse-PulseAudio_Support/0029-winepulse-implement-exclusive-mode.patch @@ -0,0 +1,92 @@ +From 1e94fe02352f3dd4d0122775a8d6a46266a3171a Mon Sep 17 00:00:00 2001 +From: Mark Harmstone +Date: Tue, 18 Nov 2014 18:35:31 +0000 +Subject: winepulse: implement exclusive mode + +--- + dlls/winepulse.drv/mmdevdrv.c | 46 ++++++++++++++++++------------------------- + 1 file changed, 19 insertions(+), 27 deletions(-) + +diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c +index 368c275..f35a108 100644 +--- a/dlls/winepulse.drv/mmdevdrv.c ++++ b/dlls/winepulse.drv/mmdevdrv.c +@@ -1410,6 +1410,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, + const GUID *sessionguid) + { + ACImpl *This = impl_from_IAudioClient(iface); ++ REFERENCE_TIME def, min; + HRESULT hr = S_OK; + UINT period_bytes; + +@@ -1421,8 +1422,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, + + if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE) + return AUDCLNT_E_NOT_INITIALIZED; +- if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) +- return AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; + + if (flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS | + AUDCLNT_STREAMFLAGS_LOOPBACK | +@@ -1446,27 +1445,26 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, + if (FAILED(hr)) + goto exit; + +- if (mode == AUDCLNT_SHAREMODE_SHARED) { +- REFERENCE_TIME def = pulse_def_period[This->dataflow == eCapture]; +- REFERENCE_TIME min = pulse_min_period[This->dataflow == eCapture]; ++ def = pulse_def_period[This->dataflow == eCapture]; ++ min = pulse_min_period[This->dataflow == eCapture]; + +- /* Switch to low latency mode if below 2 default periods, +- * which is 20 ms by default, this will increase the amount +- * of interrupts but allows very low latency. In dsound I +- * managed to get a total latency of ~8ms, which is well below +- * default +- */ +- if (duration < 2 * def) +- period = min; +- else +- period = def; +- if (duration < 2 * period) +- duration = 2 * period; ++ /* Switch to low latency mode if below 2 default periods, ++ * which is 20 ms by default, this will increase the amount ++ * of interrupts but allows very low latency. In dsound I ++ * managed to get a total latency of ~8ms, which is well below ++ * default ++ */ ++ if (duration < 2 * def) ++ period = min; ++ else ++ period = def; ++ if (duration < 2 * period) ++ duration = 2 * period; ++ ++ /* Uh oh, really low latency requested.. */ ++ if (duration <= 2 * period) ++ period /= 2; + +- /* Uh oh, really low latency requested.. */ +- if (duration <= 2 * period) +- period /= 2; +- } + period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000); + + if (duration < 20000000) +@@ -1771,12 +1769,6 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, + else + *out = closest; + +- /* Winepulse does not currently support exclusive mode, if you know of an +- * application that uses it, I will correct this.. +- */ +- if (hr == S_OK && exclusive) +- return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; +- + TRACE("returning: %08x %p\n", hr, out ? *out : NULL); + return hr; + } +-- +2.1.3 + diff --git a/patches/winepulse-PulseAudio_Support/definition b/patches/winepulse-PulseAudio_Support/definition index 9edd1319..a32d414d 100644 --- a/patches/winepulse-PulseAudio_Support/definition +++ b/patches/winepulse-PulseAudio_Support/definition @@ -1,2 +1,3 @@ Fixes: [10495] Support for PulseAudio backend for audio Fixes: Allow selection of audio device for PulseAudio backend +Fixes: [37042] Implement exclusive mode in PulseAudio backend