winepulse.drv: Add a winediag message when buffer is too small.

Sebastian Lackner sebastian at fds-team.de
Thu Dec 10 08:27:24 CST 2015


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

After pulseaudio was added, a lot of Debian people complained about missing sound. As it turns out,
this was the result of a packaging "mistake". Debian wrapper scripts set PULSE_LATENCY_MSEC to small
value by default, which worked fine with winealsa.

WINEPREFIX=$wineprefix WINELOADER=$wineloader WINEDEBUG=$winedebug PULSE_LATENCY_MSEC=$latency $wine "$@"

Even when the problem is fixed on Debian, the same problem might still occur when people have set
PULSE_LATENCY_MSEC manually on their machine, and the value is too small. http://ix.io/mJp would
be an alternative solution, but no longer allows users to control this environment variable manually.

This patch adds at least a warning, so that users know which environment variable could be related
when sound is suddenly missing after an upgrade. Comments welcome, would like to know Andrews opinion
first how to proceed with this issue.

 dlls/winepulse.drv/mmdevdrv.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
index 0e6cf9f..9bc345c 100644
--- a/dlls/winepulse.drv/mmdevdrv.c
+++ b/dlls/winepulse.drv/mmdevdrv.c
@@ -57,6 +57,7 @@
 #include "audiopolicy.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(pulse);
+WINE_DECLARE_DEBUG_CHANNEL(winediag);
 
 #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
 
@@ -1976,8 +1977,10 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
     ACImpl_GetRenderPad(This, &pad);
     avail = This->bufsize_frames - pad;
     if (avail < frames || bytes > This->bufsize_bytes) {
+        static int once;
         pthread_mutex_unlock(&pulse_lock);
         WARN("Wanted to write %u, but only %zu available\n", frames, avail);
+        if (!once++) ERR_(winediag)("PulseAudio buffer too small - do you have PULSE_LATENCY_MSEC set?\n");
         return AUDCLNT_E_BUFFER_TOO_LARGE;
     }
 
-- 
2.6.2



More information about the wine-patches mailing list