[UPDATE] audio/openal 1.19.1

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[UPDATE] audio/openal 1.19.1

Leonid Bobrov
Hi!

Full changelog can be found here:
https://github.com/kcat/openal-soft/blob/master/ChangeLog

The most notable one is this release brings sndio input support,
thanks to work done by Alexandre Ratchov.

I raise minor number because my checks show that only new functions
were added.

So far the dependent programs I use keep working.

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/openal/Makefile,v
retrieving revision 1.51
diff -u -p -u -p -r1.51 Makefile
--- Makefile 9 Aug 2018 20:50:47 -0000 1.51
+++ Makefile 10 Feb 2019 08:51:28 -0000
@@ -4,13 +4,12 @@ BROKEN-hppa = undefined reference to __s
 
 COMMENT = cross-platform 3D audio API
 
-V = 1.17.2
+V = 1.19.1
 EPOCH = 0
 DISTNAME = openal-soft-$V
 PKGNAME = openal-$V
 CATEGORIES = audio
-SHARED_LIBS = openal 3.0
-REVISION = 1
+SHARED_LIBS = openal 3.1
 
 HOMEPAGE = http://kcat.strangesoft.net/openal.html
 
@@ -19,7 +18,7 @@ MAINTAINER = David Carlier <devnexen@gma
 # LGPLv2+
 PERMIT_PACKAGE_CDROM = Yes
 
-WANTLIB += c m pthread sndio ${COMPILER_LIBCXX}
+WANTLIB += c m pthread sndio
 
 MASTER_SITES = ${HOMEPAGE:S,.html,-releases/,}
 EXTRACT_SUFX = .tar.bz2
@@ -30,6 +29,7 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
  -DALSOFT_UTILS=On \
  -DALSOFT_EXAMPLES=Off \
  -DALSOFT_REQUIRE_SNDIO=On \
+ -DALSOFT_BACKEND_DSOUND=Off \
  -DALSOFT_BACKEND_WAVE=Off \
  -DALSOFT_CPUEXT_SSE=Off \
  -DALSOFT_CPUEXT_SSE2=Off \
@@ -42,21 +42,16 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
  -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio:Bool=Yes \
  -DCMAKE_DISABLE_FIND_PACKAGE_PulseAudio:Bool=Yes \
  -DCMAKE_DISABLE_FIND_PACKAGE_QSA:Bool=Yes \
+ -DCMAKE_DISABLE_FIND_PACKAGE_SDL2:Bool=Yes \
  -DALSOFT_NO_CONFIG_UTIL=On
 
 MODULES = devel/cmake
 
-COMPILER = base-clang ports-clang ports-gcc
+COMPILER = base-clang ports-clang ports-gcc
 
-SEPARATE_BUILD =Yes
 NO_TEST = Yes
 
 pre-build:
- @${SUBST_CMD} ${WRKSRC}/Alc/alcConfig.c ${WRKSRC}/alsoftrc.sample
-
-post-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/openal
- ${INSTALL_DATA} ${WRKSRC}/alsoftrc.sample \
- ${PREFIX}/share/examples/openal
+ @${SUBST_CMD} ${WRKSRC}/Alc/alconfig.c ${WRKSRC}/alsoftrc.sample
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/openal/distinfo,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 distinfo
--- distinfo 15 Nov 2017 13:02:42 -0000 1.10
+++ distinfo 10 Feb 2019 08:51:28 -0000
@@ -1,2 +1,2 @@
-SHA256 (openal-soft-1.17.2.tar.bz2) = o0H4VC8fC4xlJBoX2hPQc/GOwGZY4aFgao7Mi7wrMxQ=
-SIZE (openal-soft-1.17.2.tar.bz2) = 486934
+SHA256 (openal-soft-1.19.1.tar.bz2) = XC+H/1GIuV4NxHaXGanYnOQ1uDIrRHi5XdS0J/6Esuk=
+SIZE (openal-soft-1.19.1.tar.bz2) = 577310
Index: patches/patch-Alc_ALc_c
===================================================================
RCS file: patches/patch-Alc_ALc_c
diff -N patches/patch-Alc_ALc_c
--- patches/patch-Alc_ALc_c 31 Dec 2017 18:46:26 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-Alc_ALc_c,v 1.1 2017/12/31 18:46:26 jca Exp $
-
-commit d1e98c36d375433cb11a7a74ce20c968491773aa
-Author: Chris Robinson <[hidden email]>
-Date:   Sat Apr 30 17:14:55 2016 -0700
-
-    Don't crash when there's no backend to probe
-
-Index: Alc/ALc.c
---- Alc/ALc.c.orig
-+++ Alc/ALc.c
-@@ -1117,6 +1117,11 @@ static void alc_initconfig(void)
-         V0(factory,init)();
-     }
-
-+    if(!PlaybackBackend.name)
-+        WARN("No playback backend available!\n");
-+    if(!CaptureBackend.name)
-+        WARN("No capture backend available!\n");
-+
-     if(ConfigValueStr(NULL, NULL, "excludefx", &str))
-     {
-         size_t len;
-@@ -1230,9 +1235,9 @@ static void ProbeDevices(al_string *list, struct Backe
-     LockLists();
-     al_string_clear(list);
-
--    if(!backendinfo->getFactory)
-+    if(backendinfo->Probe)
-         backendinfo->Probe(type);
--    else
-+    else if(backendinfo->getFactory)
-     {
-         ALCbackendFactory *factory = backendinfo->getFactory();
-         V(factory,probe)(type);
Index: patches/patch-Alc_alcConfig_c
===================================================================
RCS file: patches/patch-Alc_alcConfig_c
diff -N patches/patch-Alc_alcConfig_c
--- patches/patch-Alc_alcConfig_c 15 Nov 2017 13:02:42 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-Alc_alcConfig_c,v 1.4 2017/11/15 13:02:42 sthen Exp $
-Index: Alc/alcConfig.c
---- Alc/alcConfig.c.orig
-+++ Alc/alcConfig.c
-@@ -353,7 +353,7 @@ void ReadALConfig(void)
-     const char *str;
-     FILE *f;
-
--    str = "/etc/openal/alsoft.conf";
-+    str = "${SYSCONFDIR}/openal/alsoft.conf";
-
-     TRACE("Loading config %s...\n", str);
-     f = al_fopen(str, "r");
Index: patches/patch-Alc_alconfig_c
===================================================================
RCS file: patches/patch-Alc_alconfig_c
diff -N patches/patch-Alc_alconfig_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Alc_alconfig_c 10 Feb 2019 08:51:28 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: Alc/alconfig.c
+--- Alc/alconfig.c.orig
++++ Alc/alconfig.c
+@@ -428,7 +428,7 @@ void ReadALConfig(void)
+     const char *str;
+     FILE *f;
+
+-    str = "/etc/openal/alsoft.conf";
++    str = "${SYSCONFDIR}/openal/alsoft.conf";
+
+     TRACE("Loading config %s...\n", str);
+     f = al_fopen(str, "r");
Index: patches/patch-Alc_backends_sndio_c
===================================================================
RCS file: patches/patch-Alc_backends_sndio_c
diff -N patches/patch-Alc_backends_sndio_c
--- patches/patch-Alc_backends_sndio_c 9 Aug 2018 20:50:47 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,404 +0,0 @@
-$OpenBSD: patch-Alc_backends_sndio_c,v 1.1 2018/08/09 20:50:47 ratchov Exp $
-
-Index: Alc/backends/sndio.c
---- Alc/backends/sndio.c.orig
-+++ Alc/backends/sndio.c
-@@ -42,16 +42,18 @@ static ALCboolean sndio_load(void)
-
- typedef struct {
-     struct sio_hdl *sndHandle;
-+    int mode, started;
-
-     ALvoid *mix_data;
-     ALsizei data_size;
-
-+    ll_ringbuffer_t *ring;
-+
-     volatile int killNow;
-     althrd_t thread;
- } sndio_data;
-
--
--static int sndio_proc(void *ptr)
-+static int sndio_proc_playback(void *ptr)
- {
-     ALCdevice *device = ptr;
-     sndio_data *data = device->ExtraData;
-@@ -89,53 +91,22 @@ static int sndio_proc(void *ptr)
-     return 0;
- }
-
--
--
--static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
-+static ALCboolean sndio_setparams(ALCdevice *device)
- {
--    sndio_data *data;
--
--    if(!deviceName)
--        deviceName = sndio_device;
--    else if(strcmp(deviceName, sndio_device) != 0)
--        return ALC_INVALID_VALUE;
--
--    data = calloc(1, sizeof(*data));
--    data->killNow = 0;
--
--    data->sndHandle = sio_open(NULL, SIO_PLAY, 0);
--    if(data->sndHandle == NULL)
--    {
--        free(data);
--        ERR("Could not open device\n");
--        return ALC_INVALID_VALUE;
--    }
--
--    al_string_copy_cstr(&device->DeviceName, deviceName);
--    device->ExtraData = data;
--
--    return ALC_NO_ERROR;
--}
--
--static void sndio_close_playback(ALCdevice *device)
--{
-     sndio_data *data = device->ExtraData;
--
--    sio_close(data->sndHandle);
--    free(data);
--    device->ExtraData = NULL;
--}
--
--static ALCboolean sndio_reset_playback(ALCdevice *device)
--{
--    sndio_data *data = device->ExtraData;
-     struct sio_par par;
-+    unsigned int nch;
-
-     sio_initpar(&par);
-
-     par.rate = device->Frequency;
--    par.pchan = ((device->FmtChans != DevFmtMono) ? 2 : 1);
-+    nch = ((device->FmtChans != DevFmtMono) ? 2 : 1);
-
-+    if (data->mode & SIO_PLAY)
-+ par.pchan = nch;
-+    else if (data->mode & SIO_REC)
-+ par.rchan = nch;
-+
-     switch(device->FmtType)
-     {
-         case DevFmtByte:
-@@ -182,8 +153,10 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
-         return ALC_FALSE;
-     }
-
-+    nch = (data->mode & SIO_PLAY) ? par.pchan : par.rchan;
-+
-     device->Frequency = par.rate;
--    device->FmtChans = ((par.pchan==1) ? DevFmtMono : DevFmtStereo);
-+    device->FmtChans = ((nch == 1) ? DevFmtMono : DevFmtStereo);
-
-     if(par.bits == 8 && par.sig == 1)
-         device->FmtType = DevFmtByte;
-@@ -211,10 +184,46 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
-     return ALC_TRUE;
- }
-
-+static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
-+{
-+    sndio_data *data;
-+
-+    if(!deviceName)
-+        deviceName = sndio_device;
-+    else if(strcmp(deviceName, sndio_device) != 0)
-+        return ALC_INVALID_VALUE;
-+
-+    data = calloc(1, sizeof(*data));
-+    data->killNow = 0;
-+    data->started = 0;
-+
-+    data->mode = SIO_PLAY;
-+    data->sndHandle = sio_open(NULL, data->mode, 0);
-+    if(data->sndHandle == NULL)
-+    {
-+        free(data);
-+        ERR("Could not open device\n");
-+        return ALC_INVALID_VALUE;
-+    }
-+
-+    al_string_copy_cstr(&device->DeviceName, deviceName);
-+    device->ExtraData = data;
-+
-+    return ALC_NO_ERROR;
-+}
-+
-+static ALCboolean sndio_reset_playback(ALCdevice *device)
-+{
-+    return sndio_setparams(device);
-+}
-+
- static ALCboolean sndio_start_playback(ALCdevice *device)
- {
-     sndio_data *data = device->ExtraData;
-
-+    if (data->started)
-+        return ALC_TRUE;
-+
-     if(!sio_start(data->sndHandle))
-     {
-         ERR("Error starting playback\n");
-@@ -225,7 +234,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
-     data->mix_data = calloc(1, data->data_size);
-
-     data->killNow = 0;
--    if(althrd_create(&data->thread, sndio_proc, device) != althrd_success)
-+    if(althrd_create(&data->thread, sndio_proc_playback, device) != althrd_success)
-     {
-         sio_stop(data->sndHandle);
-         free(data->mix_data);
-@@ -233,6 +242,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
-         return ALC_FALSE;
-     }
-
-+    data->started = 1;
-     return ALC_TRUE;
- }
-
-@@ -241,6 +251,9 @@ static void sndio_stop_playback(ALCdevice *device)
-     sndio_data *data = device->ExtraData;
-     int res;
-
-+    if (!data->started)
-+        return;
-+
-     if(data->killNow)
-         return;
-
-@@ -252,21 +265,215 @@ static void sndio_stop_playback(ALCdevice *device)
-
-     free(data->mix_data);
-     data->mix_data = NULL;
-+    data->started = 0;
- }
-
-+static void sndio_close_playback(ALCdevice *device)
-+{
-+    sndio_data *data = device->ExtraData;
-
-+    if (data->started)
-+        sndio_stop_playback(device);
-+    sio_close(data->sndHandle);
-+    free(data);
-+    device->ExtraData = NULL;
-+}
-+
-+static int sndio_proc_capture(void *ptr)
-+{
-+    static char dummy[1024];
-+    ALCdevice *device = ptr;
-+    sndio_data *data = device->ExtraData;
-+    ll_ringbuffer_data_t vec[2], *v;
-+    ALsizei frameSize;
-+    size_t n, todo, len;
-+    char *buf;
-+
-+    SetRTPriority();
-+    althrd_setname(althrd_current(), RECORD_THREAD_NAME);
-+
-+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
-+
-+    while(!data->killNow && device->Connected)
-+    {
-+        todo = device->UpdateSize * frameSize;
-+        ll_ringbuffer_get_write_vector(data->ring, vec);
-+
-+ if (vec[0].len + vec[1].len < device->UpdateSize) {
-+
-+    /* we're out of free space, drop next block */
-+    while (todo > 0) {
-+ len = sizeof(dummy);
-+ if (len > todo)
-+    len = todo;
-+ n = sio_read(data->sndHandle, dummy, len);
-+ if (n == 0) {
-+            ERR("sio_read failed\n");
-+            ALCdevice_Lock(device);
-+          aluHandleDisconnect(device);
-+    ALCdevice_Unlock(device);
-+ }
-+ todo -= n;
-+    }
-+
-+ } else {
-+
-+    /* record into the ring */
-+    v = vec;
-+    buf = NULL;
-+    len = 0;
-+    while (todo > 0) {
-+ if (len == 0) {
-+    buf = v->buf;
-+    len = v->len * frameSize;
-+    v++;
-+ }
-+ n = sio_read(data->sndHandle, buf, len);
-+ if (n == 0) {
-+            ERR("sio_read failed\n");
-+            ALCdevice_Lock(device);
-+          aluHandleDisconnect(device);
-+    ALCdevice_Unlock(device);
-+ }
-+ len -= n;
-+ buf += n;
-+ todo -= n;
-+    }
-+    ll_ringbuffer_write_advance(data->ring, device->UpdateSize);
-+
-+ }
-+    }
-+
-+    return 0;
-+}
-+
-+static ALCenum sndio_open_capture(ALCdevice *device, const ALCchar *deviceName)
-+{
-+    sndio_data *data;
-+
-+    if(!deviceName)
-+        deviceName = sndio_device;
-+    else if(strcmp(deviceName, sndio_device) != 0)
-+        return ALC_INVALID_VALUE;
-+
-+    data = calloc(1, sizeof(*data));
-+    data->killNow = 0;
-+    data->started = 0;
-+    data->ring = NULL;
-+    data->mode = SIO_REC;
-+    data->sndHandle = sio_open(NULL, data->mode, 0);
-+    if(data->sndHandle == NULL)
-+    {
-+        free(data);
-+        ERR("Could not open device\n");
-+        return ALC_INVALID_VALUE;
-+    }
-+
-+    al_string_copy_cstr(&device->DeviceName, deviceName);
-+    device->ExtraData = data;
-+
-+    if (!sndio_setparams(device)) {
-+ sio_close(data->sndHandle);
-+        free(data);
-+        return ALC_INVALID_VALUE;
-+    }
-+
-+    return ALC_NO_ERROR;
-+}
-+
-+static void sndio_start_capture(ALCdevice *device)
-+{
-+    sndio_data *data = device->ExtraData;
-+    int frameSize;
-+
-+    if (data->started)
-+        return;
-+
-+    if(!sio_start(data->sndHandle))
-+    {
-+        ERR("Error starting capture\n");
-+        return;
-+    }
-+
-+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
-+    data->ring = ll_ringbuffer_create(device->UpdateSize * device->NumUpdates, frameSize);
-+    if (!data->ring) {
-+        sio_stop(data->sndHandle);
-+        return;
-+    }
-+
-+    data->killNow = 0;
-+    if(althrd_create(&data->thread, sndio_proc_capture, device) != althrd_success)
-+    {
-+        ll_ringbuffer_free(data->ring);
-+        sio_stop(data->sndHandle);
-+        return;
-+    }
-+
-+    data->started = 1;
-+    return;
-+}
-+
-+static void sndio_stop_capture(ALCdevice *device)
-+{
-+    sndio_data *data = device->ExtraData;
-+    int res;
-+
-+    if (!data->started)
-+        return;
-+
-+    if(data->killNow)
-+        return;
-+
-+    data->killNow = 1;
-+    althrd_join(data->thread, &res);
-+
-+    if(!sio_stop(data->sndHandle))
-+        ERR("Error stopping device\n");
-+
-+    ll_ringbuffer_free(data->ring);
-+    data->ring = NULL;
-+    data->started = 0;
-+}
-+
-+static ALCenum sndio_captureSamples(ALCdevice *device, ALCvoid *buffer, ALCuint samples)
-+{
-+    sndio_data *data = device->ExtraData;
-+
-+    ll_ringbuffer_read(data->ring, buffer, samples);
-+    return ALC_NO_ERROR;
-+}
-+
-+static ALCuint sndio_availableSamples(ALCdevice *device)
-+{
-+    sndio_data *data = device->ExtraData;
-+
-+    return ll_ringbuffer_read_space(data->ring);
-+}
-+
-+static void sndio_close_capture(ALCdevice *device)
-+{
-+    sndio_data *data = device->ExtraData;
-+
-+    if (data->started)
-+        sndio_stop_capture(device);
-+    sio_close(data->sndHandle);
-+    free(data);
-+    device->ExtraData = NULL;
-+}
-+
- static const BackendFuncs sndio_funcs = {
-     sndio_open_playback,
-     sndio_close_playback,
-     sndio_reset_playback,
-     sndio_start_playback,
-     sndio_stop_playback,
--    NULL,
--    NULL,
--    NULL,
--    NULL,
--    NULL,
--    NULL
-+    sndio_open_capture,
-+    sndio_close_capture,
-+    sndio_start_capture,
-+    sndio_stop_capture,
-+    sndio_captureSamples,
-+    sndio_availableSamples
- };
-
- ALCboolean alc_sndio_init(BackendFuncs *func_list)
-@@ -289,6 +496,7 @@ void alc_sndio_probe(enum DevProbe type)
-             AppendAllDevicesList(sndio_device);
-             break;
-         case CAPTURE_DEVICE_PROBE:
-+            AppendCaptureDeviceList(sndio_device);
-             break;
-     }
- }
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/audio/openal/patches/patch-CMakeLists_txt,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 15 Nov 2017 13:02:42 -0000 1.7
+++ patches/patch-CMakeLists_txt 10 Feb 2019 08:51:28 -0000
@@ -1,34 +1,14 @@
-$OpenBSD: patch-CMakeLists_txt,v 1.7 2017/11/15 13:02:42 sthen Exp $
+$OpenBSD$
+
 Index: CMakeLists.txt
 --- CMakeLists.txt.orig
 +++ CMakeLists.txt
-@@ -843,17 +843,14 @@ ENDIF()
-
- # Check SndIO backend
- OPTION(ALSOFT_REQUIRE_SNDIO "Require SndIO backend" OFF)
--FIND_PACKAGE(SoundIO)
--IF(SOUNDIO_FOUND)
-+FIND_LIBRARY(SNDIOLIB NAMES sndio)
-+IF(NOT SNDIOLIB-NOTFOUND)
-     OPTION(ALSOFT_BACKEND_SNDIO "Enable SndIO backend" ON)
-     IF(ALSOFT_BACKEND_SNDIO)
-         SET(HAVE_SNDIO 1)
-         SET(BACKENDS  "${BACKENDS} SndIO (linked),")
-         SET(ALC_OBJS  ${ALC_OBJS} Alc/backends/sndio.c)
--        SET(EXTRA_LIBS ${SOUNDIO_LIBRARIES} ${EXTRA_LIBS})
--        IF(CMAKE_VERSION VERSION_LESS "2.8.8")
--            INCLUDE_DIRECTORIES(${SOUNDIO_INCLUDE_DIRS})
--        ENDIF()
-+        SET(EXTRA_LIBS ${SNDIOLIB} ${EXTRA_LIBS})
-     ENDIF()
- ENDIF()
- IF(ALSOFT_REQUIRE_SNDIO AND NOT HAVE_SNDIO)
-@@ -1207,7 +1204,7 @@ ENDIF()
+@@ -1536,7 +1536,7 @@ endif()
  # Install alsoft.conf configuration file
  IF(ALSOFT_CONFIG)
      INSTALL(FILES alsoftrc.sample
--            DESTINATION ${SHARE_INSTALL_DIR}/openal
-+            DESTINATION ${SHARE_INSTALL_DIR}/examples/openal
+-            DESTINATION ${CMAKE_INSTALL_DATADIR}/openal
++            DESTINATION ${CMAKE_INSTALL_DATADIR}/examples/openal
      )
      MESSAGE(STATUS "Installing sample configuration")
      MESSAGE(STATUS "")
Index: patches/patch-OpenAL32_alBuffer_c
===================================================================
RCS file: /cvs/ports/audio/openal/patches/patch-OpenAL32_alBuffer_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-OpenAL32_alBuffer_c
--- patches/patch-OpenAL32_alBuffer_c 15 Nov 2017 13:02:42 -0000 1.2
+++ patches/patch-OpenAL32_alBuffer_c 10 Feb 2019 08:51:28 -0000
@@ -1,10 +1,11 @@
-$OpenBSD: patch-OpenAL32_alBuffer_c,v 1.2 2017/11/15 13:02:42 sthen Exp $
+$OpenBSD$
+
 Index: OpenAL32/alBuffer.c
 --- OpenAL32/alBuffer.c.orig
 +++ OpenAL32/alBuffer.c
-@@ -1209,7 +1209,7 @@ static ALboolean DecomposeFormat(ALenum format, enum F
-         { AL_FORMAT_BFORMAT3D_16,      FmtBFormat3D, FmtShort },
-         { AL_FORMAT_BFORMAT3D_FLOAT32, FmtBFormat3D, FmtFloat },
+@@ -1118,7 +1118,7 @@ static ALboolean DecomposeUserFormat(ALenum format, en
+         { AL_FORMAT_BFORMAT3D_FLOAT32, UserFmtBFormat3D, UserFmtFloat },
+         { AL_FORMAT_BFORMAT3D_MULAW,   UserFmtBFormat3D, UserFmtMulaw },
      };
 -    ALuint i;
 +    volatile ALuint i;
Index: patches/patch-utils_makehrtf_c
===================================================================
RCS file: patches/patch-utils_makehrtf_c
diff -N patches/patch-utils_makehrtf_c
--- patches/patch-utils_makehrtf_c 15 Nov 2017 13:02:42 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-utils_makehrtf_c,v 1.3 2017/11/15 13:02:42 sthen Exp $
-Index: utils/makehrtf.c
---- utils/makehrtf.c.orig
-+++ utils/makehrtf.c
-@@ -2070,7 +2070,7 @@ static int StoreMhr (const HrirDataT * hData, const ch
-   step = hData -> mIrSize;
-   end = hData -> mIrCount * step;
-   n = hData -> mIrPoints;
--  srand (0x31DF840C);
-+  srand_deterministic (0x31DF840C);
-   for (j = 0; j < end; j += step) {
-       hpHist = 0;
-       for (i = 0; i < n; i ++) {
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/openal/pkg/PLIST,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 PLIST
--- pkg/PLIST 15 Nov 2017 13:02:42 -0000 1.9
+++ pkg/PLIST 10 Feb 2019 08:51:28 -0000
@@ -1,6 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.9 2017/11/15 13:02:42 sthen Exp $
 @bin bin/altonegen
-@bin bin/bsincgen
 @bin bin/makehrtf
 @bin bin/openal-info
 include/AL/
@@ -10,6 +9,10 @@ include/AL/alext.h
 include/AL/efx-creative.h
 include/AL/efx-presets.h
 include/AL/efx.h
+lib/cmake/
+lib/cmake/OpenAL/
+lib/cmake/OpenAL/OpenALConfig-openbsd.cmake
+lib/cmake/OpenAL/OpenALConfig.cmake
 @lib lib/libopenal.so.${LIBopenal_VERSION}
 lib/pkgconfig/openal.pc
 share/examples/openal/
@@ -20,3 +23,11 @@ share/openal/
 share/openal/hrtf/
 share/openal/hrtf/default-44100.mhr
 share/openal/hrtf/default-48000.mhr
+share/openal/presets/
+share/openal/presets/3D7.1.ambdec
+share/openal/presets/hexagon.ambdec
+share/openal/presets/itu5.1-nocenter.ambdec
+share/openal/presets/itu5.1.ambdec
+share/openal/presets/presets.txt
+share/openal/presets/rectangle.ambdec
+share/openal/presets/square.ambdec

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] audio/openal 1.19.1

Brian Callahan-3


On 2/10/19 4:06 AM, Leonid Bobrov wrote:

> Hi!
>
> Full changelog can be found here:
> https://github.com/kcat/openal-soft/blob/master/ChangeLog
>
> The most notable one is this release brings sndio input support,
> thanks to work done by Alexandre Ratchov.
>
> I raise minor number because my checks show that only new functions
> were added.
>
> So far the dependent programs I use keep working.

Yes, I think the time is right to update openal.
Could you at least build test all the ports that depend on openal? That
will help ensure the minor bump is correct and there's less chance of
having to clean up breakage post-commit.

~Brian

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/openal/Makefile,v
> retrieving revision 1.51
> diff -u -p -u -p -r1.51 Makefile
> --- Makefile 9 Aug 2018 20:50:47 -0000 1.51
> +++ Makefile 10 Feb 2019 08:51:28 -0000
> @@ -4,13 +4,12 @@ BROKEN-hppa = undefined reference to __s
>  
>   COMMENT = cross-platform 3D audio API
>  
> -V = 1.17.2
> +V = 1.19.1
>   EPOCH = 0
>   DISTNAME = openal-soft-$V
>   PKGNAME = openal-$V
>   CATEGORIES = audio
> -SHARED_LIBS = openal 3.0
> -REVISION = 1
> +SHARED_LIBS = openal 3.1
>  
>   HOMEPAGE = http://kcat.strangesoft.net/openal.html
>  
> @@ -19,7 +18,7 @@ MAINTAINER = David Carlier <devnexen@gma
>   # LGPLv2+
>   PERMIT_PACKAGE_CDROM = Yes
>  
> -WANTLIB += c m pthread sndio ${COMPILER_LIBCXX}
> +WANTLIB += c m pthread sndio
>  
>   MASTER_SITES = ${HOMEPAGE:S,.html,-releases/,}
>   EXTRACT_SUFX = .tar.bz2
> @@ -30,6 +29,7 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
>   -DALSOFT_UTILS=On \
>   -DALSOFT_EXAMPLES=Off \
>   -DALSOFT_REQUIRE_SNDIO=On \
> + -DALSOFT_BACKEND_DSOUND=Off \
>   -DALSOFT_BACKEND_WAVE=Off \
>   -DALSOFT_CPUEXT_SSE=Off \
>   -DALSOFT_CPUEXT_SSE2=Off \
> @@ -42,21 +42,16 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
>   -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio:Bool=Yes \
>   -DCMAKE_DISABLE_FIND_PACKAGE_PulseAudio:Bool=Yes \
>   -DCMAKE_DISABLE_FIND_PACKAGE_QSA:Bool=Yes \
> + -DCMAKE_DISABLE_FIND_PACKAGE_SDL2:Bool=Yes \
>   -DALSOFT_NO_CONFIG_UTIL=On
>  
>   MODULES = devel/cmake
>  
> -COMPILER = base-clang ports-clang ports-gcc
> +COMPILER = base-clang ports-clang ports-gcc
>  
> -SEPARATE_BUILD =Yes
>   NO_TEST = Yes
>  
>   pre-build:
> - @${SUBST_CMD} ${WRKSRC}/Alc/alcConfig.c ${WRKSRC}/alsoftrc.sample
> -
> -post-install:
> - ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/openal
> - ${INSTALL_DATA} ${WRKSRC}/alsoftrc.sample \
> - ${PREFIX}/share/examples/openal
> + @${SUBST_CMD} ${WRKSRC}/Alc/alconfig.c ${WRKSRC}/alsoftrc.sample
>  
>   .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/audio/openal/distinfo,v
> retrieving revision 1.10
> diff -u -p -u -p -r1.10 distinfo
> --- distinfo 15 Nov 2017 13:02:42 -0000 1.10
> +++ distinfo 10 Feb 2019 08:51:28 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (openal-soft-1.17.2.tar.bz2) = o0H4VC8fC4xlJBoX2hPQc/GOwGZY4aFgao7Mi7wrMxQ=
> -SIZE (openal-soft-1.17.2.tar.bz2) = 486934
> +SHA256 (openal-soft-1.19.1.tar.bz2) = XC+H/1GIuV4NxHaXGanYnOQ1uDIrRHi5XdS0J/6Esuk=
> +SIZE (openal-soft-1.19.1.tar.bz2) = 577310
> Index: patches/patch-Alc_ALc_c
> ===================================================================
> RCS file: patches/patch-Alc_ALc_c
> diff -N patches/patch-Alc_ALc_c
> --- patches/patch-Alc_ALc_c 31 Dec 2017 18:46:26 -0000 1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,35 +0,0 @@
> -$OpenBSD: patch-Alc_ALc_c,v 1.1 2017/12/31 18:46:26 jca Exp $
> -
> -commit d1e98c36d375433cb11a7a74ce20c968491773aa
> -Author: Chris Robinson <[hidden email]>
> -Date:   Sat Apr 30 17:14:55 2016 -0700
> -
> -    Don't crash when there's no backend to probe
> -
> -Index: Alc/ALc.c
> ---- Alc/ALc.c.orig
> -+++ Alc/ALc.c
> -@@ -1117,6 +1117,11 @@ static void alc_initconfig(void)
> -         V0(factory,init)();
> -     }
> -
> -+    if(!PlaybackBackend.name)
> -+        WARN("No playback backend available!\n");
> -+    if(!CaptureBackend.name)
> -+        WARN("No capture backend available!\n");
> -+
> -     if(ConfigValueStr(NULL, NULL, "excludefx", &str))
> -     {
> -         size_t len;
> -@@ -1230,9 +1235,9 @@ static void ProbeDevices(al_string *list, struct Backe
> -     LockLists();
> -     al_string_clear(list);
> -
> --    if(!backendinfo->getFactory)
> -+    if(backendinfo->Probe)
> -         backendinfo->Probe(type);
> --    else
> -+    else if(backendinfo->getFactory)
> -     {
> -         ALCbackendFactory *factory = backendinfo->getFactory();
> -         V(factory,probe)(type);
> Index: patches/patch-Alc_alcConfig_c
> ===================================================================
> RCS file: patches/patch-Alc_alcConfig_c
> diff -N patches/patch-Alc_alcConfig_c
> --- patches/patch-Alc_alcConfig_c 15 Nov 2017 13:02:42 -0000 1.4
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,13 +0,0 @@
> -$OpenBSD: patch-Alc_alcConfig_c,v 1.4 2017/11/15 13:02:42 sthen Exp $
> -Index: Alc/alcConfig.c
> ---- Alc/alcConfig.c.orig
> -+++ Alc/alcConfig.c
> -@@ -353,7 +353,7 @@ void ReadALConfig(void)
> -     const char *str;
> -     FILE *f;
> -
> --    str = "/etc/openal/alsoft.conf";
> -+    str = "${SYSCONFDIR}/openal/alsoft.conf";
> -
> -     TRACE("Loading config %s...\n", str);
> -     f = al_fopen(str, "r");
> Index: patches/patch-Alc_alconfig_c
> ===================================================================
> RCS file: patches/patch-Alc_alconfig_c
> diff -N patches/patch-Alc_alconfig_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-Alc_alconfig_c 10 Feb 2019 08:51:28 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: Alc/alconfig.c
> +--- Alc/alconfig.c.orig
> ++++ Alc/alconfig.c
> +@@ -428,7 +428,7 @@ void ReadALConfig(void)
> +     const char *str;
> +     FILE *f;
> +
> +-    str = "/etc/openal/alsoft.conf";
> ++    str = "${SYSCONFDIR}/openal/alsoft.conf";
> +
> +     TRACE("Loading config %s...\n", str);
> +     f = al_fopen(str, "r");
> Index: patches/patch-Alc_backends_sndio_c
> ===================================================================
> RCS file: patches/patch-Alc_backends_sndio_c
> diff -N patches/patch-Alc_backends_sndio_c
> --- patches/patch-Alc_backends_sndio_c 9 Aug 2018 20:50:47 -0000 1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,404 +0,0 @@
> -$OpenBSD: patch-Alc_backends_sndio_c,v 1.1 2018/08/09 20:50:47 ratchov Exp $
> -
> -Index: Alc/backends/sndio.c
> ---- Alc/backends/sndio.c.orig
> -+++ Alc/backends/sndio.c
> -@@ -42,16 +42,18 @@ static ALCboolean sndio_load(void)
> -
> - typedef struct {
> -     struct sio_hdl *sndHandle;
> -+    int mode, started;
> -
> -     ALvoid *mix_data;
> -     ALsizei data_size;
> -
> -+    ll_ringbuffer_t *ring;
> -+
> -     volatile int killNow;
> -     althrd_t thread;
> - } sndio_data;
> -
> --
> --static int sndio_proc(void *ptr)
> -+static int sndio_proc_playback(void *ptr)
> - {
> -     ALCdevice *device = ptr;
> -     sndio_data *data = device->ExtraData;
> -@@ -89,53 +91,22 @@ static int sndio_proc(void *ptr)
> -     return 0;
> - }
> -
> --
> --
> --static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
> -+static ALCboolean sndio_setparams(ALCdevice *device)
> - {
> --    sndio_data *data;
> --
> --    if(!deviceName)
> --        deviceName = sndio_device;
> --    else if(strcmp(deviceName, sndio_device) != 0)
> --        return ALC_INVALID_VALUE;
> --
> --    data = calloc(1, sizeof(*data));
> --    data->killNow = 0;
> --
> --    data->sndHandle = sio_open(NULL, SIO_PLAY, 0);
> --    if(data->sndHandle == NULL)
> --    {
> --        free(data);
> --        ERR("Could not open device\n");
> --        return ALC_INVALID_VALUE;
> --    }
> --
> --    al_string_copy_cstr(&device->DeviceName, deviceName);
> --    device->ExtraData = data;
> --
> --    return ALC_NO_ERROR;
> --}
> --
> --static void sndio_close_playback(ALCdevice *device)
> --{
> -     sndio_data *data = device->ExtraData;
> --
> --    sio_close(data->sndHandle);
> --    free(data);
> --    device->ExtraData = NULL;
> --}
> --
> --static ALCboolean sndio_reset_playback(ALCdevice *device)
> --{
> --    sndio_data *data = device->ExtraData;
> -     struct sio_par par;
> -+    unsigned int nch;
> -
> -     sio_initpar(&par);
> -
> -     par.rate = device->Frequency;
> --    par.pchan = ((device->FmtChans != DevFmtMono) ? 2 : 1);
> -+    nch = ((device->FmtChans != DevFmtMono) ? 2 : 1);
> -
> -+    if (data->mode & SIO_PLAY)
> -+ par.pchan = nch;
> -+    else if (data->mode & SIO_REC)
> -+ par.rchan = nch;
> -+
> -     switch(device->FmtType)
> -     {
> -         case DevFmtByte:
> -@@ -182,8 +153,10 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
> -         return ALC_FALSE;
> -     }
> -
> -+    nch = (data->mode & SIO_PLAY) ? par.pchan : par.rchan;
> -+
> -     device->Frequency = par.rate;
> --    device->FmtChans = ((par.pchan==1) ? DevFmtMono : DevFmtStereo);
> -+    device->FmtChans = ((nch == 1) ? DevFmtMono : DevFmtStereo);
> -
> -     if(par.bits == 8 && par.sig == 1)
> -         device->FmtType = DevFmtByte;
> -@@ -211,10 +184,46 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
> -     return ALC_TRUE;
> - }
> -
> -+static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
> -+{
> -+    sndio_data *data;
> -+
> -+    if(!deviceName)
> -+        deviceName = sndio_device;
> -+    else if(strcmp(deviceName, sndio_device) != 0)
> -+        return ALC_INVALID_VALUE;
> -+
> -+    data = calloc(1, sizeof(*data));
> -+    data->killNow = 0;
> -+    data->started = 0;
> -+
> -+    data->mode = SIO_PLAY;
> -+    data->sndHandle = sio_open(NULL, data->mode, 0);
> -+    if(data->sndHandle == NULL)
> -+    {
> -+        free(data);
> -+        ERR("Could not open device\n");
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    al_string_copy_cstr(&device->DeviceName, deviceName);
> -+    device->ExtraData = data;
> -+
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static ALCboolean sndio_reset_playback(ALCdevice *device)
> -+{
> -+    return sndio_setparams(device);
> -+}
> -+
> - static ALCboolean sndio_start_playback(ALCdevice *device)
> - {
> -     sndio_data *data = device->ExtraData;
> -
> -+    if (data->started)
> -+        return ALC_TRUE;
> -+
> -     if(!sio_start(data->sndHandle))
> -     {
> -         ERR("Error starting playback\n");
> -@@ -225,7 +234,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
> -     data->mix_data = calloc(1, data->data_size);
> -
> -     data->killNow = 0;
> --    if(althrd_create(&data->thread, sndio_proc, device) != althrd_success)
> -+    if(althrd_create(&data->thread, sndio_proc_playback, device) != althrd_success)
> -     {
> -         sio_stop(data->sndHandle);
> -         free(data->mix_data);
> -@@ -233,6 +242,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
> -         return ALC_FALSE;
> -     }
> -
> -+    data->started = 1;
> -     return ALC_TRUE;
> - }
> -
> -@@ -241,6 +251,9 @@ static void sndio_stop_playback(ALCdevice *device)
> -     sndio_data *data = device->ExtraData;
> -     int res;
> -
> -+    if (!data->started)
> -+        return;
> -+
> -     if(data->killNow)
> -         return;
> -
> -@@ -252,21 +265,215 @@ static void sndio_stop_playback(ALCdevice *device)
> -
> -     free(data->mix_data);
> -     data->mix_data = NULL;
> -+    data->started = 0;
> - }
> -
> -+static void sndio_close_playback(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -
> -+    if (data->started)
> -+        sndio_stop_playback(device);
> -+    sio_close(data->sndHandle);
> -+    free(data);
> -+    device->ExtraData = NULL;
> -+}
> -+
> -+static int sndio_proc_capture(void *ptr)
> -+{
> -+    static char dummy[1024];
> -+    ALCdevice *device = ptr;
> -+    sndio_data *data = device->ExtraData;
> -+    ll_ringbuffer_data_t vec[2], *v;
> -+    ALsizei frameSize;
> -+    size_t n, todo, len;
> -+    char *buf;
> -+
> -+    SetRTPriority();
> -+    althrd_setname(althrd_current(), RECORD_THREAD_NAME);
> -+
> -+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
> -+
> -+    while(!data->killNow && device->Connected)
> -+    {
> -+        todo = device->UpdateSize * frameSize;
> -+        ll_ringbuffer_get_write_vector(data->ring, vec);
> -+
> -+ if (vec[0].len + vec[1].len < device->UpdateSize) {
> -+
> -+    /* we're out of free space, drop next block */
> -+    while (todo > 0) {
> -+ len = sizeof(dummy);
> -+ if (len > todo)
> -+    len = todo;
> -+ n = sio_read(data->sndHandle, dummy, len);
> -+ if (n == 0) {
> -+            ERR("sio_read failed\n");
> -+            ALCdevice_Lock(device);
> -+          aluHandleDisconnect(device);
> -+    ALCdevice_Unlock(device);
> -+ }
> -+ todo -= n;
> -+    }
> -+
> -+ } else {
> -+
> -+    /* record into the ring */
> -+    v = vec;
> -+    buf = NULL;
> -+    len = 0;
> -+    while (todo > 0) {
> -+ if (len == 0) {
> -+    buf = v->buf;
> -+    len = v->len * frameSize;
> -+    v++;
> -+ }
> -+ n = sio_read(data->sndHandle, buf, len);
> -+ if (n == 0) {
> -+            ERR("sio_read failed\n");
> -+            ALCdevice_Lock(device);
> -+          aluHandleDisconnect(device);
> -+    ALCdevice_Unlock(device);
> -+ }
> -+ len -= n;
> -+ buf += n;
> -+ todo -= n;
> -+    }
> -+    ll_ringbuffer_write_advance(data->ring, device->UpdateSize);
> -+
> -+ }
> -+    }
> -+
> -+    return 0;
> -+}
> -+
> -+static ALCenum sndio_open_capture(ALCdevice *device, const ALCchar *deviceName)
> -+{
> -+    sndio_data *data;
> -+
> -+    if(!deviceName)
> -+        deviceName = sndio_device;
> -+    else if(strcmp(deviceName, sndio_device) != 0)
> -+        return ALC_INVALID_VALUE;
> -+
> -+    data = calloc(1, sizeof(*data));
> -+    data->killNow = 0;
> -+    data->started = 0;
> -+    data->ring = NULL;
> -+    data->mode = SIO_REC;
> -+    data->sndHandle = sio_open(NULL, data->mode, 0);
> -+    if(data->sndHandle == NULL)
> -+    {
> -+        free(data);
> -+        ERR("Could not open device\n");
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    al_string_copy_cstr(&device->DeviceName, deviceName);
> -+    device->ExtraData = data;
> -+
> -+    if (!sndio_setparams(device)) {
> -+ sio_close(data->sndHandle);
> -+        free(data);
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static void sndio_start_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+    int frameSize;
> -+
> -+    if (data->started)
> -+        return;
> -+
> -+    if(!sio_start(data->sndHandle))
> -+    {
> -+        ERR("Error starting capture\n");
> -+        return;
> -+    }
> -+
> -+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
> -+    data->ring = ll_ringbuffer_create(device->UpdateSize * device->NumUpdates, frameSize);
> -+    if (!data->ring) {
> -+        sio_stop(data->sndHandle);
> -+        return;
> -+    }
> -+
> -+    data->killNow = 0;
> -+    if(althrd_create(&data->thread, sndio_proc_capture, device) != althrd_success)
> -+    {
> -+        ll_ringbuffer_free(data->ring);
> -+        sio_stop(data->sndHandle);
> -+        return;
> -+    }
> -+
> -+    data->started = 1;
> -+    return;
> -+}
> -+
> -+static void sndio_stop_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+    int res;
> -+
> -+    if (!data->started)
> -+        return;
> -+
> -+    if(data->killNow)
> -+        return;
> -+
> -+    data->killNow = 1;
> -+    althrd_join(data->thread, &res);
> -+
> -+    if(!sio_stop(data->sndHandle))
> -+        ERR("Error stopping device\n");
> -+
> -+    ll_ringbuffer_free(data->ring);
> -+    data->ring = NULL;
> -+    data->started = 0;
> -+}
> -+
> -+static ALCenum sndio_captureSamples(ALCdevice *device, ALCvoid *buffer, ALCuint samples)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    ll_ringbuffer_read(data->ring, buffer, samples);
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static ALCuint sndio_availableSamples(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    return ll_ringbuffer_read_space(data->ring);
> -+}
> -+
> -+static void sndio_close_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    if (data->started)
> -+        sndio_stop_capture(device);
> -+    sio_close(data->sndHandle);
> -+    free(data);
> -+    device->ExtraData = NULL;
> -+}
> -+
> - static const BackendFuncs sndio_funcs = {
> -     sndio_open_playback,
> -     sndio_close_playback,
> -     sndio_reset_playback,
> -     sndio_start_playback,
> -     sndio_stop_playback,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL
> -+    sndio_open_capture,
> -+    sndio_close_capture,
> -+    sndio_start_capture,
> -+    sndio_stop_capture,
> -+    sndio_captureSamples,
> -+    sndio_availableSamples
> - };
> -
> - ALCboolean alc_sndio_init(BackendFuncs *func_list)
> -@@ -289,6 +496,7 @@ void alc_sndio_probe(enum DevProbe type)
> -             AppendAllDevicesList(sndio_device);
> -             break;
> -         case CAPTURE_DEVICE_PROBE:
> -+            AppendCaptureDeviceList(sndio_device);
> -             break;
> -     }
> - }
> Index: patches/patch-CMakeLists_txt
> ===================================================================
> RCS file: /cvs/ports/audio/openal/patches/patch-CMakeLists_txt,v
> retrieving revision 1.7
> diff -u -p -u -p -r1.7 patch-CMakeLists_txt
> --- patches/patch-CMakeLists_txt 15 Nov 2017 13:02:42 -0000 1.7
> +++ patches/patch-CMakeLists_txt 10 Feb 2019 08:51:28 -0000
> @@ -1,34 +1,14 @@
> -$OpenBSD: patch-CMakeLists_txt,v 1.7 2017/11/15 13:02:42 sthen Exp $
> +$OpenBSD$
> +
>   Index: CMakeLists.txt
>   --- CMakeLists.txt.orig
>   +++ CMakeLists.txt
> -@@ -843,17 +843,14 @@ ENDIF()
> -
> - # Check SndIO backend
> - OPTION(ALSOFT_REQUIRE_SNDIO "Require SndIO backend" OFF)
> --FIND_PACKAGE(SoundIO)
> --IF(SOUNDIO_FOUND)
> -+FIND_LIBRARY(SNDIOLIB NAMES sndio)
> -+IF(NOT SNDIOLIB-NOTFOUND)
> -     OPTION(ALSOFT_BACKEND_SNDIO "Enable SndIO backend" ON)
> -     IF(ALSOFT_BACKEND_SNDIO)
> -         SET(HAVE_SNDIO 1)
> -         SET(BACKENDS  "${BACKENDS} SndIO (linked),")
> -         SET(ALC_OBJS  ${ALC_OBJS} Alc/backends/sndio.c)
> --        SET(EXTRA_LIBS ${SOUNDIO_LIBRARIES} ${EXTRA_LIBS})
> --        IF(CMAKE_VERSION VERSION_LESS "2.8.8")
> --            INCLUDE_DIRECTORIES(${SOUNDIO_INCLUDE_DIRS})
> --        ENDIF()
> -+        SET(EXTRA_LIBS ${SNDIOLIB} ${EXTRA_LIBS})
> -     ENDIF()
> - ENDIF()
> - IF(ALSOFT_REQUIRE_SNDIO AND NOT HAVE_SNDIO)
> -@@ -1207,7 +1204,7 @@ ENDIF()
> +@@ -1536,7 +1536,7 @@ endif()
>    # Install alsoft.conf configuration file
>    IF(ALSOFT_CONFIG)
>        INSTALL(FILES alsoftrc.sample
> --            DESTINATION ${SHARE_INSTALL_DIR}/openal
> -+            DESTINATION ${SHARE_INSTALL_DIR}/examples/openal
> +-            DESTINATION ${CMAKE_INSTALL_DATADIR}/openal
> ++            DESTINATION ${CMAKE_INSTALL_DATADIR}/examples/openal
>        )
>        MESSAGE(STATUS "Installing sample configuration")
>        MESSAGE(STATUS "")
> Index: patches/patch-OpenAL32_alBuffer_c
> ===================================================================
> RCS file: /cvs/ports/audio/openal/patches/patch-OpenAL32_alBuffer_c,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-OpenAL32_alBuffer_c
> --- patches/patch-OpenAL32_alBuffer_c 15 Nov 2017 13:02:42 -0000 1.2
> +++ patches/patch-OpenAL32_alBuffer_c 10 Feb 2019 08:51:28 -0000
> @@ -1,10 +1,11 @@
> -$OpenBSD: patch-OpenAL32_alBuffer_c,v 1.2 2017/11/15 13:02:42 sthen Exp $
> +$OpenBSD$
> +
>   Index: OpenAL32/alBuffer.c
>   --- OpenAL32/alBuffer.c.orig
>   +++ OpenAL32/alBuffer.c
> -@@ -1209,7 +1209,7 @@ static ALboolean DecomposeFormat(ALenum format, enum F
> -         { AL_FORMAT_BFORMAT3D_16,      FmtBFormat3D, FmtShort },
> -         { AL_FORMAT_BFORMAT3D_FLOAT32, FmtBFormat3D, FmtFloat },
> +@@ -1118,7 +1118,7 @@ static ALboolean DecomposeUserFormat(ALenum format, en
> +         { AL_FORMAT_BFORMAT3D_FLOAT32, UserFmtBFormat3D, UserFmtFloat },
> +         { AL_FORMAT_BFORMAT3D_MULAW,   UserFmtBFormat3D, UserFmtMulaw },
>        };
>   -    ALuint i;
>   +    volatile ALuint i;
> Index: patches/patch-utils_makehrtf_c
> ===================================================================
> RCS file: patches/patch-utils_makehrtf_c
> diff -N patches/patch-utils_makehrtf_c
> --- patches/patch-utils_makehrtf_c 15 Nov 2017 13:02:42 -0000 1.3
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,13 +0,0 @@
> -$OpenBSD: patch-utils_makehrtf_c,v 1.3 2017/11/15 13:02:42 sthen Exp $
> -Index: utils/makehrtf.c
> ---- utils/makehrtf.c.orig
> -+++ utils/makehrtf.c
> -@@ -2070,7 +2070,7 @@ static int StoreMhr (const HrirDataT * hData, const ch
> -   step = hData -> mIrSize;
> -   end = hData -> mIrCount * step;
> -   n = hData -> mIrPoints;
> --  srand (0x31DF840C);
> -+  srand_deterministic (0x31DF840C);
> -   for (j = 0; j < end; j += step) {
> -       hpHist = 0;
> -       for (i = 0; i < n; i ++) {
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/audio/openal/pkg/PLIST,v
> retrieving revision 1.9
> diff -u -p -u -p -r1.9 PLIST
> --- pkg/PLIST 15 Nov 2017 13:02:42 -0000 1.9
> +++ pkg/PLIST 10 Feb 2019 08:51:28 -0000
> @@ -1,6 +1,5 @@
>   @comment $OpenBSD: PLIST,v 1.9 2017/11/15 13:02:42 sthen Exp $
>   @bin bin/altonegen
> -@bin bin/bsincgen
>   @bin bin/makehrtf
>   @bin bin/openal-info
>   include/AL/
> @@ -10,6 +9,10 @@ include/AL/alext.h
>   include/AL/efx-creative.h
>   include/AL/efx-presets.h
>   include/AL/efx.h
> +lib/cmake/
> +lib/cmake/OpenAL/
> +lib/cmake/OpenAL/OpenALConfig-openbsd.cmake
> +lib/cmake/OpenAL/OpenALConfig.cmake
>   @lib lib/libopenal.so.${LIBopenal_VERSION}
>   lib/pkgconfig/openal.pc
>   share/examples/openal/
> @@ -20,3 +23,11 @@ share/openal/
>   share/openal/hrtf/
>   share/openal/hrtf/default-44100.mhr
>   share/openal/hrtf/default-48000.mhr
> +share/openal/presets/
> +share/openal/presets/3D7.1.ambdec
> +share/openal/presets/hexagon.ambdec
> +share/openal/presets/itu5.1-nocenter.ambdec
> +share/openal/presets/itu5.1.ambdec
> +share/openal/presets/presets.txt
> +share/openal/presets/rectangle.ambdec
> +share/openal/presets/square.ambdec
>

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] audio/openal 1.19.1

Leonid Bobrov
Hi, Brian!

On Mon, Feb 11, 2019 at 08:18:23AM -0500, Brian Callahan wrote:
> Could you at least build test all the ports that depend on openal? That will
> help ensure the minor bump is correct and there's less chance of having to
> clean up breakage post-commit.
>

Sure, I'll do it.

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] audio/openal 1.19.1

David CARLIER-2
In reply to this post by Leonid Bobrov
Hi I planned to update it much later but thanks for doing this.
As said privately I m ok with the changes once approved by other folks.

Cheers.

On Sun, 10 Feb 2019 at 09:06, Leonid Bobrov <[hidden email]> wrote:

>
> Hi!
>
> Full changelog can be found here:
> https://github.com/kcat/openal-soft/blob/master/ChangeLog
>
> The most notable one is this release brings sndio input support,
> thanks to work done by Alexandre Ratchov.
>
> I raise minor number because my checks show that only new functions
> were added.
>
> So far the dependent programs I use keep working.
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/audio/openal/Makefile,v
> retrieving revision 1.51
> diff -u -p -u -p -r1.51 Makefile
> --- Makefile    9 Aug 2018 20:50:47 -0000       1.51
> +++ Makefile    10 Feb 2019 08:51:28 -0000
> @@ -4,13 +4,12 @@ BROKEN-hppa = undefined reference to __s
>
>  COMMENT =      cross-platform 3D audio API
>
> -V =            1.17.2
> +V =            1.19.1
>  EPOCH =                0
>  DISTNAME =     openal-soft-$V
>  PKGNAME =      openal-$V
>  CATEGORIES =   audio
> -SHARED_LIBS =  openal  3.0
> -REVISION =     1
> +SHARED_LIBS =  openal  3.1
>
>  HOMEPAGE =     http://kcat.strangesoft.net/openal.html
>
> @@ -19,7 +18,7 @@ MAINTAINER =  David Carlier <devnexen@gma
>  # LGPLv2+
>  PERMIT_PACKAGE_CDROM = Yes
>
> -WANTLIB +=     c m pthread sndio ${COMPILER_LIBCXX}
> +WANTLIB +=     c m pthread sndio
>
>  MASTER_SITES = ${HOMEPAGE:S,.html,-releases/,}
>  EXTRACT_SUFX = .tar.bz2
> @@ -30,6 +29,7 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
>                 -DALSOFT_UTILS=On \
>                 -DALSOFT_EXAMPLES=Off \
>                 -DALSOFT_REQUIRE_SNDIO=On \
> +               -DALSOFT_BACKEND_DSOUND=Off \
>                 -DALSOFT_BACKEND_WAVE=Off \
>                 -DALSOFT_CPUEXT_SSE=Off \
>                 -DALSOFT_CPUEXT_SSE2=Off \
> @@ -42,21 +42,16 @@ CONFIGURE_ARGS =-DCMAKE_BUILD_TYPE=OpenB
>                 -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio:Bool=Yes \
>                 -DCMAKE_DISABLE_FIND_PACKAGE_PulseAudio:Bool=Yes \
>                 -DCMAKE_DISABLE_FIND_PACKAGE_QSA:Bool=Yes \
> +               -DCMAKE_DISABLE_FIND_PACKAGE_SDL2:Bool=Yes \
>                 -DALSOFT_NO_CONFIG_UTIL=On
>
>  MODULES =      devel/cmake
>
> -COMPILER =             base-clang ports-clang ports-gcc
> +COMPILER =     base-clang ports-clang ports-gcc
>
> -SEPARATE_BUILD =Yes
>  NO_TEST =      Yes
>
>  pre-build:
> -       @${SUBST_CMD} ${WRKSRC}/Alc/alcConfig.c ${WRKSRC}/alsoftrc.sample
> -
> -post-install:
> -       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/openal
> -       ${INSTALL_DATA} ${WRKSRC}/alsoftrc.sample \
> -               ${PREFIX}/share/examples/openal
> +       @${SUBST_CMD} ${WRKSRC}/Alc/alconfig.c ${WRKSRC}/alsoftrc.sample
>
>  .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/audio/openal/distinfo,v
> retrieving revision 1.10
> diff -u -p -u -p -r1.10 distinfo
> --- distinfo    15 Nov 2017 13:02:42 -0000      1.10
> +++ distinfo    10 Feb 2019 08:51:28 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (openal-soft-1.17.2.tar.bz2) = o0H4VC8fC4xlJBoX2hPQc/GOwGZY4aFgao7Mi7wrMxQ=
> -SIZE (openal-soft-1.17.2.tar.bz2) = 486934
> +SHA256 (openal-soft-1.19.1.tar.bz2) = XC+H/1GIuV4NxHaXGanYnOQ1uDIrRHi5XdS0J/6Esuk=
> +SIZE (openal-soft-1.19.1.tar.bz2) = 577310
> Index: patches/patch-Alc_ALc_c
> ===================================================================
> RCS file: patches/patch-Alc_ALc_c
> diff -N patches/patch-Alc_ALc_c
> --- patches/patch-Alc_ALc_c     31 Dec 2017 18:46:26 -0000      1.1
> +++ /dev/null   1 Jan 1970 00:00:00 -0000
> @@ -1,35 +0,0 @@
> -$OpenBSD: patch-Alc_ALc_c,v 1.1 2017/12/31 18:46:26 jca Exp $
> -
> -commit d1e98c36d375433cb11a7a74ce20c968491773aa
> -Author: Chris Robinson <[hidden email]>
> -Date:   Sat Apr 30 17:14:55 2016 -0700
> -
> -    Don't crash when there's no backend to probe
> -
> -Index: Alc/ALc.c
> ---- Alc/ALc.c.orig
> -+++ Alc/ALc.c
> -@@ -1117,6 +1117,11 @@ static void alc_initconfig(void)
> -         V0(factory,init)();
> -     }
> -
> -+    if(!PlaybackBackend.name)
> -+        WARN("No playback backend available!\n");
> -+    if(!CaptureBackend.name)
> -+        WARN("No capture backend available!\n");
> -+
> -     if(ConfigValueStr(NULL, NULL, "excludefx", &str))
> -     {
> -         size_t len;
> -@@ -1230,9 +1235,9 @@ static void ProbeDevices(al_string *list, struct Backe
> -     LockLists();
> -     al_string_clear(list);
> -
> --    if(!backendinfo->getFactory)
> -+    if(backendinfo->Probe)
> -         backendinfo->Probe(type);
> --    else
> -+    else if(backendinfo->getFactory)
> -     {
> -         ALCbackendFactory *factory = backendinfo->getFactory();
> -         V(factory,probe)(type);
> Index: patches/patch-Alc_alcConfig_c
> ===================================================================
> RCS file: patches/patch-Alc_alcConfig_c
> diff -N patches/patch-Alc_alcConfig_c
> --- patches/patch-Alc_alcConfig_c       15 Nov 2017 13:02:42 -0000      1.4
> +++ /dev/null   1 Jan 1970 00:00:00 -0000
> @@ -1,13 +0,0 @@
> -$OpenBSD: patch-Alc_alcConfig_c,v 1.4 2017/11/15 13:02:42 sthen Exp $
> -Index: Alc/alcConfig.c
> ---- Alc/alcConfig.c.orig
> -+++ Alc/alcConfig.c
> -@@ -353,7 +353,7 @@ void ReadALConfig(void)
> -     const char *str;
> -     FILE *f;
> -
> --    str = "/etc/openal/alsoft.conf";
> -+    str = "${SYSCONFDIR}/openal/alsoft.conf";
> -
> -     TRACE("Loading config %s...\n", str);
> -     f = al_fopen(str, "r");
> Index: patches/patch-Alc_alconfig_c
> ===================================================================
> RCS file: patches/patch-Alc_alconfig_c
> diff -N patches/patch-Alc_alconfig_c
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ patches/patch-Alc_alconfig_c        10 Feb 2019 08:51:28 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: Alc/alconfig.c
> +--- Alc/alconfig.c.orig
> ++++ Alc/alconfig.c
> +@@ -428,7 +428,7 @@ void ReadALConfig(void)
> +     const char *str;
> +     FILE *f;
> +
> +-    str = "/etc/openal/alsoft.conf";
> ++    str = "${SYSCONFDIR}/openal/alsoft.conf";
> +
> +     TRACE("Loading config %s...\n", str);
> +     f = al_fopen(str, "r");
> Index: patches/patch-Alc_backends_sndio_c
> ===================================================================
> RCS file: patches/patch-Alc_backends_sndio_c
> diff -N patches/patch-Alc_backends_sndio_c
> --- patches/patch-Alc_backends_sndio_c  9 Aug 2018 20:50:47 -0000       1.1
> +++ /dev/null   1 Jan 1970 00:00:00 -0000
> @@ -1,404 +0,0 @@
> -$OpenBSD: patch-Alc_backends_sndio_c,v 1.1 2018/08/09 20:50:47 ratchov Exp $
> -
> -Index: Alc/backends/sndio.c
> ---- Alc/backends/sndio.c.orig
> -+++ Alc/backends/sndio.c
> -@@ -42,16 +42,18 @@ static ALCboolean sndio_load(void)
> -
> - typedef struct {
> -     struct sio_hdl *sndHandle;
> -+    int mode, started;
> -
> -     ALvoid *mix_data;
> -     ALsizei data_size;
> -
> -+    ll_ringbuffer_t *ring;
> -+
> -     volatile int killNow;
> -     althrd_t thread;
> - } sndio_data;
> -
> --
> --static int sndio_proc(void *ptr)
> -+static int sndio_proc_playback(void *ptr)
> - {
> -     ALCdevice *device = ptr;
> -     sndio_data *data = device->ExtraData;
> -@@ -89,53 +91,22 @@ static int sndio_proc(void *ptr)
> -     return 0;
> - }
> -
> --
> --
> --static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
> -+static ALCboolean sndio_setparams(ALCdevice *device)
> - {
> --    sndio_data *data;
> --
> --    if(!deviceName)
> --        deviceName = sndio_device;
> --    else if(strcmp(deviceName, sndio_device) != 0)
> --        return ALC_INVALID_VALUE;
> --
> --    data = calloc(1, sizeof(*data));
> --    data->killNow = 0;
> --
> --    data->sndHandle = sio_open(NULL, SIO_PLAY, 0);
> --    if(data->sndHandle == NULL)
> --    {
> --        free(data);
> --        ERR("Could not open device\n");
> --        return ALC_INVALID_VALUE;
> --    }
> --
> --    al_string_copy_cstr(&device->DeviceName, deviceName);
> --    device->ExtraData = data;
> --
> --    return ALC_NO_ERROR;
> --}
> --
> --static void sndio_close_playback(ALCdevice *device)
> --{
> -     sndio_data *data = device->ExtraData;
> --
> --    sio_close(data->sndHandle);
> --    free(data);
> --    device->ExtraData = NULL;
> --}
> --
> --static ALCboolean sndio_reset_playback(ALCdevice *device)
> --{
> --    sndio_data *data = device->ExtraData;
> -     struct sio_par par;
> -+    unsigned int nch;
> -
> -     sio_initpar(&par);
> -
> -     par.rate = device->Frequency;
> --    par.pchan = ((device->FmtChans != DevFmtMono) ? 2 : 1);
> -+    nch = ((device->FmtChans != DevFmtMono) ? 2 : 1);
> -
> -+    if (data->mode & SIO_PLAY)
> -+      par.pchan = nch;
> -+    else if (data->mode & SIO_REC)
> -+      par.rchan = nch;
> -+
> -     switch(device->FmtType)
> -     {
> -         case DevFmtByte:
> -@@ -182,8 +153,10 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
> -         return ALC_FALSE;
> -     }
> -
> -+    nch = (data->mode & SIO_PLAY) ? par.pchan : par.rchan;
> -+
> -     device->Frequency = par.rate;
> --    device->FmtChans = ((par.pchan==1) ? DevFmtMono : DevFmtStereo);
> -+    device->FmtChans = ((nch == 1) ? DevFmtMono : DevFmtStereo);
> -
> -     if(par.bits == 8 && par.sig == 1)
> -         device->FmtType = DevFmtByte;
> -@@ -211,10 +184,46 @@ static ALCboolean sndio_reset_playback(ALCdevice *devi
> -     return ALC_TRUE;
> - }
> -
> -+static ALCenum sndio_open_playback(ALCdevice *device, const ALCchar *deviceName)
> -+{
> -+    sndio_data *data;
> -+
> -+    if(!deviceName)
> -+        deviceName = sndio_device;
> -+    else if(strcmp(deviceName, sndio_device) != 0)
> -+        return ALC_INVALID_VALUE;
> -+
> -+    data = calloc(1, sizeof(*data));
> -+    data->killNow = 0;
> -+    data->started = 0;
> -+
> -+    data->mode = SIO_PLAY;
> -+    data->sndHandle = sio_open(NULL, data->mode, 0);
> -+    if(data->sndHandle == NULL)
> -+    {
> -+        free(data);
> -+        ERR("Could not open device\n");
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    al_string_copy_cstr(&device->DeviceName, deviceName);
> -+    device->ExtraData = data;
> -+
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static ALCboolean sndio_reset_playback(ALCdevice *device)
> -+{
> -+    return sndio_setparams(device);
> -+}
> -+
> - static ALCboolean sndio_start_playback(ALCdevice *device)
> - {
> -     sndio_data *data = device->ExtraData;
> -
> -+    if (data->started)
> -+        return ALC_TRUE;
> -+
> -     if(!sio_start(data->sndHandle))
> -     {
> -         ERR("Error starting playback\n");
> -@@ -225,7 +234,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
> -     data->mix_data = calloc(1, data->data_size);
> -
> -     data->killNow = 0;
> --    if(althrd_create(&data->thread, sndio_proc, device) != althrd_success)
> -+    if(althrd_create(&data->thread, sndio_proc_playback, device) != althrd_success)
> -     {
> -         sio_stop(data->sndHandle);
> -         free(data->mix_data);
> -@@ -233,6 +242,7 @@ static ALCboolean sndio_start_playback(ALCdevice *devi
> -         return ALC_FALSE;
> -     }
> -
> -+    data->started = 1;
> -     return ALC_TRUE;
> - }
> -
> -@@ -241,6 +251,9 @@ static void sndio_stop_playback(ALCdevice *device)
> -     sndio_data *data = device->ExtraData;
> -     int res;
> -
> -+    if (!data->started)
> -+        return;
> -+
> -     if(data->killNow)
> -         return;
> -
> -@@ -252,21 +265,215 @@ static void sndio_stop_playback(ALCdevice *device)
> -
> -     free(data->mix_data);
> -     data->mix_data = NULL;
> -+    data->started = 0;
> - }
> -
> -+static void sndio_close_playback(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -
> -+    if (data->started)
> -+        sndio_stop_playback(device);
> -+    sio_close(data->sndHandle);
> -+    free(data);
> -+    device->ExtraData = NULL;
> -+}
> -+
> -+static int sndio_proc_capture(void *ptr)
> -+{
> -+    static char dummy[1024];
> -+    ALCdevice *device = ptr;
> -+    sndio_data *data = device->ExtraData;
> -+    ll_ringbuffer_data_t vec[2], *v;
> -+    ALsizei frameSize;
> -+    size_t n, todo, len;
> -+    char *buf;
> -+
> -+    SetRTPriority();
> -+    althrd_setname(althrd_current(), RECORD_THREAD_NAME);
> -+
> -+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
> -+
> -+    while(!data->killNow && device->Connected)
> -+    {
> -+        todo = device->UpdateSize * frameSize;
> -+        ll_ringbuffer_get_write_vector(data->ring, vec);
> -+
> -+      if (vec[0].len + vec[1].len < device->UpdateSize) {
> -+
> -+          /* we're out of free space, drop next block */
> -+          while (todo > 0) {
> -+              len = sizeof(dummy);
> -+              if (len > todo)
> -+                  len = todo;
> -+              n = sio_read(data->sndHandle, dummy, len);
> -+              if (n == 0) {
> -+                  ERR("sio_read failed\n");
> -+                  ALCdevice_Lock(device);
> -+                          aluHandleDisconnect(device);
> -+                  ALCdevice_Unlock(device);
> -+              }
> -+              todo -= n;
> -+          }
> -+
> -+      } else {
> -+
> -+          /* record into the ring */
> -+          v = vec;
> -+          buf = NULL;
> -+          len = 0;
> -+          while (todo > 0) {
> -+              if (len == 0) {
> -+                  buf = v->buf;
> -+                  len = v->len * frameSize;
> -+                  v++;
> -+              }
> -+              n = sio_read(data->sndHandle, buf, len);
> -+              if (n == 0) {
> -+                  ERR("sio_read failed\n");
> -+                  ALCdevice_Lock(device);
> -+                          aluHandleDisconnect(device);
> -+                  ALCdevice_Unlock(device);
> -+              }
> -+              len -= n;
> -+              buf += n;
> -+              todo -= n;
> -+          }
> -+          ll_ringbuffer_write_advance(data->ring, device->UpdateSize);
> -+
> -+      }
> -+    }
> -+
> -+    return 0;
> -+}
> -+
> -+static ALCenum sndio_open_capture(ALCdevice *device, const ALCchar *deviceName)
> -+{
> -+    sndio_data *data;
> -+
> -+    if(!deviceName)
> -+        deviceName = sndio_device;
> -+    else if(strcmp(deviceName, sndio_device) != 0)
> -+        return ALC_INVALID_VALUE;
> -+
> -+    data = calloc(1, sizeof(*data));
> -+    data->killNow = 0;
> -+    data->started = 0;
> -+    data->ring = NULL;
> -+    data->mode = SIO_REC;
> -+    data->sndHandle = sio_open(NULL, data->mode, 0);
> -+    if(data->sndHandle == NULL)
> -+    {
> -+        free(data);
> -+        ERR("Could not open device\n");
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    al_string_copy_cstr(&device->DeviceName, deviceName);
> -+    device->ExtraData = data;
> -+
> -+    if (!sndio_setparams(device)) {
> -+      sio_close(data->sndHandle);
> -+        free(data);
> -+        return ALC_INVALID_VALUE;
> -+    }
> -+
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static void sndio_start_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+    int frameSize;
> -+
> -+    if (data->started)
> -+        return;
> -+
> -+    if(!sio_start(data->sndHandle))
> -+    {
> -+        ERR("Error starting capture\n");
> -+        return;
> -+    }
> -+
> -+    frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
> -+    data->ring = ll_ringbuffer_create(device->UpdateSize * device->NumUpdates, frameSize);
> -+    if (!data->ring) {
> -+        sio_stop(data->sndHandle);
> -+        return;
> -+    }
> -+
> -+    data->killNow = 0;
> -+    if(althrd_create(&data->thread, sndio_proc_capture, device) != althrd_success)
> -+    {
> -+        ll_ringbuffer_free(data->ring);
> -+        sio_stop(data->sndHandle);
> -+        return;
> -+    }
> -+
> -+    data->started = 1;
> -+    return;
> -+}
> -+
> -+static void sndio_stop_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+    int res;
> -+
> -+    if (!data->started)
> -+        return;
> -+
> -+    if(data->killNow)
> -+        return;
> -+
> -+    data->killNow = 1;
> -+    althrd_join(data->thread, &res);
> -+
> -+    if(!sio_stop(data->sndHandle))
> -+        ERR("Error stopping device\n");
> -+
> -+    ll_ringbuffer_free(data->ring);
> -+    data->ring = NULL;
> -+    data->started = 0;
> -+}
> -+
> -+static ALCenum sndio_captureSamples(ALCdevice *device, ALCvoid *buffer, ALCuint samples)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    ll_ringbuffer_read(data->ring, buffer, samples);
> -+    return ALC_NO_ERROR;
> -+}
> -+
> -+static ALCuint sndio_availableSamples(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    return ll_ringbuffer_read_space(data->ring);
> -+}
> -+
> -+static void sndio_close_capture(ALCdevice *device)
> -+{
> -+    sndio_data *data = device->ExtraData;
> -+
> -+    if (data->started)
> -+        sndio_stop_capture(device);
> -+    sio_close(data->sndHandle);
> -+    free(data);
> -+    device->ExtraData = NULL;
> -+}
> -+
> - static const BackendFuncs sndio_funcs = {
> -     sndio_open_playback,
> -     sndio_close_playback,
> -     sndio_reset_playback,
> -     sndio_start_playback,
> -     sndio_stop_playback,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL,
> --    NULL
> -+    sndio_open_capture,
> -+    sndio_close_capture,
> -+    sndio_start_capture,
> -+    sndio_stop_capture,
> -+    sndio_captureSamples,
> -+    sndio_availableSamples
> - };
> -
> - ALCboolean alc_sndio_init(BackendFuncs *func_list)
> -@@ -289,6 +496,7 @@ void alc_sndio_probe(enum DevProbe type)
> -             AppendAllDevicesList(sndio_device);
> -             break;
> -         case CAPTURE_DEVICE_PROBE:
> -+            AppendCaptureDeviceList(sndio_device);
> -             break;
> -     }
> - }
> Index: patches/patch-CMakeLists_txt
> ===================================================================
> RCS file: /cvs/ports/audio/openal/patches/patch-CMakeLists_txt,v
> retrieving revision 1.7
> diff -u -p -u -p -r1.7 patch-CMakeLists_txt
> --- patches/patch-CMakeLists_txt        15 Nov 2017 13:02:42 -0000      1.7
> +++ patches/patch-CMakeLists_txt        10 Feb 2019 08:51:28 -0000
> @@ -1,34 +1,14 @@
> -$OpenBSD: patch-CMakeLists_txt,v 1.7 2017/11/15 13:02:42 sthen Exp $
> +$OpenBSD$
> +
>  Index: CMakeLists.txt
>  --- CMakeLists.txt.orig
>  +++ CMakeLists.txt
> -@@ -843,17 +843,14 @@ ENDIF()
> -
> - # Check SndIO backend
> - OPTION(ALSOFT_REQUIRE_SNDIO "Require SndIO backend" OFF)
> --FIND_PACKAGE(SoundIO)
> --IF(SOUNDIO_FOUND)
> -+FIND_LIBRARY(SNDIOLIB NAMES sndio)
> -+IF(NOT SNDIOLIB-NOTFOUND)
> -     OPTION(ALSOFT_BACKEND_SNDIO "Enable SndIO backend" ON)
> -     IF(ALSOFT_BACKEND_SNDIO)
> -         SET(HAVE_SNDIO 1)
> -         SET(BACKENDS  "${BACKENDS} SndIO (linked),")
> -         SET(ALC_OBJS  ${ALC_OBJS} Alc/backends/sndio.c)
> --        SET(EXTRA_LIBS ${SOUNDIO_LIBRARIES} ${EXTRA_LIBS})
> --        IF(CMAKE_VERSION VERSION_LESS "2.8.8")
> --            INCLUDE_DIRECTORIES(${SOUNDIO_INCLUDE_DIRS})
> --        ENDIF()
> -+        SET(EXTRA_LIBS ${SNDIOLIB} ${EXTRA_LIBS})
> -     ENDIF()
> - ENDIF()
> - IF(ALSOFT_REQUIRE_SNDIO AND NOT HAVE_SNDIO)
> -@@ -1207,7 +1204,7 @@ ENDIF()
> +@@ -1536,7 +1536,7 @@ endif()
>   # Install alsoft.conf configuration file
>   IF(ALSOFT_CONFIG)
>       INSTALL(FILES alsoftrc.sample
> --            DESTINATION ${SHARE_INSTALL_DIR}/openal
> -+            DESTINATION ${SHARE_INSTALL_DIR}/examples/openal
> +-            DESTINATION ${CMAKE_INSTALL_DATADIR}/openal
> ++            DESTINATION ${CMAKE_INSTALL_DATADIR}/examples/openal
>       )
>       MESSAGE(STATUS "Installing sample configuration")
>       MESSAGE(STATUS "")
> Index: patches/patch-OpenAL32_alBuffer_c
> ===================================================================
> RCS file: /cvs/ports/audio/openal/patches/patch-OpenAL32_alBuffer_c,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-OpenAL32_alBuffer_c
> --- patches/patch-OpenAL32_alBuffer_c   15 Nov 2017 13:02:42 -0000      1.2
> +++ patches/patch-OpenAL32_alBuffer_c   10 Feb 2019 08:51:28 -0000
> @@ -1,10 +1,11 @@
> -$OpenBSD: patch-OpenAL32_alBuffer_c,v 1.2 2017/11/15 13:02:42 sthen Exp $
> +$OpenBSD$
> +
>  Index: OpenAL32/alBuffer.c
>  --- OpenAL32/alBuffer.c.orig
>  +++ OpenAL32/alBuffer.c
> -@@ -1209,7 +1209,7 @@ static ALboolean DecomposeFormat(ALenum format, enum F
> -         { AL_FORMAT_BFORMAT3D_16,      FmtBFormat3D, FmtShort },
> -         { AL_FORMAT_BFORMAT3D_FLOAT32, FmtBFormat3D, FmtFloat },
> +@@ -1118,7 +1118,7 @@ static ALboolean DecomposeUserFormat(ALenum format, en
> +         { AL_FORMAT_BFORMAT3D_FLOAT32, UserFmtBFormat3D, UserFmtFloat },
> +         { AL_FORMAT_BFORMAT3D_MULAW,   UserFmtBFormat3D, UserFmtMulaw },
>       };
>  -    ALuint i;
>  +    volatile ALuint i;
> Index: patches/patch-utils_makehrtf_c
> ===================================================================
> RCS file: patches/patch-utils_makehrtf_c
> diff -N patches/patch-utils_makehrtf_c
> --- patches/patch-utils_makehrtf_c      15 Nov 2017 13:02:42 -0000      1.3
> +++ /dev/null   1 Jan 1970 00:00:00 -0000
> @@ -1,13 +0,0 @@
> -$OpenBSD: patch-utils_makehrtf_c,v 1.3 2017/11/15 13:02:42 sthen Exp $
> -Index: utils/makehrtf.c
> ---- utils/makehrtf.c.orig
> -+++ utils/makehrtf.c
> -@@ -2070,7 +2070,7 @@ static int StoreMhr (const HrirDataT * hData, const ch
> -   step = hData -> mIrSize;
> -   end = hData -> mIrCount * step;
> -   n = hData -> mIrPoints;
> --  srand (0x31DF840C);
> -+  srand_deterministic (0x31DF840C);
> -   for (j = 0; j < end; j += step) {
> -       hpHist = 0;
> -       for (i = 0; i < n; i ++) {
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/audio/openal/pkg/PLIST,v
> retrieving revision 1.9
> diff -u -p -u -p -r1.9 PLIST
> --- pkg/PLIST   15 Nov 2017 13:02:42 -0000      1.9
> +++ pkg/PLIST   10 Feb 2019 08:51:28 -0000
> @@ -1,6 +1,5 @@
>  @comment $OpenBSD: PLIST,v 1.9 2017/11/15 13:02:42 sthen Exp $
>  @bin bin/altonegen
> -@bin bin/bsincgen
>  @bin bin/makehrtf
>  @bin bin/openal-info
>  include/AL/
> @@ -10,6 +9,10 @@ include/AL/alext.h
>  include/AL/efx-creative.h
>  include/AL/efx-presets.h
>  include/AL/efx.h
> +lib/cmake/
> +lib/cmake/OpenAL/
> +lib/cmake/OpenAL/OpenALConfig-openbsd.cmake
> +lib/cmake/OpenAL/OpenALConfig.cmake
>  @lib lib/libopenal.so.${LIBopenal_VERSION}
>  lib/pkgconfig/openal.pc
>  share/examples/openal/
> @@ -20,3 +23,11 @@ share/openal/
>  share/openal/hrtf/
>  share/openal/hrtf/default-44100.mhr
>  share/openal/hrtf/default-48000.mhr
> +share/openal/presets/
> +share/openal/presets/3D7.1.ambdec
> +share/openal/presets/hexagon.ambdec
> +share/openal/presets/itu5.1-nocenter.ambdec
> +share/openal/presets/itu5.1.ambdec
> +share/openal/presets/presets.txt
> +share/openal/presets/rectangle.ambdec
> +share/openal/presets/square.ambdec

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] audio/openal 1.19.1

Leonid Bobrov
In reply to this post by Leonid Bobrov
On Tue, Feb 12, 2019 at 04:07:53PM +0000, David CARLIER wrote:
> Hi jca and were discussing about his question regarding the
> OpenAL32_alBuffer.c patch ...
> It might have been fixed with the 1.19.1 release what would be nice is
> for you to test couple of consumers without this specific change and
> see if it crashes then maybe we will be able to remove this for good
> ;-)
>

Done testing, those consumers simply have no sound when no devices are
available, I simple set in /etc/openal/alsoft.conf:
drivers = -sndio

> Thanks.

Now, I report that all openal dependents are successfully built:
mazocomp$ cd /usr/ports/
mazocomp$ cat openal.dependents
audio/freealut
emulators/fs-uae
emulators/higan
emulators/retroarch
games/0ad/base
games/arx-libertatis
games/astromenace
games/barony
games/colobot/colobot
games/dhewm3
games/dustrac
games/endless-sky
games/fifengine
games/fnaify
games/freeorion
games/fs2open
games/gemrb
games/gzdoom
games/ioquake3
games/irrlamb
games/love
games/lugaru
games/lwjgl
games/megaglest/base
games/minetest
games/openmw
games/openomf
games/scorched3d
games/solarus/solarus
games/spacezero
games/speeddreams
games/supertux
games/supertuxkart
games/taisei
games/tome4
games/ufoai/base,-editor
games/valyriatear
games/vegastrike/engine
games/warzone2100
games/yquake2
graphics/blender
graphics/simgear
multimedia/sfml
net/utox
x11/kde-applications/libkdegames
x11/kde4/libkdegames
x11/qt5/qtmultimedia
mazocomp$ doas infrastructure/bin/dpb openal.dependents
Started as: root
Port user: root
Build user: _pbuild
Fetch user: _pfetch
Log user: _pbuild
Unpriv user: _dpb
Reading build stats...zapping old stuff...Done
Reading distinfo...zap duplicates...Done
Waiting for hosts to finish STARTUP...ready on localhost
13 Feb 03:13:24 [82702] running for 14:30:52

Hosts: localhost(kde4)
I=688 B=0 Q=0 T=0 F=0 !=4


Elapsed time=14:30:52
I=688 B=0 Q=0 T=0 F=0 !=4
mazocomp$

Commit time? :)