From 0e6f0f307557c5b1855cabddb1b081d6383a9385 Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 21 Aug 2018 08:59:46 +0000 Subject: [PATCH] audio(4): Properly set the exclusive mode flag. --- mini_al.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mini_al.h b/mini_al.h index a80c122e..bcec73c4 100644 --- a/mini_al.h +++ b/mini_al.h @@ -16906,6 +16906,16 @@ mal_result mal_device_init__audio4(mal_context* pContext, mal_device_type device // using the channels defined in FreeBSD's sound(4) man page. mal_get_standard_channel_map(mal_standard_channel_map_sound4, pDevice->internalChannels, pDevice->internalChannelMap); + + // The version of the operating system dictates whether or not the device is exclusive or shared. NetBSD + // introduced in-kernel mixing which means it's shared. All other BSD flavours are exclusive as far as + // I'm aware. +#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 800000000 + pDevice->exclusiveMode = MAL_FALSE; +#else + pDevice->exclusiveMode = MAL_TRUE; +#endif + // When not using MMAP mode we need to use an intermediary buffer to the data transfer between the client // and device. Everything is done by the size of a fragment.