Subject: Re: portaudio: only OSS host API available since version 19.20210406-2
From: Takashi Yano via Cygwin <[email-masked]>
To: [email-masked]
Cc: Michael Panzlaff <[email-masked]>
Date: Thu, 5 Oct 2023 19:57:58 +0900
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>

Sorry for late reply.

On Sat, 30 Sep 2023 01:12:22 +0200
Michael Panzlaff wrote:
> thank you for the quick reply. I checked my program again and there was 
> indeed a bug which prevent OSS from working. Though, it's not really OSS 
> what was the problem. The problem was the huge buffer size that OSS causes.
> 
> I set a suggested latency of 0.008 (which is what I obtain from 
> defaultLowOutputLatency) and the audio callback get's a framesPerBuffer 
> size of 6000! At 48 kHz that is more than 100 ms of latency. I'm not 
> suggesting that MME is the best solution, but it was able to get 
> something below 50 ms (not sure what defaultLowOutputLatency was with that).

In my environment, portaudio with MME support generates choppy sound
for the suggestedOutputLatency of less that 60 ms. 70 ms seems to
work. In this case, hostBufferCount=8 and hostBufferSizeFrams=480
if the sample rate is 48 kHz. So, total buffer length is 3840 samples.
Therefore, the resulted  latency is 80 ms.

OSS implementation in cygwin 3.4.9 always uses the buffer size of
125 ms. So, even if hostBufferCount=2 (current value of portaidio
with OSS support), the latency is 250 ms. This might not be acceptable
for some applications.

Now I am trying to reduce latency of OSS implementaion in cygwin
3.5.0, and I could reduce the latency to 3840 samples so far.

> Is there a difference when building portaudio for Cygwin instead of 
> native Windows? Is there a specific reason why MME, DirectSound, WASAPI 
> are not available? Do they cause maintenance overhead?

Unfortunately, OSS and MME/DSound/WASAPI can be exclusively enabled.
I am currently considering whether to rollback portaudio to MME/
DSound/WASAPI until cygwin 3.5.0 is released.

-- 
Takashi Yano <[email-masked]>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple