From owner-svn-ports-all@freebsd.org Fri Mar 1 09:40:25 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9896415047D3; Fri, 1 Mar 2019 09:40:25 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB7B6CACE; Fri, 1 Mar 2019 09:40:25 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0321AD23; Fri, 1 Mar 2019 09:40:25 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x219ePXS091460; Fri, 1 Mar 2019 09:40:25 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x219eO30091455; Fri, 1 Mar 2019 09:40:24 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201903010940.x219eO30091455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Fri, 1 Mar 2019 09:40:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r494248 - in head/audio/portaudio: . files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/audio/portaudio: . files X-SVN-Commit-Revision: 494248 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DB7B6CACE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 09:40:25 -0000 Author: tobik Date: Fri Mar 1 09:40:24 2019 New Revision: 494248 URL: https://svnweb.freebsd.org/changeset/ports/494248 Log: audio/portaudio: Amend r419598 and always add OSS default device first r419598 tried to solve a problem where when hw.snd.default_unit is set to anything except zero /dev/dsp0 is not available to programs using portaudio since it assumes that /dev/dsp and /dev/dsp0 are the same device. However with that fix, when hw.snd.default_unit=1 and hw.snd.basename_clone=0, portaudio will hide /dev/dsp1 from the device list since it will use /dev/dsp for it instead of /dev/dsp1. However since /dev/dsp is not available, QueryDevice() will fail and /dev/dsp1 will never be added to the device list. Instead of looking up hw.snd.default_unit we can solve this by always trying to add /dev/dsp to the device list first. PR: 236118 Submitted by: Tatsuki Makino Modified: head/audio/portaudio/Makefile head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c Modified: head/audio/portaudio/Makefile ============================================================================== --- head/audio/portaudio/Makefile Fri Mar 1 09:36:43 2019 (r494247) +++ head/audio/portaudio/Makefile Fri Mar 1 09:40:24 2019 (r494248) @@ -3,7 +3,7 @@ PORTNAME= portaudio PORTVERSION= 19.6.0 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ Modified: head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c ============================================================================== --- head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c Fri Mar 1 09:36:43 2019 (r494247) +++ head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c Fri Mar 1 09:40:24 2019 (r494248) @@ -1,40 +1,22 @@ ---- src/hostapi/oss/pa_unix_oss.c.orig 2018-07-17 07:24:21 UTC +--- src/hostapi/oss/pa_unix_oss.c.orig 2019-03-01 03:09:23 UTC +++ src/hostapi/oss/pa_unix_oss.c -@@ -62,6 +62,9 @@ - #include - #include - #include -+#ifdef __FreeBSD__ -+#include -+#endif +@@ -535,13 +535,13 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta + * add it to a linked list. + * A: Set an arbitrary of 100 devices, should probably be a smarter way. */ - #ifdef HAVE_SYS_SOUNDCARD_H - # include -@@ -525,7 +528,14 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta - int i; - int numDevices = 0, maxDeviceInfos = 1; - PaDeviceInfo **deviceInfos = NULL; -+ int defaultDevice = 0; - -+#ifdef __FreeBSD__ -+ size_t len = sizeof(defaultDevice); -+ if (sysctlbyname("hw.snd.default_unit", &defaultDevice, &len, NULL, 0) == -1 || len != 4) -+ defaultDevice = 0; -+#endif -+ - /* These two will be set to the first working input and output device, respectively */ - commonApi->info.defaultInputDevice = paNoDevice; - commonApi->info.defaultOutputDevice = paNoDevice; -@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta +- for( i = 0; i < 100; i++ ) ++ for( i = -1; i < 100; i++ ) + { + char deviceName[32]; PaDeviceInfo *deviceInfo; int testResult; - if( i == 0 ) -+ if( i == defaultDevice ) ++ if( i == -1 ) snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); else snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i); -@@ -2041,5 +2051,29 @@ static signed long GetStreamWriteAvailable( PaStream* +@@ -2041,5 +2041,29 @@ static signed long GetStreamWriteAvailable( PaStream* error: return result; #endif