--- - branch: MAIN date: Sat Aug 13 06:47:41 UTC 2022 files: - new: '1.135' old: '1.134' path: src/sys/dev/audio/audio.c pathrev: src/sys/dev/audio/audio.c@1.135 type: modified - new: '1.20' old: '1.19' path: src/sys/dev/audio/audiodef.h pathrev: src/sys/dev/audio/audiodef.h@1.20 type: modified id: 20220813T064741Z.82c9c43956fa2a42754fb85402c2d7ad89ec372c log: | audio: Rework about usrbuf allocation. - Allocate the usrbuf from kmem(9) instead of uvm(9). The usrbuf has used uvm(9), in case mmap(2) might be issued later. However, despite the most apps don't use mmap(2), allocating (and reallocating) uvm(9) every time would be expensive. In addition, uvm(9) for recording usrbuf was totally pointless now. - For playback, the usrbuf memory will be allocated in pages. Because the usrbuf for playback is mostly near 64KB for backward compatibility. This will reduce reallocation especially from the initial ulaw to the most commonly used format like slinear16/2ch/48kHz. - When mmap(2) is called, it will replace the playback usrbuf from kmem(9) to uvm(9). - Prohibit changing playback format once mmap(2) is called. It follows netbsd-7. - For recording, the usrbuf memory will be allocated in the requested size every time as before. Because the usrbuf for recording is only one block and is enough small to the page in the most case. Inspired by PR kern/56947. module: src subject: 'CVS commit: src/sys/dev/audio' unixtime: '1660373261' user: isaki