Sat Jan 16 21:06:53 2021 UTC ()
Fix Sun/NetBSD audio support. uaudio(4) record-only audio devices would not
allow to be opened write-only and the logic would then skip to the next
device.


(reinoud)
diff -r1.31 -r1.32 pkgsrc/audio/portaudio/Makefile
diff -r1.24 -r1.25 pkgsrc/audio/portaudio/distinfo
diff -r1.2 -r1.3 pkgsrc/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c

cvs diff -r1.31 -r1.32 pkgsrc/audio/portaudio/Makefile (expand / switch to unified diff)

--- pkgsrc/audio/portaudio/Makefile 2020/08/18 17:57:25 1.31
+++ pkgsrc/audio/portaudio/Makefile 2021/01/16 21:06:52 1.32
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.31 2020/08/18 17:57:25 leot Exp $ 1# $NetBSD: Makefile,v 1.32 2021/01/16 21:06:52 reinoud Exp $
2 2
3DISTNAME= pa_stable_v190600_20161030 3DISTNAME= pa_stable_v190600_20161030
4PKGNAME= ${DISTNAME:S/^pa_stable_v/portaudio-/1:S/_/./g} 4PKGNAME= ${DISTNAME:S/^pa_stable_v/portaudio-/1:S/_/./g}
5PKGREVISION= 6 5PKGREVISION= 7
6CATEGORIES= audio 6CATEGORIES= audio
7MASTER_SITES= http://www.portaudio.com/archives/ 7MASTER_SITES= http://www.portaudio.com/archives/
8EXTRACT_SUFX= .tgz 8EXTRACT_SUFX= .tgz
9 9
10MAINTAINER= nia@NetBSD.org 10MAINTAINER= nia@NetBSD.org
11HOMEPAGE= http://www.portaudio.com/ 11HOMEPAGE= http://www.portaudio.com/
12COMMENT= Portable cross-platform audio API 12COMMENT= Portable cross-platform audio API
13LICENSE= mit 13LICENSE= mit
14 14
15CONFLICTS+= portaudio-devel-[0-9]* 15CONFLICTS+= portaudio-devel-[0-9]*
16SUPERSEDES+= portaudio-devel-[0-9]* 16SUPERSEDES+= portaudio-devel-[0-9]*
17 17
18WRKSRC= ${WRKDIR}/portaudio 18WRKSRC= ${WRKDIR}/portaudio

cvs diff -r1.24 -r1.25 pkgsrc/audio/portaudio/distinfo (expand / switch to unified diff)

--- pkgsrc/audio/portaudio/distinfo 2020/04/25 10:18:09 1.24
+++ pkgsrc/audio/portaudio/distinfo 2021/01/16 21:06:52 1.25
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: distinfo,v 1.24 2020/04/25 10:18:09 nia Exp $ 1$NetBSD: distinfo,v 1.25 2021/01/16 21:06:52 reinoud Exp $
2 2
3SHA1 (pa_stable_v190600_20161030.tgz) = 56c596bba820d90df7d057d8f6a0ec6bf9ab82e8 3SHA1 (pa_stable_v190600_20161030.tgz) = 56c596bba820d90df7d057d8f6a0ec6bf9ab82e8
4RMD160 (pa_stable_v190600_20161030.tgz) = e6e5cd3f3cb7469aa17549c189e445d573567e13 4RMD160 (pa_stable_v190600_20161030.tgz) = e6e5cd3f3cb7469aa17549c189e445d573567e13
5SHA512 (pa_stable_v190600_20161030.tgz) = 7ec692cbd8c23878b029fad9d9fd63a021f57e60c4921f602995a2fca070c29f17a280c7f2da5966c4aad29d28434538452f4c822eacf3a60af59a6dc8e9704c 5SHA512 (pa_stable_v190600_20161030.tgz) = 7ec692cbd8c23878b029fad9d9fd63a021f57e60c4921f602995a2fca070c29f17a280c7f2da5966c4aad29d28434538452f4c822eacf3a60af59a6dc8e9704c
6Size (pa_stable_v190600_20161030.tgz) = 1450572 bytes 6Size (pa_stable_v190600_20161030.tgz) = 1450572 bytes
7SHA1 (patch-Makefile.in) = 28f587f171b4a504e3982e6f8fcf3f148e5aa5c9 7SHA1 (patch-Makefile.in) = 28f587f171b4a504e3982e6f8fcf3f148e5aa5c9
8SHA1 (patch-bindings_cpp_Makefile.am) = bcd45cba537c867ed9b2e20e1468e9f16ed0b3f7 8SHA1 (patch-bindings_cpp_Makefile.am) = bcd45cba537c867ed9b2e20e1468e9f16ed0b3f7
9SHA1 (patch-configure.in) = 9ccc782631a6aaa9e2c7b8390a6b527ead25d0a5 9SHA1 (patch-configure.in) = 9ccc782631a6aaa9e2c7b8390a6b527ead25d0a5
10SHA1 (patch-include_pa__unix__oss.h) = 8e4ede09d5bf730bf8c2e8ca4aca6f700f58f2f7 10SHA1 (patch-include_pa__unix__oss.h) = 8e4ede09d5bf730bf8c2e8ca4aca6f700f58f2f7
11SHA1 (patch-include_portaudio.h) = 9a2e4aeb126056aded5cc49c40cde40e16738757 11SHA1 (patch-include_portaudio.h) = 9a2e4aeb126056aded5cc49c40cde40e16738757
12SHA1 (patch-src_common_pa__front.c) = cdddb6f537f803b55873ad6bfa936a6bff47556d 12SHA1 (patch-src_common_pa__front.c) = cdddb6f537f803b55873ad6bfa936a6bff47556d
13SHA1 (patch-src_common_pa__stream.c) = 58e6ab2a61957208973a59be2f1140abc922f360 13SHA1 (patch-src_common_pa__stream.c) = 58e6ab2a61957208973a59be2f1140abc922f360
14SHA1 (patch-src_common_pa__stream.h) = 94781a9ae79ea1340eea8caadc106416c019cf74 14SHA1 (patch-src_common_pa__stream.h) = 94781a9ae79ea1340eea8caadc106416c019cf74
15SHA1 (patch-src_hostapi_alsa_pa__linux__alsa.c) = 71daf913422f72aa379ae8cc302186800cff7717 15SHA1 (patch-src_hostapi_alsa_pa__linux__alsa.c) = 71daf913422f72aa379ae8cc302186800cff7717
16SHA1 (patch-src_hostapi_oss_pa__unix__oss.c) = 572c48f64104e22e7ae49acc54a26e549e381b5b 16SHA1 (patch-src_hostapi_oss_pa__unix__oss.c) = 572c48f64104e22e7ae49acc54a26e549e381b5b
17SHA1 (patch-src_hostapi_sun_pa__unix__sun.c) = 0bb6657adc268872c9e4c1b05b103ec8df357788 17SHA1 (patch-src_hostapi_sun_pa__unix__sun.c) = 0a2d26e477bb4c45d56b8d70db5a939911f4cf64
18SHA1 (patch-src_os_unix_pa__unix__hostapis.c) = 8cfc7d7aac8f9803e204711ded3d64842913f4fd 18SHA1 (patch-src_os_unix_pa__unix__hostapis.c) = 8cfc7d7aac8f9803e204711ded3d64842913f4fd

cvs diff -r1.2 -r1.3 pkgsrc/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c (expand / switch to unified diff)

--- pkgsrc/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c 2020/04/25 10:18:09 1.2
+++ pkgsrc/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c 2021/01/16 21:06:52 1.3
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1$NetBSD: patch-src_hostapi_sun_pa__unix__sun.c,v 1.2 2020/04/25 10:18:09 nia Exp $ 1$NetBSD: patch-src_hostapi_sun_pa__unix__sun.c,v 1.3 2021/01/16 21:06:52 reinoud Exp $
2 2
3Sun/NetBSD audio support. 3Sun/NetBSD audio support.
4 4
5--- src/hostapi/sun/pa_unix_sun.c.orig 2020-04-25 09:39:40.448044879 +0000 5--- src/hostapi/sun/pa_unix_sun.c.orig 2021-01-16 19:57:35.080979704 +0000
6+++ src/hostapi/sun/pa_unix_sun.c 6+++ src/hostapi/sun/pa_unix_sun.c
7@@ -0,0 +1,1138 @@ 7@@ -0,0 +1,1140 @@
8+/* 8+/*
9+ * $Id" 9+ * $Id"
10+ * PortAudio Portable Real-Time Audio Library 10+ * PortAudio Portable Real-Time Audio Library
11+ * Latest Version at: http://www.portaudio.com 11+ * Latest Version at: http://www.portaudio.com
12+ * Sun implementation by: 12+ * Sun implementation by:
13+ * Nia Alarie 13+ * Nia Alarie
14+ * 14+ *
15+ * Based on the Open Source API proposed by Ross Bencina 15+ * Based on the Open Source API proposed by Ross Bencina
16+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk 16+ * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
17+ * 17+ *
18+ * Permission is hereby granted, free of charge, to any person obtaining 18+ * Permission is hereby granted, free of charge, to any person obtaining
19+ * a copy of this software and associated documentation files 19+ * a copy of this software and associated documentation files
20+ * (the "Software"), to deal in the Software without restriction, 20+ * (the "Software"), to deal in the Software without restriction,
@@ -191,29 +191,31 @@ Sun/NetBSD audio support. @@ -191,29 +191,31 @@ Sun/NetBSD audio support.
191+ 191+
192+ for( i=0; i < SUN_MAX_DEVICES; ++i ) 192+ for( i=0; i < SUN_MAX_DEVICES; ++i )
193+ { 193+ {
194+ PaDeviceInfo *dev; 194+ PaDeviceInfo *dev;
195+ struct audio_info hwfmt, info; 195+ struct audio_info hwfmt, info;
196+ char path[16]; 196+ char path[16];
197+ int props; 197+ int props;
198+ 198+
199+ if( i > 0 ) 199+ if( i > 0 )
200+ (void)snprintf(path, sizeof(path), SUN_DEV_PREFIX "%d", i - 1); 200+ (void)snprintf(path, sizeof(path), SUN_DEV_PREFIX "%d", i - 1);
201+ else 201+ else
202+ (void)snprintf(path, sizeof(path), SUN_DEV_DEFAULT); 202+ (void)snprintf(path, sizeof(path), SUN_DEV_DEFAULT);
203+ 203+
204+ if( (fd = open(path, O_WRONLY | O_NONBLOCK)) < 0 || 204+ fd = open(path, O_WRONLY | O_NONBLOCK);
205+ (fd = open(path, O_RDONLY | O_NONBLOCK)) < 0 ) 205+ if (fd < 0)
206+ continue; 206+ fd = open(path, O_RDONLY | O_NONBLOCK);
 207+ if (fd < 0)
 208+ continue;
207+ 209+
208+ PA_UNLESS(dev = PaUtil_GroupAllocateMemory(sunHostApi->allocations, sizeof(PaDeviceInfo)), paInsufficientMemory); 210+ PA_UNLESS(dev = PaUtil_GroupAllocateMemory(sunHostApi->allocations, sizeof(PaDeviceInfo)), paInsufficientMemory);
209+ 211+
210+ dev->structVersion = 2; 212+ dev->structVersion = 2;
211+ dev->hostApi = hostApiIndex; 213+ dev->hostApi = hostApiIndex;
212+ 214+
213+ PA_UNLESS(dev->name = PaUtil_GroupAllocateMemory(sunHostApi->allocations, sizeof(path)), paInsufficientMemory); 215+ PA_UNLESS(dev->name = PaUtil_GroupAllocateMemory(sunHostApi->allocations, sizeof(path)), paInsufficientMemory);
214+ 216+
215+ memcpy((char *)dev->name, path, sizeof(path)); 217+ memcpy((char *)dev->name, path, sizeof(path));
216+ 218+
217+ dev->defaultSampleRate = 48000.; 219+ dev->defaultSampleRate = 48000.;
218+ 220+
219+ dev->maxInputChannels = dev->maxOutputChannels = SUN_DEFAULT_MAX_CHANNELS; 221+ dev->maxInputChannels = dev->maxOutputChannels = SUN_DEFAULT_MAX_CHANNELS;