FreeBSD Bugzilla – Attachment 202466 Details for
Bug 236118
audio/portaudio: default_unit /dev/dsp[0-9]* cannot be used if sysctl -n hw.snd.basename_clone is 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposal patch (switch the existence of /dev/dsp)
patch-portaudio-basenameclone_1.diff (text/plain), 2.42 KB, created by
Tatsuki Makino
on 2019-03-01 02:25:18 UTC
(
hide
)
Description:
proposal patch (switch the existence of /dev/dsp)
Filename:
MIME Type:
Creator:
Tatsuki Makino
Created:
2019-03-01 02:25:18 UTC
Size:
2.42 KB
patch
obsolete
>Index: audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c >=================================================================== >--- audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (revision 494218) >+++ audio/portaudio/files/patch-src_hostapi_oss_pa__unix__oss.c (working copy) >@@ -1,4 +1,4 @@ >---- src/hostapi/oss/pa_unix_oss.c.orig 2018-07-17 07:24:21 UTC >+--- src/hostapi/oss/pa_unix_oss.c.orig 2016-10-30 01:23:04 UTC > +++ src/hostapi/oss/pa_unix_oss.c > @@ -62,6 +62,9 @@ > #include <sys/poll.h> >@@ -10,22 +10,30 @@ > > #ifdef HAVE_SYS_SOUNDCARD_H > # include <sys/soundcard.h> >-@@ -525,7 +528,14 @@ static PaError BuildDeviceList( PaOSSHostApiRepresenta >+@@ -525,6 +528,15 @@ static PaError BuildDeviceList( PaOSSHos > int i; > int numDevices = 0, maxDeviceInfos = 1; > PaDeviceInfo **deviceInfos = NULL; >++ int basenameClone = 0; > + 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; >++ size_t len = sizeof(basenameClone); >++ if (sysctlbyname("hw.snd.basename_clone", &basenameClone, &len, NULL, 0) == -1 || len != 4) >++ basenameClone = 0; >++ defaultDevice = -1; > +#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 >+@@ -535,13 +547,13 @@ static PaError BuildDeviceList( PaOSSHos >+ * add it to a linked list. >+ * A: Set an arbitrary of 100 devices, should probably be a smarter way. */ >+ >+- for( i = 0; i < 100; i++ ) >++ for( i = (basenameClone ? -1 : 0); i < 100; i++ ) >+ { >+ char deviceName[32]; > PaDeviceInfo *deviceInfo; > int testResult; > >@@ -34,12 +42,10 @@ > 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* >- error: >- return result; >+@@ -2043,3 +2055,27 @@ error: > #endif >-+} >-+ >+ } >+ > +const char *PaOSS_GetStreamInputDevice( PaStream* s ) > +{ > + PaOssStream *stream = (PaOssStream*)s; >@@ -62,5 +68,5 @@ > + } > + > + return NULL; >- } >- >++} >++
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236118
:
202465
|
202466
|
202467