Perform logarithmic volume control for vchans
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 1 Dec 2008 23:52:00 +0000 (00:52 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 1 Dec 2008 23:59:10 +0000 (00:59 +0100)
commitcb8ff21ad49e7a92c572b31c6e26ad74d0feed5f
tree083cf37e266ed7a7aeb646f9ad0163aa220dcab4
parent0883c2a4050ce85799696f3de1fd296dc5bf771f
Perform logarithmic volume control for vchans

Previously we (and FreeBSD) would do a linear amplitude scaling, which
does not follow the natural expectation of a user.  Now volume knobs
actually behave like real life ones.

The curve is close enough to a sqare root, but whatever.

Inspired by 4front's opensound BSDL'd mixer code (which does the
opposite, i.e. converting log values to human linear scale).
sys/dev/sound/pcm/vchan.c