MixMonitor flush frequency to disk

Hi there!

I need to increase frequency of MixMonitor flushed recorded files to the disk. I need realtime access to this files in disk, but I noted that it flushes only every 2 seconds or so.

There’s is a way to make it write faster? Maybe setting any kind of write cache?

Thanks in advance!

Wouldn’t it make more sense to stream the audio in this case? I also do not think that there is an Asterisk setting that explicitly handles the disk access. I’ve used some special operating system settings for that in the past (mainly for VMs running video software).

It’ not intended to provider real time readable captures. In fact, in all but the raw formats, it will not write the meta data until the end of the recording.

I’m pretty sure that the interval between writes is that set by the O/S standard I/O library, which will try to write large blocks to the device driver level. The O/S will cache the write to the disk further, but other processes will read that data from the cache, whereas the buffer used by standard I/O is private to the process, and in user space.

Any additional caching will delay the write even further.

There is also a buffer internally given to the file writing process using setvbuf[1][2]. There is no option to disable this.

[1] setvbuf - C++ Reference
[2] asterisk/file.c at master · asterisk/asterisk · GitHub

setvbuf is replacing the default internal buffer. The default internal buffer is 8K and it looks the asterisk is increasing it to 32K. That’s a reasonable thing to do, given that you aren’t expected to try to read the file whilst it is being written.

Indeed, these files aren’t meant for realtime access or usage.