Received: by mail.netbsd.org (Postfix, from userid 605) id 8F76A84D5E; Sun, 24 Nov 2019 13:15:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 1615084D50 for ; Sun, 24 Nov 2019 13:15:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id BMP-CuhkMoCy for ; Sun, 24 Nov 2019 13:15:16 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 4EB4784CEA for ; Sun, 24 Nov 2019 13:15:16 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 4C6BEFA97; Sun, 24 Nov 2019 13:15:16 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1574601316197680" MIME-Version: 1.0 Date: Sun, 24 Nov 2019 13:15:16 +0000 From: "Nia Alarie" Subject: CVS commit: pkgsrc/audio To: pkgsrc-changes@NetBSD.org Reply-To: nia@netbsd.org X-Mailer: log_accum Message-Id: <20191124131516.4C6BEFA97@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1574601316197680 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: nia Date: Sun Nov 24 13:15:16 UTC 2019 Modified Files: pkgsrc/audio/audacity: Makefile pkgsrc/audio/portaudio: Makefile distinfo pkgsrc/audio/portaudio/patches: patch-src_hostapi_oss_pa__unix__oss.c Log Message: portaudio: Fix recording with the OSS backend on NetBSD. This is trying to open /dev/audioX in non-blocking mode and poll() it. This basically never works as expected, and is especially pointless with the short reads PortAudio is doing. So don't do it. It is also asserting some values to be returned from ioctls which the emulation layer doesn't provide. This is also nearly entirely pointless, so don't do it. Recording now works in audacity. Bump portaudio's PKGREVISION. To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 pkgsrc/audio/audacity/Makefile cvs rdiff -u -r1.25 -r1.26 pkgsrc/audio/portaudio/Makefile cvs rdiff -u -r1.19 -r1.20 pkgsrc/audio/portaudio/distinfo cvs rdiff -u -r1.2 -r1.3 \ pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1574601316197680 Content-Disposition: inline Content-Length: 7128 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/audio/audacity/Makefile diff -u pkgsrc/audio/audacity/Makefile:1.127 pkgsrc/audio/audacity/Makefile:1.128 --- pkgsrc/audio/audacity/Makefile:1.127 Sun Nov 24 00:47:34 2019 +++ pkgsrc/audio/audacity/Makefile Sun Nov 24 13:15:16 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.127 2019/11/24 00:47:34 nia Exp $ +# $NetBSD: Makefile,v 1.128 2019/11/24 13:15:16 nia Exp $ DISTNAME= audacity-2.3.3 CATEGORIES= audio @@ -8,7 +8,7 @@ GITHUB_TAG= Audacity-${PKGVERSION_NOREV} MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= https://www.audacityteam.org/ -COMMENT= Audio editor +COMMENT= Multi-track audio editor and recorder LICENSE= gnu-gpl-v2 # AND cc-by-v3.0-license WRKSRC= ${WRKDIR}/audacity-${GITHUB_PROJECT}-${PKGVERSION_NOREV} Index: pkgsrc/audio/portaudio/Makefile diff -u pkgsrc/audio/portaudio/Makefile:1.25 pkgsrc/audio/portaudio/Makefile:1.26 --- pkgsrc/audio/portaudio/Makefile:1.25 Sat Oct 26 17:22:07 2019 +++ pkgsrc/audio/portaudio/Makefile Sun Nov 24 13:15:15 2019 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.25 2019/10/26 17:22:07 nia Exp $ +# $NetBSD: Makefile,v 1.26 2019/11/24 13:15:15 nia Exp $ DISTNAME= pa_stable_v190600_20161030 PKGNAME= ${DISTNAME:S/^pa_stable_v/portaudio-/1:S/_/./g} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ EXTRACT_SUFX= .tgz Index: pkgsrc/audio/portaudio/distinfo diff -u pkgsrc/audio/portaudio/distinfo:1.19 pkgsrc/audio/portaudio/distinfo:1.20 --- pkgsrc/audio/portaudio/distinfo:1.19 Mon Oct 28 15:32:24 2019 +++ pkgsrc/audio/portaudio/distinfo Sun Nov 24 13:15:15 2019 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.19 2019/10/28 15:32:24 nia Exp $ +$NetBSD: distinfo,v 1.20 2019/11/24 13:15:15 nia Exp $ SHA1 (pa_stable_v190600_20161030.tgz) = 56c596bba820d90df7d057d8f6a0ec6bf9ab82e8 RMD160 (pa_stable_v190600_20161030.tgz) = e6e5cd3f3cb7469aa17549c189e445d573567e13 @@ -11,4 +11,4 @@ SHA1 (patch-src_common_pa__front.c) = cd SHA1 (patch-src_common_pa__stream.c) = 58e6ab2a61957208973a59be2f1140abc922f360 SHA1 (patch-src_common_pa__stream.h) = 94781a9ae79ea1340eea8caadc106416c019cf74 SHA1 (patch-src_hostapi_alsa_pa__linux__alsa.c) = 6ddbeca36be30153f9c6c316c2fb78c06bbbf05d -SHA1 (patch-src_hostapi_oss_pa__unix__oss.c) = 5652426814a3fc82ed802d8082a74aa460c822ca +SHA1 (patch-src_hostapi_oss_pa__unix__oss.c) = 47678cab04dfd5c221bd15e2c8af741bca2d843c Index: pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c diff -u pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c:1.2 pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c:1.3 --- pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c:1.2 Sat Oct 26 17:22:08 2019 +++ pkgsrc/audio/portaudio/patches/patch-src_hostapi_oss_pa__unix__oss.c Sun Nov 24 13:15:15 2019 @@ -1,12 +1,40 @@ -$NetBSD: patch-src_hostapi_oss_pa__unix__oss.c,v 1.2 2019/10/26 17:22:08 nia Exp $ +$NetBSD: patch-src_hostapi_oss_pa__unix__oss.c,v 1.3 2019/11/24 13:15:15 nia Exp $ -Don't write an endless stream of silence when preparing the stream. +Remove some rather pointless assertions that are incompatible with NetBSD's OSS +emulation layer. + +Don't write an endless stream of silence when preparing the stream and don't try to +use OSS in non-blocking mode or poll it on NetBSD, this is unsupported. Add features needed to make portmixer work with audacity. --- src/hostapi/oss/pa_unix_oss.c.orig 2016-10-30 01:23:04.000000000 +0000 +++ src/hostapi/oss/pa_unix_oss.c -@@ -1477,6 +1477,7 @@ static PaError PaOssStream_Prepare( PaOs +@@ -1040,23 +1040,13 @@ static PaError PaOssStreamComponent_Conf + PA_ENSURE( Pa2OssFormat( hostFormat, &temp ) ); + nativeFormat = temp; + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SETFMT, &temp ), paUnanticipatedHostError ); +- PA_UNLESS( temp == nativeFormat, paInternalError ); + + /* try to set the number of channels */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_CHANNELS, &chans ), paSampleFormatNotSupported ); /* XXX: Should be paInvalidChannelCount? */ +- /* It's possible that the minimum number of host channels is greater than what the user requested */ +- PA_UNLESS( chans >= component->userChannelCount, paInvalidChannelCount ); + + /* try to set the sample rate */ + ENSURE_( ioctl( component->fd, SNDCTL_DSP_SPEED, &sr ), paInvalidSampleRate ); + +- /* reject if there's no sample rate within 1% of the one requested */ +- if( (fabs( sampleRate - sr ) / sampleRate) > 0.01 ) +- { +- PA_DEBUG(("%s: Wanted %f, closest sample rate was %d\n", __FUNCTION__, sampleRate, sr )); +- PA_ENSURE( paInvalidSampleRate ); +- } +- + ENSURE_( ioctl( component->fd, streamMode == StreamMode_In ? SNDCTL_DSP_GETISPACE : SNDCTL_DSP_GETOSPACE, &bufInfo ), + paUnanticipatedHostError ); + component->numBufs = bufInfo.fragstotal; +@@ -1477,6 +1467,7 @@ static PaError PaOssStream_Prepare( PaOs size_t bufSz = PaOssStreamComponent_BufferSize( stream->playback ); memset( stream->playback->buffer, 0, bufSz ); @@ -14,7 +42,7 @@ Add features needed to make portmixer wo /* Looks like we have to turn off blocking before we try this, but if we don't fill the buffer * OSS will complain. */ PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); -@@ -1486,6 +1487,7 @@ static PaError PaOssStream_Prepare( PaOs +@@ -1486,6 +1477,7 @@ static PaError PaOssStream_Prepare( PaOs break; } PA_ENSURE( ModifyBlocking( stream->playback->fd, 1 ) ); @@ -22,7 +50,39 @@ Add features needed to make portmixer wo } if( stream->sharedDevice ) -@@ -2043,3 +2045,26 @@ error: +@@ -1652,6 +1644,7 @@ static void *PaOSS_AudioThreadProc( void + callbackResult = paComplete; + } + ++#ifndef __NetBSD__ + /* Aspect StreamState: Because of the messy OSS scheme we can't explicitly trigger device start unless + * the stream has been recently started, we will have to go right ahead and read/write in blocking + * fashion to trigger operation. Therefore we begin with processing one host buffer before we switch +@@ -1667,6 +1660,9 @@ static void *PaOSS_AudioThreadProc( void + { + framesAvail = stream->framesPerHostBuffer; + } ++#else ++ framesAvail = stream->framesPerHostBuffer; ++#endif + + while( framesAvail > 0 ) + { +@@ -1749,11 +1745,13 @@ static void *PaOSS_AudioThreadProc( void + + if( initiateProcessing || !triggered ) + { ++#ifndef __NetBSD__ + /* Non-blocking */ + if( stream->capture ) + PA_ENSURE( ModifyBlocking( stream->capture->fd, 0 ) ); + if( stream->playback && !stream->sharedDevice ) + PA_ENSURE( ModifyBlocking( stream->playback->fd, 0 ) ); ++#endif + + initiateProcessing = 0; + sem_post( &stream->semaphore ); +@@ -2043,3 +2041,26 @@ error: #endif } --_----------=_1574601316197680--