mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
update openal-soft to 1.24.3
keeping the alt 87514151c4 (diff-73a8dc1ce58605f6c5ea53548454c3bae516ec5132a29c9d7ff7edf9730c75be)
This commit is contained in:
parent
12db0500e8
commit
ba32094b7b
276 changed files with 49304 additions and 8712 deletions
|
|
@ -32,7 +32,6 @@
|
|||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <exception>
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
|
|
@ -43,13 +42,14 @@
|
|||
#include <vector>
|
||||
|
||||
#include "alc/alconfig.h"
|
||||
#include "alnumeric.h"
|
||||
#include "alspan.h"
|
||||
#include "alstring.h"
|
||||
#include "base.h"
|
||||
#include "core/devformat.h"
|
||||
#include "core/device.h"
|
||||
#include "core/logging.h"
|
||||
#include "dynload.h"
|
||||
#include "fmt/core.h"
|
||||
#include "opthelpers.h"
|
||||
#include "strutils.h"
|
||||
|
||||
|
|
@ -58,9 +58,10 @@
|
|||
|
||||
namespace {
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
using uint = unsigned int;
|
||||
|
||||
#ifdef HAVE_DYNLOAD
|
||||
#if HAVE_DYNLOAD
|
||||
#define PULSE_FUNCS(MAGIC) \
|
||||
MAGIC(pa_context_new); \
|
||||
MAGIC(pa_context_unref); \
|
||||
|
|
@ -72,8 +73,10 @@ using uint = unsigned int;
|
|||
MAGIC(pa_context_errno); \
|
||||
MAGIC(pa_context_connect); \
|
||||
MAGIC(pa_context_get_server_info); \
|
||||
MAGIC(pa_context_get_sink_info_by_index); \
|
||||
MAGIC(pa_context_get_sink_info_by_name); \
|
||||
MAGIC(pa_context_get_sink_info_list); \
|
||||
MAGIC(pa_context_get_source_info_by_index); \
|
||||
MAGIC(pa_context_get_source_info_by_name); \
|
||||
MAGIC(pa_context_get_source_info_list); \
|
||||
MAGIC(pa_stream_new); \
|
||||
|
|
@ -145,8 +148,10 @@ PULSE_FUNCS(MAKE_FUNC)
|
|||
#define pa_context_errno ppa_context_errno
|
||||
#define pa_context_connect ppa_context_connect
|
||||
#define pa_context_get_server_info ppa_context_get_server_info
|
||||
#define pa_context_get_sink_info_by_index ppa_context_get_sink_info_by_index
|
||||
#define pa_context_get_sink_info_by_name ppa_context_get_sink_info_by_name
|
||||
#define pa_context_get_sink_info_list ppa_context_get_sink_info_list
|
||||
#define pa_context_get_source_info_by_index ppa_context_get_source_info_by_index
|
||||
#define pa_context_get_source_info_by_name ppa_context_get_source_info_by_name
|
||||
#define pa_context_get_source_info_list ppa_context_get_source_info_list
|
||||
#define pa_stream_new ppa_stream_new
|
||||
|
|
@ -252,7 +257,7 @@ constexpr pa_channel_map MonoChanMap{
|
|||
};
|
||||
|
||||
|
||||
/* *grumble* Don't use enums for bitflags. */
|
||||
/* NOLINTBEGIN(*EnumCastOutOfRange) *grumble* Don't use enums for bitflags. */
|
||||
constexpr pa_stream_flags_t operator|(pa_stream_flags_t lhs, pa_stream_flags_t rhs)
|
||||
{ return pa_stream_flags_t(lhs | al::to_underlying(rhs)); }
|
||||
constexpr pa_stream_flags_t& operator|=(pa_stream_flags_t &lhs, pa_stream_flags_t rhs)
|
||||
|
|
@ -278,11 +283,13 @@ constexpr pa_context_flags_t& operator|=(pa_context_flags_t &lhs, pa_context_fla
|
|||
|
||||
constexpr pa_subscription_mask_t operator|(pa_subscription_mask_t lhs, pa_subscription_mask_t rhs)
|
||||
{ return pa_subscription_mask_t(lhs | al::to_underlying(rhs)); }
|
||||
/* NOLINTEND(*EnumCastOutOfRange) */
|
||||
|
||||
|
||||
struct DevMap {
|
||||
std::string name;
|
||||
std::string device_name;
|
||||
uint32_t index{};
|
||||
};
|
||||
|
||||
bool checkName(const al::span<const DevMap> list, const std::string &name)
|
||||
|
|
@ -294,6 +301,9 @@ bool checkName(const al::span<const DevMap> list, const std::string &name)
|
|||
std::vector<DevMap> PlaybackDevices;
|
||||
std::vector<DevMap> CaptureDevices;
|
||||
|
||||
std::string DefaultPlaybackDevName;
|
||||
std::string DefaultCaptureDevName;
|
||||
|
||||
|
||||
/* Global flags and properties */
|
||||
pa_context_flags_t pulse_ctx_flags;
|
||||
|
|
@ -344,6 +354,32 @@ public:
|
|||
void close(pa_stream *stream=nullptr);
|
||||
|
||||
|
||||
void updateDefaultDevice(pa_context*, const pa_server_info *info) const
|
||||
{
|
||||
auto default_sink = info->default_sink_name ? std::string_view{info->default_sink_name}
|
||||
: std::string_view{};
|
||||
auto default_src = info->default_source_name ? std::string_view{info->default_source_name}
|
||||
: std::string_view{};
|
||||
|
||||
if(default_sink != DefaultPlaybackDevName)
|
||||
{
|
||||
TRACE("Default playback device: {}", default_sink);
|
||||
DefaultPlaybackDevName = default_sink;
|
||||
|
||||
const auto msg = fmt::format("Default playback device changed: {}", default_sink);
|
||||
alc::Event(alc::EventType::DefaultDeviceChanged, alc::DeviceType::Playback, msg);
|
||||
}
|
||||
if(default_src != DefaultCaptureDevName)
|
||||
{
|
||||
TRACE("Default capture device: {}", default_src);
|
||||
DefaultCaptureDevName = default_src;
|
||||
|
||||
const auto msg = fmt::format("Default capture device changed: {}", default_src);
|
||||
alc::Event(alc::EventType::DefaultDeviceChanged, alc::DeviceType::Capture, msg);
|
||||
}
|
||||
signal();
|
||||
}
|
||||
|
||||
void deviceSinkCallback(pa_context*, const pa_sink_info *info, int eol) const noexcept
|
||||
{
|
||||
if(eol)
|
||||
|
|
@ -361,18 +397,18 @@ public:
|
|||
/* Make sure the display name (description) is unique. Append a number
|
||||
* counter as needed.
|
||||
*/
|
||||
int count{1};
|
||||
std::string newname{info->description};
|
||||
auto count = 1;
|
||||
auto newname = std::string{info->description};
|
||||
while(checkName(PlaybackDevices, newname))
|
||||
{
|
||||
newname = info->description;
|
||||
newname += " #";
|
||||
newname += std::to_string(++count);
|
||||
}
|
||||
PlaybackDevices.emplace_back(DevMap{std::move(newname), info->name});
|
||||
DevMap &newentry = PlaybackDevices.back();
|
||||
newname = fmt::format("{} #{}", info->description, ++count);
|
||||
|
||||
TRACE("Got device \"%s\", \"%s\"\n", newentry.name.c_str(), newentry.device_name.c_str());
|
||||
const auto &newentry = PlaybackDevices.emplace_back(DevMap{std::move(newname),
|
||||
info->name, info->index});
|
||||
TRACE("Got device \"{}\", \"{}\" ({})", newentry.name, newentry.device_name,
|
||||
newentry.index);
|
||||
|
||||
const auto msg = fmt::format("Device added: {}", newentry.device_name);
|
||||
alc::Event(alc::EventType::DeviceAdded, alc::DeviceType::Playback, msg);
|
||||
}
|
||||
|
||||
void deviceSourceCallback(pa_context*, const pa_source_info *info, int eol) const noexcept
|
||||
|
|
@ -392,22 +428,77 @@ public:
|
|||
/* Make sure the display name (description) is unique. Append a number
|
||||
* counter as needed.
|
||||
*/
|
||||
int count{1};
|
||||
std::string newname{info->description};
|
||||
auto count = 1;
|
||||
auto newname = std::string{info->description};
|
||||
while(checkName(CaptureDevices, newname))
|
||||
{
|
||||
newname = info->description;
|
||||
newname += " #";
|
||||
newname += std::to_string(++count);
|
||||
}
|
||||
CaptureDevices.emplace_back(DevMap{std::move(newname), info->name});
|
||||
DevMap &newentry = CaptureDevices.back();
|
||||
newname = fmt::format("{} #{}", info->description, ++count);
|
||||
|
||||
TRACE("Got device \"%s\", \"%s\"\n", newentry.name.c_str(), newentry.device_name.c_str());
|
||||
const auto &newentry = CaptureDevices.emplace_back(DevMap{std::move(newname), info->name,
|
||||
info->index});
|
||||
TRACE("Got device \"{}\", \"{}\" ({})", newentry.name, newentry.device_name,
|
||||
newentry.index);
|
||||
|
||||
const auto msg = fmt::format("Device added: {}", newentry.device_name);
|
||||
alc::Event(alc::EventType::DeviceAdded, alc::DeviceType::Capture, msg);
|
||||
}
|
||||
|
||||
void probePlaybackDevices();
|
||||
void probeCaptureDevices();
|
||||
void eventCallback(pa_context *context, pa_subscription_event_type_t t, uint32_t idx) noexcept
|
||||
{
|
||||
const auto eventFacility = (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK);
|
||||
const auto eventType = (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK);
|
||||
|
||||
if(eventFacility == PA_SUBSCRIPTION_EVENT_SERVER
|
||||
&& eventType == PA_SUBSCRIPTION_EVENT_CHANGE)
|
||||
{
|
||||
static constexpr auto server_cb = [](pa_context *ctx, const pa_server_info *info,
|
||||
void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->updateDefaultDevice(ctx, info); };
|
||||
auto *op = pa_context_get_server_info(context, server_cb, this);
|
||||
if(op) pa_operation_unref(op);
|
||||
}
|
||||
|
||||
if(eventFacility != PA_SUBSCRIPTION_EVENT_SINK
|
||||
&& eventFacility != PA_SUBSCRIPTION_EVENT_SOURCE)
|
||||
return;
|
||||
|
||||
const auto devtype = (eventFacility == PA_SUBSCRIPTION_EVENT_SINK)
|
||||
? alc::DeviceType::Playback : alc::DeviceType::Capture;
|
||||
|
||||
if(eventType == PA_SUBSCRIPTION_EVENT_NEW)
|
||||
{
|
||||
if(eventFacility == PA_SUBSCRIPTION_EVENT_SINK)
|
||||
{
|
||||
static constexpr auto devcallback = [](pa_context *ctx, const pa_sink_info *info,
|
||||
int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSinkCallback(ctx, info, eol); };
|
||||
auto *op = pa_context_get_sink_info_by_index(context, idx, devcallback, this);
|
||||
if(op) pa_operation_unref(op);
|
||||
}
|
||||
else
|
||||
{
|
||||
static constexpr auto devcallback = [](pa_context *ctx, const pa_source_info *info,
|
||||
int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSourceCallback(ctx,info,eol); };
|
||||
auto *op = pa_context_get_source_info_by_index(context, idx, devcallback, this);
|
||||
if(op) pa_operation_unref(op);
|
||||
}
|
||||
}
|
||||
else if(eventType == PA_SUBSCRIPTION_EVENT_REMOVE)
|
||||
{
|
||||
auto find_index = [idx](const DevMap &entry) noexcept { return entry.index == idx; };
|
||||
|
||||
auto &devlist = (eventFacility == PA_SUBSCRIPTION_EVENT_SINK)
|
||||
? PlaybackDevices : CaptureDevices;
|
||||
auto iter = std::find_if(devlist.cbegin(), devlist.cend(), find_index);
|
||||
if(iter != devlist.cend())
|
||||
{
|
||||
devlist.erase(iter);
|
||||
|
||||
const auto msg = fmt::format("Device removed: {}", idx);
|
||||
alc::Event(alc::EventType::DeviceRemoved, devtype, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
friend struct MainloopUniqueLock;
|
||||
};
|
||||
|
|
@ -434,36 +525,38 @@ struct MainloopUniqueLock : public std::unique_lock<PulseMainloop> {
|
|||
|
||||
void setEventHandler()
|
||||
{
|
||||
pa_operation *op{pa_context_subscribe(mutex()->mContext,
|
||||
PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE,
|
||||
[](pa_context*, int, void *pdata) noexcept
|
||||
{ static_cast<PulseMainloop*>(pdata)->signal(); },
|
||||
mutex())};
|
||||
auto *context = mutex()->mContext;
|
||||
|
||||
/* Watch for device added/removed and server changed events. */
|
||||
static constexpr auto submask = PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE
|
||||
| PA_SUBSCRIPTION_MASK_SERVER;
|
||||
static constexpr auto do_signal = [](pa_context*, int, void *pdata) noexcept
|
||||
{ static_cast<PulseMainloop*>(pdata)->signal(); };
|
||||
auto *op = pa_context_subscribe(context, submask, do_signal, mutex());
|
||||
waitForOperation(op);
|
||||
|
||||
/* Watch for device added/removed events.
|
||||
*
|
||||
* TODO: Also track the "default" device, in as much as PulseAudio has
|
||||
* the concept of a default device (whatever device is opened when not
|
||||
* specifying a specific sink or source name). There doesn't seem to be
|
||||
* an event for this.
|
||||
*/
|
||||
auto handler = [](pa_context*, pa_subscription_event_type_t t, uint32_t, void*) noexcept
|
||||
{
|
||||
const auto eventFacility = (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK);
|
||||
if(eventFacility == PA_SUBSCRIPTION_EVENT_SINK
|
||||
|| eventFacility == PA_SUBSCRIPTION_EVENT_SOURCE)
|
||||
{
|
||||
const auto deviceType = (eventFacility == PA_SUBSCRIPTION_EVENT_SINK)
|
||||
? alc::DeviceType::Playback : alc::DeviceType::Capture;
|
||||
const auto eventType = (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK);
|
||||
if(eventType == PA_SUBSCRIPTION_EVENT_NEW)
|
||||
alc::Event(alc::EventType::DeviceAdded, deviceType, "Device added");
|
||||
else if(eventType == PA_SUBSCRIPTION_EVENT_REMOVE)
|
||||
alc::Event(alc::EventType::DeviceRemoved, deviceType, "Device removed");
|
||||
}
|
||||
};
|
||||
pa_context_set_subscribe_callback(mutex()->mContext, handler, nullptr);
|
||||
static constexpr auto handler = [](pa_context *ctx, pa_subscription_event_type_t t,
|
||||
uint32_t index, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->eventCallback(ctx, t, index); };
|
||||
pa_context_set_subscribe_callback(context, handler, mutex());
|
||||
|
||||
/* Fill in the initial device lists, and get the defaults. */
|
||||
auto sink_callback = [](pa_context *ctx, const pa_sink_info *info, int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSinkCallback(ctx, info, eol); };
|
||||
|
||||
auto src_callback = [](pa_context *ctx, const pa_source_info *info, int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSourceCallback(ctx, info, eol); };
|
||||
|
||||
auto server_callback = [](pa_context *ctx, const pa_server_info *info, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->updateDefaultDevice(ctx, info); };
|
||||
|
||||
auto *sinkop = pa_context_get_sink_info_list(context, sink_callback, mutex());
|
||||
auto *srcop = pa_context_get_source_info_list(context, src_callback, mutex());
|
||||
auto *serverop = pa_context_get_server_info(context, server_callback, mutex());
|
||||
|
||||
waitForOperation(sinkop);
|
||||
waitForOperation(srcop);
|
||||
waitForOperation(serverop);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -484,6 +577,13 @@ struct MainloopUniqueLock : public std::unique_lock<PulseMainloop> {
|
|||
void connectContext();
|
||||
pa_stream *connectStream(const char *device_name, pa_stream_flags_t flags,
|
||||
pa_buffer_attr *attr, pa_sample_spec *spec, pa_channel_map *chanmap, BackendType type);
|
||||
|
||||
pa_stream *connectStream(const std::string &device_name, pa_stream_flags_t flags,
|
||||
pa_buffer_attr *attr, pa_sample_spec *spec, pa_channel_map *chanmap, BackendType type)
|
||||
{
|
||||
return connectStream(device_name.empty() ? nullptr : device_name.c_str(), flags, attr,
|
||||
spec, chanmap, type);
|
||||
}
|
||||
};
|
||||
using MainloopLockGuard = std::lock_guard<PulseMainloop>;
|
||||
|
||||
|
|
@ -533,7 +633,7 @@ void MainloopUniqueLock::connectContext()
|
|||
{
|
||||
pa_context_unref(mutex()->mContext);
|
||||
mutex()->mContext = nullptr;
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "Context did not connect (%s)",
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "Context did not connect ({})",
|
||||
pa_strerror(err)};
|
||||
}
|
||||
}
|
||||
|
|
@ -544,7 +644,7 @@ pa_stream *MainloopUniqueLock::connectStream(const char *device_name, pa_stream_
|
|||
const char *stream_id{(type==BackendType::Playback) ? "Playback Stream" : "Capture Stream"};
|
||||
pa_stream *stream{pa_stream_new(mutex()->mContext, stream_id, spec, chanmap)};
|
||||
if(!stream)
|
||||
throw al::backend_exception{al::backend_error::OutOfMemory, "pa_stream_new() failed (%s)",
|
||||
throw al::backend_exception{al::backend_error::OutOfMemory, "pa_stream_new() failed ({})",
|
||||
pa_strerror(pa_context_errno(mutex()->mContext))};
|
||||
|
||||
pa_stream_set_state_callback(stream, [](pa_stream *strm, void *pdata) noexcept
|
||||
|
|
@ -556,7 +656,7 @@ pa_stream *MainloopUniqueLock::connectStream(const char *device_name, pa_stream_
|
|||
if(err < 0)
|
||||
{
|
||||
pa_stream_unref(stream);
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "%s did not connect (%s)",
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "%s did not connect ({})",
|
||||
stream_id, pa_strerror(err)};
|
||||
}
|
||||
|
||||
|
|
@ -568,7 +668,7 @@ pa_stream *MainloopUniqueLock::connectStream(const char *device_name, pa_stream_
|
|||
err = pa_context_errno(mutex()->mContext);
|
||||
pa_stream_unref(stream);
|
||||
throw al::backend_exception{al::backend_error::DeviceError,
|
||||
"%s did not get ready (%s)", stream_id, pa_strerror(err)};
|
||||
"{} did not get ready ({})", stream_id, pa_strerror(err)};
|
||||
}
|
||||
return state == PA_STREAM_READY;
|
||||
});
|
||||
|
|
@ -593,56 +693,12 @@ void PulseMainloop::close(pa_stream *stream)
|
|||
}
|
||||
|
||||
|
||||
void PulseMainloop::probePlaybackDevices()
|
||||
{
|
||||
PlaybackDevices.clear();
|
||||
try {
|
||||
MainloopUniqueLock plock{*this};
|
||||
plock.connectContext();
|
||||
|
||||
auto sink_callback = [](pa_context *ctx, const pa_sink_info *info, int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSinkCallback(ctx, info, eol); };
|
||||
|
||||
pa_operation *op{pa_context_get_sink_info_by_name(mContext, nullptr, sink_callback, this)};
|
||||
plock.waitForOperation(op);
|
||||
|
||||
op = pa_context_get_sink_info_list(mContext, sink_callback, this);
|
||||
plock.waitForOperation(op);
|
||||
}
|
||||
catch(std::exception &e) {
|
||||
ERR("Error enumerating devices: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void PulseMainloop::probeCaptureDevices()
|
||||
{
|
||||
CaptureDevices.clear();
|
||||
try {
|
||||
MainloopUniqueLock plock{*this};
|
||||
plock.connectContext();
|
||||
|
||||
auto src_callback = [](pa_context *ctx, const pa_source_info *info, int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulseMainloop*>(pdata)->deviceSourceCallback(ctx, info, eol); };
|
||||
|
||||
pa_operation *op{pa_context_get_source_info_by_name(mContext, nullptr, src_callback,
|
||||
this)};
|
||||
plock.waitForOperation(op);
|
||||
|
||||
op = pa_context_get_source_info_list(mContext, src_callback, this);
|
||||
plock.waitForOperation(op);
|
||||
}
|
||||
catch(std::exception &e) {
|
||||
ERR("Error enumerating devices: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Used for initial connection test and enumeration. */
|
||||
PulseMainloop gGlobalMainloop;
|
||||
|
||||
|
||||
struct PulsePlayback final : public BackendBase {
|
||||
PulsePlayback(DeviceBase *device) noexcept : BackendBase{device} { }
|
||||
explicit PulsePlayback(DeviceBase *device) noexcept : BackendBase{device} { }
|
||||
~PulsePlayback() override;
|
||||
|
||||
void bufferAttrCallback(pa_stream *stream) noexcept;
|
||||
|
|
@ -660,7 +716,7 @@ struct PulsePlayback final : public BackendBase {
|
|||
|
||||
PulseMainloop mMainloop;
|
||||
|
||||
std::optional<std::string> mDeviceName{std::nullopt};
|
||||
std::optional<std::string> mDeviceId{std::nullopt};
|
||||
|
||||
bool mIs51Rear{false};
|
||||
pa_buffer_attr mAttr{};
|
||||
|
|
@ -683,14 +739,14 @@ void PulsePlayback::bufferAttrCallback(pa_stream *stream) noexcept
|
|||
* leaving it alone means ALC_REFRESH will be off.
|
||||
*/
|
||||
mAttr = *(pa_stream_get_buffer_attr(stream));
|
||||
TRACE("minreq=%d, tlength=%d, prebuf=%d\n", mAttr.minreq, mAttr.tlength, mAttr.prebuf);
|
||||
TRACE("minreq={}, tlength={}, prebuf={}", mAttr.minreq, mAttr.tlength, mAttr.prebuf);
|
||||
}
|
||||
|
||||
void PulsePlayback::streamStateCallback(pa_stream *stream) noexcept
|
||||
{
|
||||
if(pa_stream_get_state(stream) == PA_STREAM_FAILED)
|
||||
{
|
||||
ERR("Received stream failure!\n");
|
||||
ERR("Received stream failure!");
|
||||
mDevice->handleDisconnect("Playback stream failure");
|
||||
}
|
||||
mMainloop.signal();
|
||||
|
|
@ -716,7 +772,7 @@ void PulsePlayback::streamWriteCallback(pa_stream *stream, size_t nbytes) noexce
|
|||
|
||||
int ret{pa_stream_write(stream, buf, buflen, free_func, 0, PA_SEEK_RELATIVE)};
|
||||
if(ret != PA_OK) UNLIKELY
|
||||
ERR("Failed to write to stream: %d, %s\n", ret, pa_strerror(ret));
|
||||
ERR("Failed to write to stream: {}, {}", ret, pa_strerror(ret));
|
||||
} while(nbytes > 0);
|
||||
}
|
||||
|
||||
|
|
@ -759,11 +815,11 @@ void PulsePlayback::sinkInfoCallback(pa_context*, const pa_sink_info *info, int
|
|||
mIs51Rear = false;
|
||||
std::array<char,PA_CHANNEL_MAP_SNPRINT_MAX> chanmap_str{};
|
||||
pa_channel_map_snprint(chanmap_str.data(), chanmap_str.size(), &info->channel_map);
|
||||
WARN("Failed to find format for channel map:\n %s\n", chanmap_str.data());
|
||||
WARN("Failed to find format for channel map:\n {}", chanmap_str.data());
|
||||
}
|
||||
|
||||
if(info->active_port)
|
||||
TRACE("Active port: %s (%s)\n", info->active_port->name, info->active_port->description);
|
||||
TRACE("Active port: {} ({})", info->active_port->name, info->active_port->description);
|
||||
mDevice->Flags.set(DirectEar, (info->active_port
|
||||
&& strcmp(info->active_port->name, "analog-output-headphones") == 0));
|
||||
}
|
||||
|
|
@ -775,13 +831,13 @@ void PulsePlayback::sinkNameCallback(pa_context*, const pa_sink_info *info, int
|
|||
mMainloop.signal();
|
||||
return;
|
||||
}
|
||||
mDevice->DeviceName = info->description;
|
||||
mDeviceName = info->description;
|
||||
}
|
||||
|
||||
void PulsePlayback::streamMovedCallback(pa_stream *stream) noexcept
|
||||
{
|
||||
mDeviceName = pa_stream_get_device_name(stream);
|
||||
TRACE("Stream moved to %s\n", mDeviceName->c_str());
|
||||
mDeviceId = pa_stream_get_device_name(stream);
|
||||
TRACE("Stream moved to {}", *mDeviceId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -792,22 +848,20 @@ void PulsePlayback::open(std::string_view name)
|
|||
throw al::backend_exception{al::backend_error::DeviceError,
|
||||
"Failed to start device mainloop"};
|
||||
|
||||
const char *pulse_name{nullptr};
|
||||
std::string_view display_name;
|
||||
auto pulse_name = std::string{};
|
||||
if(!name.empty())
|
||||
{
|
||||
if(PlaybackDevices.empty())
|
||||
mMainloop.probePlaybackDevices();
|
||||
|
||||
auto match_name = [name](const DevMap &entry) -> bool
|
||||
{ return entry.name == name || entry.device_name == name; };
|
||||
|
||||
auto plock = MainloopUniqueLock{gGlobalMainloop};
|
||||
auto iter = std::find_if(PlaybackDevices.cbegin(), PlaybackDevices.cend(), match_name);
|
||||
if(iter == PlaybackDevices.cend())
|
||||
throw al::backend_exception{al::backend_error::NoDevice,
|
||||
"Device name \"%.*s\" not found", al::sizei(name), name.data()};
|
||||
"Device name \"{}\" not found", name};
|
||||
|
||||
pulse_name = iter->device_name.c_str();
|
||||
display_name = iter->name;
|
||||
pulse_name = iter->device_name;
|
||||
mDeviceName = iter->name;
|
||||
}
|
||||
|
||||
MainloopUniqueLock plock{mMainloop};
|
||||
|
|
@ -823,38 +877,38 @@ void PulsePlayback::open(std::string_view name)
|
|||
spec.rate = 44100;
|
||||
spec.channels = 2;
|
||||
|
||||
if(!pulse_name)
|
||||
if(pulse_name.empty())
|
||||
{
|
||||
static const auto defname = al::getenv("ALSOFT_PULSE_DEFAULT");
|
||||
if(defname) pulse_name = defname->c_str();
|
||||
if(defname) pulse_name = *defname;
|
||||
}
|
||||
TRACE("Connecting to \"%s\"\n", pulse_name ? pulse_name : "(default)");
|
||||
TRACE("Connecting to \"{}\"", pulse_name.empty() ? "(default)"sv:std::string_view{pulse_name});
|
||||
mStream = plock.connectStream(pulse_name, flags, nullptr, &spec, nullptr,
|
||||
BackendType::Playback);
|
||||
|
||||
constexpr auto move_callback = [](pa_stream *stream, void *pdata) noexcept
|
||||
static constexpr auto move_callback = [](pa_stream *stream, void *pdata) noexcept
|
||||
{ return static_cast<PulsePlayback*>(pdata)->streamMovedCallback(stream); };
|
||||
pa_stream_set_moved_callback(mStream, move_callback, this);
|
||||
mFrameSize = static_cast<uint>(pa_frame_size(pa_stream_get_sample_spec(mStream)));
|
||||
|
||||
if(pulse_name) mDeviceName.emplace(pulse_name);
|
||||
else mDeviceName.reset();
|
||||
if(display_name.empty())
|
||||
if(!pulse_name.empty())
|
||||
mDeviceId.emplace(std::move(pulse_name));
|
||||
|
||||
if(mDeviceName.empty())
|
||||
{
|
||||
auto name_callback = [](pa_context *context, const pa_sink_info *info, int eol, void *pdata) noexcept
|
||||
static constexpr auto name_callback = [](pa_context *context, const pa_sink_info *info,
|
||||
int eol, void *pdata) noexcept
|
||||
{ return static_cast<PulsePlayback*>(pdata)->sinkNameCallback(context, info, eol); };
|
||||
pa_operation *op{pa_context_get_sink_info_by_name(mMainloop.getContext(),
|
||||
pa_stream_get_device_name(mStream), name_callback, this)};
|
||||
plock.waitForOperation(op);
|
||||
}
|
||||
else
|
||||
mDevice->DeviceName = display_name;
|
||||
}
|
||||
|
||||
bool PulsePlayback::reset()
|
||||
{
|
||||
MainloopUniqueLock plock{mMainloop};
|
||||
const auto deviceName = mDeviceName ? mDeviceName->c_str() : nullptr;
|
||||
const auto deviceName = mDeviceId ? mDeviceId->c_str() : nullptr;
|
||||
|
||||
if(mStream)
|
||||
{
|
||||
|
|
@ -877,7 +931,7 @@ bool PulsePlayback::reset()
|
|||
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_EARLY_REQUESTS};
|
||||
if(!GetConfigValueBool({}, "pulse", "allow-moves", true))
|
||||
flags |= PA_STREAM_DONT_MOVE;
|
||||
if(GetConfigValueBool(mDevice->DeviceName, "pulse", "adjust-latency", false))
|
||||
if(GetConfigValueBool(mDevice->mDeviceName, "pulse", "adjust-latency", false))
|
||||
{
|
||||
/* ADJUST_LATENCY can't be specified with EARLY_REQUESTS, for some
|
||||
* reason. So if the user wants to adjust the overall device latency,
|
||||
|
|
@ -886,7 +940,7 @@ bool PulsePlayback::reset()
|
|||
flags &= ~PA_STREAM_EARLY_REQUESTS;
|
||||
flags |= PA_STREAM_ADJUST_LATENCY;
|
||||
}
|
||||
if(GetConfigValueBool(mDevice->DeviceName, "pulse", "fix-rate", false)
|
||||
if(GetConfigValueBool(mDevice->mDeviceName, "pulse", "fix-rate", false)
|
||||
|| !mDevice->Flags.test(FrequencyRequest))
|
||||
flags |= PA_STREAM_FIX_RATE;
|
||||
|
||||
|
|
@ -948,16 +1002,16 @@ bool PulsePlayback::reset()
|
|||
mSpec.format = PA_SAMPLE_FLOAT32NE;
|
||||
break;
|
||||
}
|
||||
mSpec.rate = mDevice->Frequency;
|
||||
mSpec.rate = mDevice->mSampleRate;
|
||||
mSpec.channels = static_cast<uint8_t>(mDevice->channelsFromFmt());
|
||||
if(pa_sample_spec_valid(&mSpec) == 0)
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "Invalid sample spec"};
|
||||
|
||||
const auto frame_size = static_cast<uint>(pa_frame_size(&mSpec));
|
||||
mAttr.maxlength = ~0u;
|
||||
mAttr.tlength = mDevice->BufferSize * frame_size;
|
||||
mAttr.tlength = mDevice->mBufferSize * frame_size;
|
||||
mAttr.prebuf = 0u;
|
||||
mAttr.minreq = mDevice->UpdateSize * frame_size;
|
||||
mAttr.minreq = mDevice->mUpdateSize * frame_size;
|
||||
mAttr.fragsize = ~0u;
|
||||
|
||||
mStream = plock.connectStream(deviceName, flags, &mAttr, &mSpec, &chanmap,
|
||||
|
|
@ -974,15 +1028,15 @@ bool PulsePlayback::reset()
|
|||
mSpec = *(pa_stream_get_sample_spec(mStream));
|
||||
mFrameSize = static_cast<uint>(pa_frame_size(&mSpec));
|
||||
|
||||
if(mDevice->Frequency != mSpec.rate)
|
||||
if(mDevice->mSampleRate != mSpec.rate)
|
||||
{
|
||||
/* Server updated our playback rate, so modify the buffer attribs
|
||||
* accordingly.
|
||||
*/
|
||||
const auto scale = static_cast<double>(mSpec.rate) / mDevice->Frequency;
|
||||
const auto perlen = std::clamp(std::round(scale*mDevice->UpdateSize), 64.0, 8192.0);
|
||||
const auto scale = static_cast<double>(mSpec.rate) / mDevice->mSampleRate;
|
||||
const auto perlen = std::clamp(std::round(scale*mDevice->mUpdateSize), 64.0, 8192.0);
|
||||
const auto bufmax = uint{std::numeric_limits<int>::max()} / mFrameSize;
|
||||
const auto buflen = std::clamp(std::round(scale*mDevice->BufferSize), perlen*2.0,
|
||||
const auto buflen = std::clamp(std::round(scale*mDevice->mBufferSize), perlen*2.0,
|
||||
static_cast<double>(bufmax));
|
||||
|
||||
mAttr.maxlength = ~0u;
|
||||
|
|
@ -994,7 +1048,7 @@ bool PulsePlayback::reset()
|
|||
&mMainloop);
|
||||
plock.waitForOperation(op);
|
||||
|
||||
mDevice->Frequency = mSpec.rate;
|
||||
mDevice->mSampleRate = mSpec.rate;
|
||||
}
|
||||
|
||||
constexpr auto attr_callback = [](pa_stream *stream, void *pdata) noexcept
|
||||
|
|
@ -1002,8 +1056,8 @@ bool PulsePlayback::reset()
|
|||
pa_stream_set_buffer_attr_callback(mStream, attr_callback, this);
|
||||
bufferAttrCallback(mStream);
|
||||
|
||||
mDevice->BufferSize = mAttr.tlength / mFrameSize;
|
||||
mDevice->UpdateSize = mAttr.minreq / mFrameSize;
|
||||
mDevice->mBufferSize = mAttr.tlength / mFrameSize;
|
||||
mDevice->mUpdateSize = mAttr.minreq / mFrameSize;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1061,8 +1115,8 @@ ClockLatency PulsePlayback::getClockLatency()
|
|||
* server yet. Give a generic value since nothing better is available.
|
||||
*/
|
||||
if(err != -PA_ERR_NODATA)
|
||||
ERR("Failed to get stream latency: 0x%x\n", err);
|
||||
latency = mDevice->BufferSize - mDevice->UpdateSize;
|
||||
ERR("Failed to get stream latency: {:#x}", as_unsigned(err));
|
||||
latency = mDevice->mBufferSize - mDevice->mUpdateSize;
|
||||
neg = 0;
|
||||
}
|
||||
else if(neg) UNLIKELY
|
||||
|
|
@ -1074,7 +1128,7 @@ ClockLatency PulsePlayback::getClockLatency()
|
|||
|
||||
|
||||
struct PulseCapture final : public BackendBase {
|
||||
PulseCapture(DeviceBase *device) noexcept : BackendBase{device} { }
|
||||
explicit PulseCapture(DeviceBase *device) noexcept : BackendBase{device} { }
|
||||
~PulseCapture() override;
|
||||
|
||||
void streamStateCallback(pa_stream *stream) noexcept;
|
||||
|
|
@ -1090,7 +1144,7 @@ struct PulseCapture final : public BackendBase {
|
|||
|
||||
PulseMainloop mMainloop;
|
||||
|
||||
std::optional<std::string> mDeviceName{std::nullopt};
|
||||
std::optional<std::string> mDeviceId{std::nullopt};
|
||||
|
||||
al::span<const std::byte> mCapBuffer;
|
||||
size_t mHoleLength{0};
|
||||
|
|
@ -1113,7 +1167,7 @@ void PulseCapture::streamStateCallback(pa_stream *stream) noexcept
|
|||
{
|
||||
if(pa_stream_get_state(stream) == PA_STREAM_FAILED)
|
||||
{
|
||||
ERR("Received stream failure!\n");
|
||||
ERR("Received stream failure!");
|
||||
mDevice->handleDisconnect("Capture stream failure");
|
||||
}
|
||||
mMainloop.signal();
|
||||
|
|
@ -1126,13 +1180,13 @@ void PulseCapture::sourceNameCallback(pa_context*, const pa_source_info *info, i
|
|||
mMainloop.signal();
|
||||
return;
|
||||
}
|
||||
mDevice->DeviceName = info->description;
|
||||
mDeviceName = info->description;
|
||||
}
|
||||
|
||||
void PulseCapture::streamMovedCallback(pa_stream *stream) noexcept
|
||||
{
|
||||
mDeviceName = pa_stream_get_device_name(stream);
|
||||
TRACE("Stream moved to %s\n", mDeviceName->c_str());
|
||||
mDeviceId = pa_stream_get_device_name(stream);
|
||||
TRACE("Stream moved to {}", *mDeviceId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1146,21 +1200,20 @@ void PulseCapture::open(std::string_view name)
|
|||
"Failed to start device mainloop"};
|
||||
}
|
||||
|
||||
const char *pulse_name{nullptr};
|
||||
auto pulse_name = std::string{};
|
||||
if(!name.empty())
|
||||
{
|
||||
if(CaptureDevices.empty())
|
||||
mMainloop.probeCaptureDevices();
|
||||
|
||||
auto match_name = [name](const DevMap &entry) -> bool
|
||||
{ return entry.name == name || entry.device_name == name; };
|
||||
|
||||
auto plock = MainloopUniqueLock{gGlobalMainloop};
|
||||
auto iter = std::find_if(CaptureDevices.cbegin(), CaptureDevices.cend(), match_name);
|
||||
if(iter == CaptureDevices.cend())
|
||||
throw al::backend_exception{al::backend_error::NoDevice,
|
||||
"Device name \"%.*s\" not found", al::sizei(name), name.data()};
|
||||
"Device name \"{}\" not found", name};
|
||||
|
||||
pulse_name = iter->device_name.c_str();
|
||||
mDevice->DeviceName = iter->name;
|
||||
pulse_name = iter->device_name;
|
||||
mDeviceName = iter->name;
|
||||
}
|
||||
|
||||
MainloopUniqueLock plock{mMainloop};
|
||||
|
|
@ -1179,7 +1232,7 @@ void PulseCapture::open(std::string_view name)
|
|||
case DevFmtX7144:
|
||||
case DevFmtX3D71:
|
||||
case DevFmtAmbi3D:
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "%s capture not supported",
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "{} capture not supported",
|
||||
DevFmtChannelsString(mDevice->FmtChans)};
|
||||
}
|
||||
setDefaultWFXChannelOrder();
|
||||
|
|
@ -1203,26 +1256,26 @@ void PulseCapture::open(std::string_view name)
|
|||
case DevFmtUShort:
|
||||
case DevFmtUInt:
|
||||
throw al::backend_exception{al::backend_error::DeviceError,
|
||||
"%s capture samples not supported", DevFmtTypeString(mDevice->FmtType)};
|
||||
"{} capture samples not supported", DevFmtTypeString(mDevice->FmtType)};
|
||||
}
|
||||
mSpec.rate = mDevice->Frequency;
|
||||
mSpec.rate = mDevice->mSampleRate;
|
||||
mSpec.channels = static_cast<uint8_t>(mDevice->channelsFromFmt());
|
||||
if(pa_sample_spec_valid(&mSpec) == 0)
|
||||
throw al::backend_exception{al::backend_error::DeviceError, "Invalid sample format"};
|
||||
|
||||
const auto frame_size = static_cast<uint>(pa_frame_size(&mSpec));
|
||||
const uint samples{std::max(mDevice->BufferSize, mDevice->Frequency*100u/1000u)};
|
||||
const uint samples{std::max(mDevice->mBufferSize, mDevice->mSampleRate*100u/1000u)};
|
||||
mAttr.minreq = ~0u;
|
||||
mAttr.prebuf = ~0u;
|
||||
mAttr.maxlength = samples * frame_size;
|
||||
mAttr.tlength = ~0u;
|
||||
mAttr.fragsize = std::min(samples, mDevice->Frequency*50u/1000u) * frame_size;
|
||||
mAttr.fragsize = std::min(samples, mDevice->mSampleRate*50u/1000u) * frame_size;
|
||||
|
||||
pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_ADJUST_LATENCY};
|
||||
if(!GetConfigValueBool({}, "pulse", "allow-moves", true))
|
||||
flags |= PA_STREAM_DONT_MOVE;
|
||||
|
||||
TRACE("Connecting to \"%s\"\n", pulse_name ? pulse_name : "(default)");
|
||||
TRACE("Connecting to \"{}\"", pulse_name.empty() ? "(default)"sv:std::string_view{pulse_name});
|
||||
mStream = plock.connectStream(pulse_name, flags, &mAttr, &mSpec, &chanmap,
|
||||
BackendType::Capture);
|
||||
|
||||
|
|
@ -1234,9 +1287,10 @@ void PulseCapture::open(std::string_view name)
|
|||
{ return static_cast<PulseCapture*>(pdata)->streamStateCallback(stream); };
|
||||
pa_stream_set_state_callback(mStream, state_callback, this);
|
||||
|
||||
if(pulse_name) mDeviceName.emplace(pulse_name);
|
||||
else mDeviceName.reset();
|
||||
if(mDevice->DeviceName.empty())
|
||||
if(!pulse_name.empty())
|
||||
mDeviceId.emplace(std::move(pulse_name));
|
||||
|
||||
if(mDeviceName.empty())
|
||||
{
|
||||
constexpr auto name_callback = [](pa_context *context, const pa_source_info *info, int eol,
|
||||
void *pdata) noexcept
|
||||
|
|
@ -1305,7 +1359,7 @@ void PulseCapture::captureSamples(std::byte *buffer, uint samples)
|
|||
const pa_stream_state_t state{pa_stream_get_state(mStream)};
|
||||
if(!PA_STREAM_IS_GOOD(state)) UNLIKELY
|
||||
{
|
||||
mDevice->handleDisconnect("Bad capture state: %u", state);
|
||||
mDevice->handleDisconnect("Bad capture state: {}", al::to_underlying(state));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1313,7 +1367,7 @@ void PulseCapture::captureSamples(std::byte *buffer, uint samples)
|
|||
size_t caplen{};
|
||||
if(pa_stream_peek(mStream, &capbuf, &caplen) < 0) UNLIKELY
|
||||
{
|
||||
mDevice->handleDisconnect("Failed retrieving capture samples: %s",
|
||||
mDevice->handleDisconnect("Failed retrieving capture samples: {}",
|
||||
pa_strerror(pa_context_errno(mMainloop.getContext())));
|
||||
break;
|
||||
}
|
||||
|
|
@ -1341,8 +1395,8 @@ uint PulseCapture::availableSamples()
|
|||
if(static_cast<ssize_t>(got) < 0) UNLIKELY
|
||||
{
|
||||
const char *err{pa_strerror(static_cast<int>(got))};
|
||||
ERR("pa_stream_readable_size() failed: %s\n", err);
|
||||
mDevice->handleDisconnect("Failed getting readable size: %s", err);
|
||||
ERR("pa_stream_readable_size() failed: {}", err);
|
||||
mDevice->handleDisconnect("Failed getting readable size: {}", err);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1377,7 +1431,7 @@ ClockLatency PulseCapture::getClockLatency()
|
|||
|
||||
if(err != 0) UNLIKELY
|
||||
{
|
||||
ERR("Failed to get stream latency: 0x%x\n", err);
|
||||
ERR("Failed to get stream latency: {:#x}", as_unsigned(err));
|
||||
latency = 0;
|
||||
neg = 0;
|
||||
}
|
||||
|
|
@ -1393,7 +1447,7 @@ ClockLatency PulseCapture::getClockLatency()
|
|||
|
||||
bool PulseBackendFactory::init()
|
||||
{
|
||||
#ifdef HAVE_DYNLOAD
|
||||
#if HAVE_DYNLOAD
|
||||
if(!pulse_handle)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
@ -1406,7 +1460,7 @@ bool PulseBackendFactory::init()
|
|||
pulse_handle = LoadLib(PALIB);
|
||||
if(!pulse_handle)
|
||||
{
|
||||
WARN("Failed to load %s\n", PALIB);
|
||||
WARN("Failed to load {}", PALIB);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1420,13 +1474,13 @@ bool PulseBackendFactory::init()
|
|||
|
||||
if(!missing_funcs.empty())
|
||||
{
|
||||
WARN("Missing expected functions:%s\n", missing_funcs.c_str());
|
||||
WARN("Missing expected functions:{}", missing_funcs);
|
||||
CloseLib(pulse_handle);
|
||||
pulse_handle = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_DYNLOAD */
|
||||
#endif
|
||||
|
||||
pulse_ctx_flags = PA_CONTEXT_NOFLAGS;
|
||||
if(!GetConfigValueBool({}, "pulse", "spawn-server", false))
|
||||
|
|
@ -1460,21 +1514,32 @@ auto PulseBackendFactory::enumerate(BackendType type) -> std::vector<std::string
|
|||
{
|
||||
std::vector<std::string> outnames;
|
||||
|
||||
auto add_device = [&outnames](const DevMap &entry) -> void
|
||||
{ outnames.push_back(entry.name); };
|
||||
auto add_playback_device = [&outnames](const DevMap &entry) -> void
|
||||
{
|
||||
if(entry.device_name == DefaultPlaybackDevName)
|
||||
outnames.emplace(outnames.cbegin(), entry.name);
|
||||
else
|
||||
outnames.push_back(entry.name);
|
||||
};
|
||||
auto add_capture_device = [&outnames](const DevMap &entry) -> void
|
||||
{
|
||||
if(entry.device_name == DefaultCaptureDevName)
|
||||
outnames.emplace(outnames.cbegin(), entry.name);
|
||||
else
|
||||
outnames.push_back(entry.name);
|
||||
};
|
||||
|
||||
auto plock = MainloopUniqueLock{gGlobalMainloop};
|
||||
switch(type)
|
||||
{
|
||||
case BackendType::Playback:
|
||||
gGlobalMainloop.probePlaybackDevices();
|
||||
outnames.reserve(PlaybackDevices.size());
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_playback_device);
|
||||
break;
|
||||
|
||||
case BackendType::Capture:
|
||||
gGlobalMainloop.probeCaptureDevices();
|
||||
outnames.reserve(CaptureDevices.size());
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_capture_device);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1502,9 +1567,9 @@ alc::EventSupport PulseBackendFactory::queryEventSupport(alc::EventType eventTyp
|
|||
{
|
||||
case alc::EventType::DeviceAdded:
|
||||
case alc::EventType::DeviceRemoved:
|
||||
case alc::EventType::DefaultDeviceChanged:
|
||||
return alc::EventSupport::FullSupport;
|
||||
|
||||
case alc::EventType::DefaultDeviceChanged:
|
||||
case alc::EventType::Count:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue