(Since I could not attached both patches in one ticket, this is the second of two.)
Normally sound effects (Sample_Play) will play without music. But if you begin playing music for instance with Player_Start and then use Player_TogglePause all playing sound effects will also pause. Also, no new sound effects will begin to play while a song is loaded and paused. After using Player_Stop, which "unloads" the song, sound effect behavior returns to normal. This can be fixed by removing the check for the pause flag in MikMod_Update_internal and adding something to Player_TogglePause which silences all music voices when music is paused. This is one of the patches attached.
An additional problem is that sound effects do not even play without music on OSX. If the above problem is fixed with the respective patch, then this issue with OSX will be fixed by ignoring the "paused state" (paused flag or non-existence of a song) in the OSX driver macro FILL_BUFFER. Currently it causes silence if a song is not loaded, precluding all sound, even sound effects, until a song is loaded and unpaused. This check would be necessary if the previous problem weren't solved the way I explained. But if it were, there is really no reason to check these conditions in FILL_BUFFER in drv_osx.c. A patch for this is also attached. Actually I seem to be only able to attach one patch. See ticket "Sound effects do not play without music on OSX".
Thanks for the patches. I'll try going over them this weekend.
As for this particular patch: There are similar checks in windows dsound, xaudio2, openal, etc drivers too, and if I apply this, I'll need to do the same to them I guess.
Looking at xaudio2, yeah it seems like the same issue. If the silence case was not there, pausing would still work because of the check in Player_HandleTick. Of course you still need to silence the music voices on pause and stop. I don't have a way to test any of this on windows or any of the other drivers, unfortunately.