X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6142F3856944 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1696503519; bh=MZlK9Fst3ARdq/HEENXyp2NnWpcFvcYC88Z/6J5vMqY=; h=Date:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Dw21j9Yj2fwVVyQETXVpMDPszlGqV4rrPGkmRg3VmEcxBmIeXHyHJJ+yPDx8XRbBL k4sEUdCJlg3qc8EKyEceBK0fD/2bSmWZPNm1zRcZTENIeC+BCrb8cfNnjysSyC2FaH 11TyHN2XXZ3CcPn0vVrOQG+3HDfMZbEQRBHGjIgA= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEB823858C52 Date: Thu, 5 Oct 2023 19:57:58 +0900 To: cygwin AT cygwin DOT com Cc: Michael Panzlaff Subject: Re: portaudio: only OSS host API available since version 19.20210406-2 Message-Id: <20231005195758.053ee2f4405dcb3c956fc7fa@nifty.ne.jp> In-Reply-To: References: <067beee9-8d53-beec-1b7a-1b0a238cefdc AT fau DOT de> <20230929190454 DOT 99185f44d8396ef326030ecf AT nifty DOT ne DOT jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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 -- 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