1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00
Commit Graph

41 Commits

Author SHA1 Message Date
Thomas Harte
ee7ef81054 Avoid potential attempt to free enqueued buffers at dealloc. 2022-07-15 15:21:58 -04:00
Thomas Harte
bae47fca20 Free buffers before disposing of queue. 2022-07-15 15:13:21 -04:00
Thomas Harte
60f997a52c Fix stereo buffering, various audio asserts. 2022-07-14 21:59:40 -04:00
Thomas Harte
9133e25a7b Allocate buffers once, ahead of time, and reuse. 2022-07-14 14:44:10 -04:00
Thomas Harte
ddfc2e4ca4 Provide sample length ahead of time. 2022-07-14 14:34:11 -04:00
Thomas Harte
4c031bd335 Don't use kAudioQueueProperty_IsRunning as it seems not to be trustworthy. 2022-07-13 22:22:19 -04:00
Thomas Harte
dcb68c16fe Eliminate AudioQueueBufferMaxLength. 2022-07-13 15:24:43 -04:00
Thomas Harte
10108303e7 Eliminate AudioQueueStop, which is very slow, use AudioQueueStart only as required. 2022-07-13 15:04:58 -04:00
Thomas Harte
b7ad94c676 Attempt to get a bit more rigorous in diagnosing queue stoppages. 2022-07-12 21:43:33 -04:00
Thomas Harte
1c537a877e Remove unnecessary lock. 2022-07-12 16:22:19 -04:00
Thomas Harte
4b9d92929a Tweak logic. 2022-07-12 16:02:30 -04:00
Thomas Harte
5b69324ee9 Tidy up comments. 2022-07-12 15:58:16 -04:00
Thomas Harte
df15d60b9e Switch to AudioQueueNewOutputWithDispatchQueue, reducing runloop contention. 2022-07-12 15:03:35 -04:00
Thomas Harte
a1544f3033 Do a better job of keeping the queue populated. 2022-07-11 20:50:02 -04:00
Thomas Harte
6dabdaca45 Switch to int; attempt to do a better job of initial audio filling. 2022-07-09 13:33:46 -04:00
Thomas Harte
43740a4b2f Adds support for stereo output. 2020-02-16 14:14:10 -05:00
Thomas Harte
f99d672237 The macOS port now selects stereo output if appropriate. 2020-02-16 14:05:50 -05:00
Thomas Harte
dac217c98c Defers starting the macOS audio queue, and attempts to restart it upon packet loss.
Hopefully forever to vanish permanent audio loss?
2020-02-08 22:08:27 -05:00
Thomas Harte
f7decd80b6 As an initial step, ensured latency doesn't pile up endlessly. 2018-05-15 21:12:43 -04:00
Thomas Harte
5d6b5d9f10 Eliminates all emdashes in cross-platform code. 2018-05-13 15:34:31 -04:00
Thomas Harte
0b771ce61a Removes all instances of the copyright symbol. 2018-05-13 15:19:52 -04:00
Thomas Harte
d751b7e2cb Marginally reformats for current style. 2018-02-11 20:32:59 -05:00
Thomas Harte
bdd432fe1d Added an ugly workaround for the empirical sound shutdown issues. 2017-03-26 20:28:04 -04:00
Thomas Harte
b193248056 Ensured that queue is not touched at all outside of the critical section. 2017-03-11 18:17:09 -05:00
Thomas Harte
38ce4dc56c Fixed potential deadlock, if a delegate decided to dealloc the queue as a result of its prompting. 2017-03-11 17:44:02 -05:00
Thomas Harte
2f0c923c29 Switched away from @synchronized as it appears possibly to be the lock used during -dealloc, creating deadlock with the CSAudioQueueDeallocLock. 2017-02-22 21:42:10 -05:00
Thomas Harte
4c947ad553 Attempted to resolve risk of an audio callback being in progress when -dealloc is received. 2017-02-22 21:12:59 -05:00
Thomas Harte
1d03793f22 Fixed potential race condition: ensure the queue is disposed of synchronously because otherwise there'll be a potential dangling reference to self. 2017-02-22 07:35:09 -05:00
Thomas Harte
91831b6a95 Introduced a reuse list for audio buffers, based on the observation that the audio queue seems to start quick rejecting them. 2016-10-23 21:17:00 -04:00
Thomas Harte
7c33c34b0c Have withdrawn attempt to be clever with client notification here, as it was having no effect in the current environment, making it hard to build up any confidence. 2016-10-23 20:33:59 -04:00
Thomas Harte
5a808d789a Added an upper threshold that must be crossed before a lower threshold warning is communicated. 2016-10-18 22:21:34 -04:00
Thomas Harte
f6b6ec7009 Cemented new meaningof the audio queue delegate callout. 2016-10-17 08:18:32 -04:00
Thomas Harte
c105f2acd9 Sought to reduce chattiness. 2016-10-17 08:04:36 -04:00
Thomas Harte
f4b39c4435 Added documentation and experimentally reduced packet size. We'll see. 2016-10-10 07:42:24 -04:00
Thomas Harte
de397799ed Pulled away my crazy rationalisation of an audio queue into a circular buffer and decided just to trust the OS. This should reduce latency. 2016-10-10 07:30:00 -04:00
Thomas Harte
6079d30e58 Eliminated waiting here — either the buffer can be enqueued now or it is dropped. 2016-08-14 16:20:24 -04:00
Thomas Harte
097a9caa95 Delegates are all nullable, naturally. 2016-06-23 09:37:49 -04:00
Thomas Harte
090e92ad26 Making this large has very limited side effects. So why not? 2016-06-16 21:41:17 -04:00
Thomas Harte
3b71d1a309 Switched to a variable-length buffer based on attempting to hit approximately a certain quality of service. 2016-06-16 21:35:22 -04:00
Thomas Harte
2ee78d42b9 Made an attempt also to trigger updates upon audio packets being returned, and significantly to reduce the size and quantity of those. This should get down to 11ms latency if the output wave is 44100; I might need to scale up the buffer size as the sampling rate increases or this is going to get crazy at 192Khz. 2016-06-16 20:51:35 -04:00
Thomas Harte
ce59ad1911 Minor on-disk shuffle, to try to clarify ownership of responsibility. 2016-06-15 08:11:30 -04:00