12 Commits

Author SHA1 Message Date
Chris Robinson
6f1c853397 Don't allocate the ring buffer for JACK before activation
It seems the JACK server can send buffer size change events during device reset
and wait on it, which causes a failure since the change event can't be
processed during a reset. It's otherwise impossible to safely disable the
change event callback during a reset since the lock is already held and the
callback can be waiting to acquire it. The only guarantee we seem to have is
the event callback won't be invoked after jack_activate succeeds.

So instead, the buffer size can be queried after jack_activate and the ring
buffer allocated then, instead of using an event callback. This does mean the
buffer size can change with a start() call, but it's better than a failure to
start.
2020-01-11 15:10:54 -08:00
Chris Robinson
e6e2f509f8 Make CreateRingBuffer a static RingBuffer method 2020-01-10 07:56:43 -08:00
Chris Robinson
2e6a55a87c Handle padding between device sample frames
The padding must be constant and sample type aligned (e.g. some fixed multiple
of two bytes between the start of two consecutive frames for 16-bit output).
The intent is to always have the ability for stereo output with WASAPI even if
the device has some other unsupported configuration, as long as front-left and
front-right exist.
2019-12-21 20:43:46 -08:00
Chris Robinson
b687e952ef Make C callbacks noexcept
No telling what would happen if exceptions managed to get back into presumably
C-based callers.
2019-10-09 03:29:25 -07:00
Chris Robinson
963580c2d5 Never return null from CreateRingBuffer
Allocation failure would already throw a bad_alloc anyway, now a size overflow
throws an exception too.
2019-10-08 21:55:03 -07:00
Chris Robinson
7726a06d26 Clean up some exception messages and avoid duplicate log messages 2019-10-08 05:44:38 -07:00
Chris Robinson
52a003e9bb Avoid raw lock/unlock calls 2019-10-07 23:22:06 -07:00
Chris Robinson
02d80cd74d Use exceptions for backend open failures 2019-10-07 21:37:56 -07:00
Chris Robinson
c5a3c52822 Return and pass more appropriate types for backends 2019-09-15 09:50:28 -07:00
Chris Robinson
a250b6a986 Return unsigned values from the FromDevFmt functions 2019-09-13 14:29:25 -07:00
Chris Robinson
70058a8a84 Move the dynload decls and defs to common 2019-08-10 21:54:30 -07:00
Chris Robinson
cb3e96e756 Rename Alc to alc 2019-07-28 18:56:04 -07:00