From owner-svn-ports-all@freebsd.org Thu Aug 4 07:24:02 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E04BAEA00; Thu, 4 Aug 2016 07:24:02 +0000 (UTC) (envelope-from kevlo@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 mx1.freebsd.org (Postfix) with ESMTPS id 5ADF71D74; Thu, 4 Aug 2016 07:24:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u747O1ZZ003473; Thu, 4 Aug 2016 07:24:01 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u747O1o0003471; Thu, 4 Aug 2016 07:24:01 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608040724.u747O1o0003471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 4 Aug 2016 07:24:01 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r419598 - in head/audio/portaudio: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 04 Aug 2016 07:24:02 -0000 Author: kevlo Date: Thu Aug 4 07:24:01 2016 New Revision: 419598 URL: https://svnweb.freebsd.org/changeset/ports/419598 Log: Support hw.snd.default_unit sysctl. If the 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. PR: 208968 Submitted by: shurd Approved by: koalative@gmail.com (maintainer timeout) Added: head/audio/portaudio/files/ head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (contents, props changed) Modified: head/audio/portaudio/Makefile Modified: head/audio/portaudio/Makefile ============================================================================== --- head/audio/portaudio/Makefile Thu Aug 4 06:16:18 2016 (r419597) +++ head/audio/portaudio/Makefile Thu Aug 4 07:24:01 2016 (r419598) @@ -3,7 +3,7 @@ PORTNAME= portaudio DISTVERSION= 19_20140130 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ DISTNAME= pa_stable_v${DISTVERSION} Added: head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c Thu Aug 4 07:24:01 2016 (r419598) @@ -0,0 +1,35 @@ +--- src/hostapi/oss/pa_unix_oss.c.orig 2013-06-08 19:30:41 UTC ++++ src/hostapi/oss/pa_unix_oss.c +@@ -62,6 +62,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + #ifdef HAVE_SYS_SOUNDCARD_H + # include +@@ -525,6 +528,13 @@ static PaError BuildDeviceList( PaOSSHos + 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; +@@ -541,7 +551,7 @@ static PaError BuildDeviceList( PaOSSHos + PaDeviceInfo *deviceInfo; + int testResult; + +- if( i == 0 ) ++ if( i == defaultDevice ) + snprintf(deviceName, sizeof (deviceName), "%s", DEVICE_NAME_BASE); + else + snprintf(deviceName, sizeof (deviceName), "%s%d", DEVICE_NAME_BASE, i);