[PATCH] dsound: rework ugly mixer logic

Andrew Eikum aeikum at codeweavers.com
Mon Dec 31 10:59:31 CST 2012


On Sat, Dec 29, 2012 at 01:24:03AM +0100, Maarten Lankhorst wrote:
> +	if(!maxq){
> +		/* nothing to do! */
> +		LeaveCriticalSection(&device->mixlock);
> +		return;
>  	}

This was removed in 8ba4090fc304993. It breaks starting the device in
some situations (write primary mode iirc).

> +		if (native) {
> +			void *buffer = NULL;
> +
> +			hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer);
> +			if(FAILED(hr)){
> +				WARN("GetBuffer failed: %08x\n", hr);
> +				LeaveCriticalSection(&device->mixlock);
> +				return;
> +			}

I think this (mixing directly to RenderClient and skipping WaveQueue)
could be split into a separate patch.

>      hres = IAudioClient_Initialize(device->client,
>              AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST |
> -            AUDCLNT_STREAMFLAGS_EVENTCALLBACK, prebuf_rt, 0, device->pwfx, NULL);
> +            AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 800000, 0, device->pwfx, NULL);
...
> +        frames = (UINT64)device->pwfx->nSamplesPerSec * 800000 / 10000000;

Could you #define the 800000?

Anyway, I gave it a test on ALSA+Pulse and didn't find any issues.
I'll test the other backends when you resubmit.

Andrew



More information about the wine-devel mailing list