Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/dev/audio



Module Name:    src
Committed By:   isaki
Date:           Sat Aug 13 06:47:41 UTC 2022

Modified Files:
        src/sys/dev/audio: audio.c audiodef.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/audio/audiodef.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index