in 2016 a student of mine laid the foundations for a voice analysis system The student has moved on and has not since worked with SuperCollider, but I have continued to develop the system, which includes about a dozen custom UGens.
One of them is GatedDiskOut, which is like DiskOut but with a gate input such that frames are added to its buffer only when the gate is open. It also removes the undocumented 32-input limit of DiskOut, and implements a mechanism that allows waiting for the last buffer to be written when GatedDiskOut_Dtor is invoked (the UGen is freed), using pthread. To build this UGen the compiler/linker needs to find both PThread and Libsndfile, and it seems to do so. The build instructions given by the student say that the versions of libsndfile used to build SC and this UGen should match, or it might not work.
This UGen still builds and works fine on Windows 10, which is where I live, but it has stopped working on MacOS. I think it stopped working with the arrival of /sc/platform/mac/lib/scUBlibsndfile.a, but I am not sure, and I now have only a Big Sur 11.6.4 machine to test on (with XCode 13.2.1). I can see from the file list.txt that this is the library to which the UGen GatedDiskOut.scx has been linked. I have tried going back to SC 3.11.2+BigSur and rebuilding, but the behaviour is the same (that version already contains scUBlibsndfile.a).
For recording, the client part of the app first creates a .wav file using Buffer.write(…), leaving the buffer open. The file gets created with a .wav header of 44 bytes, but after that, no data gets written to it any more (on MacOS, that is; on Windows, it still works). I have put traces into the .cpp file and it looks like sf_writef_float() is being called with what seems to be the right argument values at the right times. But the data do not make it into the file.
Any suggestions would be much appreciated, for why the disk-writing on Mac has stopped working in recent versions, or for how to debug this further.