I'm spending the little time I've got these days to study how things have been done in the SDL port. I find it quite strange how an OS task is being created every time you want to play some audio samples
Is that the proper way of doing it, or is it just a fix because of documentation being scarce?
The thread is created when you init audio, not every time you play a sample. You need to do the mixing in its own thread, otherwise you might not be able to feed it with audio data fast enough.
For example, if the drawing takes more time than it takes to play what's in the buffer, you would hear cracks in the music.
There are actually two threads, on that is mixing, and one that is writing it to wave out. The reason is because waveout_write is blocking, at least on the dingoo, so if you would use just one thread, there would be silence during the mixing.