Fixed time callback #687
Replies: 8 comments 3 replies
-
The You can do If you do not need a fixed sized callback, you could consider disabling it with |
Beta Was this translation helpful? Give feedback.
-
@mackron , Ok, thank you.
And then every 120 milliseconds fires only 5 times. As for me it is really problem, because every 120 milliseconds my internal buffer raise for 1 element. |
Beta Was this translation helpful? Give feedback.
-
Can you put The backend is in control of when the callback gets fired. It looks like from your logs that the backend has asked for 120ms worth of data, hence why it was called 6 times, but then for some reason has asked for more data after only 100ms. From what I can tell, miniaudio has processed 120ms for the first callback, but only 100ms of that data was actually used, which leaves 20ms still in it's internal buffers. Then when the backend asks for 120ms of data again, miniaudio can see that there's already 20ms worth of data in it's internal buffer, and therefore only needs an extra 100ms from the callback and so only fires the callback 5 times. In any case, 100ms is an extremely long time for the backend to be waiting. It would be good to know what backend you're using in case there's an error that needs to be fixed somewhere ( |
Beta Was this translation helpful? Give feedback.
-
@mackron , hello? how are you? I looked method: firstly running In method in line Also 2880 appear from method |
Beta Was this translation helpful? Give feedback.
-
Also I tried deviceConfig.sampleRate = 32000 and 48000, and I think no problem. May be this problem only with 16000. |
Beta Was this translation helpful? Give feedback.
-
I haven't had a chance to properly look at this. The Mac backend is one of my secondary platforms so it tends to have less development priority. However, I need to check if this is a general issue with miniaudio's duplex implementation or if it's a mac-specific issue. |
Beta Was this translation helpful? Give feedback.
-
@mackron , hello. |
Beta Was this translation helpful? Give feedback.
-
@mackron , hello. |
Beta Was this translation helpful? Give feedback.
-
Hello. @mackron , please help me.
Now I try write client for audio chat, and I packeted audio from microphone to my struct and send by network, also I have buffer from network and pop one frame from queue and copy PCM to output.
Strange for me: how often callback runs. I observed 5-6 times in one millisecond, than next only 100-120 milliseconds.
I run code on Mac OS (also intel and ARM) and observed the same problem.
Can I add some parameter and callback runs every 20 milliseconds?
May be I need use RingBuffer?
My log with time:
I use this set up:
Beta Was this translation helpful? Give feedback.
All reactions