Commit a599ea83 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

winepulse.drv: Print a winediag error when PA buffer size is too small.

winepulse depends on PulseAudio to allocate the entire requested buffer size. If it allocates less than that size, then mmdevapi clients may not be able to write as much data as they expect. So, we should warn the user that the PA buffer is too small. This is a common symptom of users setting the PULSE_LATENCY_MSEC environment variable, which would help in some situations with winealsa, but is no longer required with winepulse. Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a11b8ded
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "audiopolicy.h" #include "audiopolicy.h"
WINE_DEFAULT_DEBUG_CHANNEL(pulse); 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) #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
...@@ -1336,9 +1337,16 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, ...@@ -1336,9 +1337,16 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
const pa_buffer_attr *attr = pa_stream_get_buffer_attr(This->stream); const pa_buffer_attr *attr = pa_stream_get_buffer_attr(This->stream);
/* Update frames according to new size */ /* Update frames according to new size */
dump_attr(attr); dump_attr(attr);
if (This->dataflow == eRender) if (This->dataflow == eRender) {
if (attr->tlength < This->bufsize_bytes) {
const char *latenv = getenv("PULSE_LATENCY_MSEC");
if (latenv && *latenv)
ERR_(winediag)("PulseAudio buffer too small (%u < %u) - PULSE_LATENCY_MSEC is %s\n", attr->tlength, This->bufsize_bytes, latenv);
else
ERR_(winediag)("PulseAudio buffer too small (%u < %u)\n", attr->tlength, This->bufsize_bytes);
}
This->bufsize_bytes = attr->tlength; This->bufsize_bytes = attr->tlength;
else { } else {
This->capture_period = period_bytes = attr->fragsize; This->capture_period = period_bytes = attr->fragsize;
if ((unalign = This->bufsize_bytes % period_bytes)) if ((unalign = This->bufsize_bytes % period_bytes))
This->bufsize_bytes += period_bytes - unalign; This->bufsize_bytes += period_bytes - unalign;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment