At Sun, 29 Mar 2020 15:11:39 +0200, Joerg Sonnenberger wrote: > > CPU load or performance is not subject. I know that my > > implementation will work on the most modern real hardware. > > But I feel that at least 4msec is too rush to be default. > > A default should not be for one game application. > > I would allow at least 1/HZ as baseline.
Thank you for comment. Using HZ sounds interesting idea, but unfortunately this will not make desired results (if what you are talking about can be written like following). ---- #if !defined(AUDIO_BLK_MS) # define AUDIO_BLK_MS (1000 / ((HZ > 1000) ? 1000 : HZ)) #endif ---- amd64 uses HZ=100 so that blk_ms=10. It looks good. alpha uses HZ=1024 (thanks thorpej@). If we assume upper limit HZ=1000, then blk_ms=1. It works [*] but I think that it's a bit small for default. m68k often uses HZ=60~100 so that blk_ms=10~16. This is obviously too small for m68k default. [*] On my alpha (500MHz), wss(4)/ISA works even on blk_ms=1. But I was not able to set 1msec on yds(4) PCI sound card on the same machine. Its lower limit was 5msec (due to driver's or hardware's restriction, I don't know details though). By the way, I am planning the following. How about this? ---- dev/audio/audiodef.h ---- #include <machine/audio_machdep.h> #if !defined(AUDIO_BLK_MS) # if defined(AUDIO_BLK_MS_MACHDEP) // or better name? /* Use machine dependent default if specified */ # define AUDIO_BLK_MS AUDIO_BLK_MS_MACHDEP # else /* Otherwise use MI default */ # define AUDIO_BLK_MS (10) # endif #endif ---- arch/<modern_ports>/include/audio_machdep.h ---- /* Use MI default, see dev/audio/audiodef.h */ #undef AUDIO_BLK_MS_MACHDEP ---- arch/<antique_ports>/include/audio_machdep.h ---- #define AUDIO_BLK_MS_MACHDEP (100) // for example ---- Thanks, --- Tetsuya Isaki <is...@pastel-flower.jp / is...@netbsd.org>