public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* portaudio: only OSS host API available since version 19.20210406-2
@ 2023-09-29  0:12 Michael Panzlaff
  2023-09-29 10:04 ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Panzlaff @ 2023-09-29  0:12 UTC (permalink / raw)
  To: cygwin

Hi,

I got the right mailing list by not writing to cygwin-apps.
Since my last cygwin update (which upgraded portaudio
to 19.20210406-2) the library does not function properly anymore an no 
sound playback is possible.

Usually you query portaudio for the various host APIs for and then open 
a stream. In the past Cygwin's portaudio at least supported output via 
MME. In the latest version 19.20210406-2 this doesn't work anymore. The 
only available host API that is reported is OSS, but that doesn't really 
exist on Windows I assume. My best guess is that the package isn't 
configured correctly and isn't compiled with the correct support for all 
the APIs.

I'd be very welcome to get back support for MME. My application is 
currently unsuable on Cygwin because the library doesn't work. If it's 
just a matter of correctly configuring the package, I'd be interested in 
also getting support for the other host APIs that portaudio usually 
supports on native Windows, but that's entirely optional for me :)

Now that I checked, even downgrading to an older version of portaudio 
from the Cygwin installer doesn't fix the problem. So perhaps it's not 
caused by portaudio but from something else in Cygwin. Does anybody have 
any ideas?

Best regards
Michael Panzlaff

PS: Here is a sample C code which queries the host APIs and which should 
list MME and definitely not OSS:

#include <stdio.h>

#include <portaudio.h>

int main(void) {
     printf("Pa_Initialize() = %d\n", Pa_Initialize());
     PaHostApiIndex count = Pa_GetHostApiCount();
     printf("%d host APIs available:\n", count);

     for (int i = 0; i < count; i++) {
         const PaHostApiInfo *info = Pa_GetHostApiInfo(i);
         printf("%s\n", info->name);
     }
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portaudio: only OSS host API available since version 19.20210406-2
  2023-09-29  0:12 portaudio: only OSS host API available since version 19.20210406-2 Michael Panzlaff
@ 2023-09-29 10:04 ` Takashi Yano
  2023-09-29 23:12   ` Michael Panzlaff
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2023-09-29 10:04 UTC (permalink / raw)
  To: cygwin; +Cc: Michael Panzlaff

On Fri, 29 Sep 2023 02:12:51 +0200
Michael Panzlaff rote:
> Hi,
> 
> I got the right mailing list by not writing to cygwin-apps.
> Since my last cygwin update (which upgraded portaudio
> to 19.20210406-2) the library does not function properly anymore an no 
> sound playback is possible.
> 
> Usually you query portaudio for the various host APIs for and then open 
> a stream. In the past Cygwin's portaudio at least supported output via 
> MME. In the latest version 19.20210406-2 this doesn't work anymore. The 
> only available host API that is reported is OSS, but that doesn't really 
> exist on Windows I assume. My best guess is that the package isn't 
> configured correctly and isn't compiled with the correct support for all 
> the APIs.
> 
> I'd be very welcome to get back support for MME. My application is 
> currently unsuable on Cygwin because the library doesn't work. If it's 
> just a matter of correctly configuring the package, I'd be interested in 
> also getting support for the other host APIs that portaudio usually 
> supports on native Windows, but that's entirely optional for me :)
> 
> Now that I checked, even downgrading to an older version of portaudio 
> from the Cygwin installer doesn't fix the problem. So perhaps it's not 
> caused by portaudio but from something else in Cygwin. Does anybody have 
> any ideas?
> 
> Best regards
> Michael Panzlaff
> 
> PS: Here is a sample C code which queries the host APIs and which should 
> list MME and definitely not OSS:

OSS is implemented in cygwin and it works. 19.20210406-2 switches it backend
to OSS rather than win32apis.

Are there any reason to stick to MME backend?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portaudio: only OSS host API available since version 19.20210406-2
  2023-09-29 10:04 ` Takashi Yano
@ 2023-09-29 23:12   ` Michael Panzlaff
  2023-10-05 10:57     ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Panzlaff @ 2023-09-29 23:12 UTC (permalink / raw)
  To: Takashi Yano, cygwin

Hi,

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).

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?

Am 29.09.2023 um 12:04 schrieb Takashi Yano:
> On Fri, 29 Sep 2023 02:12:51 +0200
> Michael Panzlaff rote:
>> Hi,
>>
>> I got the right mailing list by not writing to cygwin-apps.
>> Since my last cygwin update (which upgraded portaudio
>> to 19.20210406-2) the library does not function properly anymore an no
>> sound playback is possible.
>>
>> Usually you query portaudio for the various host APIs for and then open
>> a stream. In the past Cygwin's portaudio at least supported output via
>> MME. In the latest version 19.20210406-2 this doesn't work anymore. The
>> only available host API that is reported is OSS, but that doesn't really
>> exist on Windows I assume. My best guess is that the package isn't
>> configured correctly and isn't compiled with the correct support for all
>> the APIs.
>>
>> I'd be very welcome to get back support for MME. My application is
>> currently unsuable on Cygwin because the library doesn't work. If it's
>> just a matter of correctly configuring the package, I'd be interested in
>> also getting support for the other host APIs that portaudio usually
>> supports on native Windows, but that's entirely optional for me :)
>>
>> Now that I checked, even downgrading to an older version of portaudio
>> from the Cygwin installer doesn't fix the problem. So perhaps it's not
>> caused by portaudio but from something else in Cygwin. Does anybody have
>> any ideas?
>>
>> Best regards
>> Michael Panzlaff
>>
>> PS: Here is a sample C code which queries the host APIs and which should
>> list MME and definitely not OSS:
> 
> OSS is implemented in cygwin and it works. 19.20210406-2 switches it backend
> to OSS rather than win32apis.
> 
> Are there any reason to stick to MME backend?
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portaudio: only OSS host API available since version 19.20210406-2
  2023-09-29 23:12   ` Michael Panzlaff
@ 2023-10-05 10:57     ` Takashi Yano
  2023-10-05 21:21       ` Michael Panzlaff
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2023-10-05 10:57 UTC (permalink / raw)
  To: cygwin; +Cc: Michael Panzlaff

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 <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portaudio: only OSS host API available since version 19.20210406-2
  2023-10-05 10:57     ` Takashi Yano
@ 2023-10-05 21:21       ` Michael Panzlaff
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Panzlaff @ 2023-10-05 21:21 UTC (permalink / raw)
  To: Takashi Yano, cygwin

Hi,

> 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.

interesting. I've now did some experiments with a self compiled 
portaudio with MME and WASAPI and both worked flawless on my machine 
with a suggestedLatency of 10ms. Perhaps this is dependend on the sound 
card used in the computer. The callbacks are called with framesPerBuffer 
of 480.

> 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.

I wouldn't mind using OSS if it supports lower hostBufferSizes so that I 
don't get callbacks with a buffer size of 6000. Apparently 
suggestedLatency has no influence on that.
> 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.

I guess it would be possible but would probably require a patched 
configure script.

Either way if you change it away from OSS or now, I hope I could provide 
some useful feedback.

Best regards,
Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-05 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29  0:12 portaudio: only OSS host API available since version 19.20210406-2 Michael Panzlaff
2023-09-29 10:04 ` Takashi Yano
2023-09-29 23:12   ` Michael Panzlaff
2023-10-05 10:57     ` Takashi Yano
2023-10-05 21:21       ` Michael Panzlaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).