History log of /netbsd-current/sys/dev/audio/audiodef.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.20 13-Aug-2022 isaki

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.


# 1.19 23-Apr-2022 isaki

audio(4): Remove no longer used counters.
These were used at very early phase of development.


# 1.18 20-Apr-2022 isaki

audio(4): Rework AUDIO_GETOOFFS.
- Count .samples/.deltablks in blocks. It makes .deltablks integer wrap
around safe.
- Remove suspicious one block offset from .offset. I added the offset
because it was observed so on NetBSD7. But according to manpage, it
should not be. And it looks fine without the offset.
- Related to that, remove a comment in AUDIO_WSEEK.
Limit the user-visible buffer to usrbuf only.


# 1.17 20-Apr-2022 isaki

audio(4): Make recording buffer more robust.
Previously, main buffer in recording track was usrbuf, which is the closest
buffer to the userland. Because, this buffer arrangement was symmetrical
with the playback track, and had affinity with the past implementation.
However, in the current implementation, read(2) (from user application)
takes recorded block out from inputbuf, which is the closest buffer to
rmixer, to usrbuf. So it was not good way to use the usrbuf as main buffer.
Now, usrbuf in recording track holds only fragment bytes in order to
transfer to the userland, and main buffer in recording track is the inputbuf,
the closest to rmixer.

Buffer size of the inputbuf is also modified. Previously, it was less than
64KB or at least 4 blocks. This had affinity with playback track and the
past implementation. But this was not appropriate for both formats with
too large frames or too small frames. In large frames (for example,
192kHz/12ch), 184KB buffer would be allocated but it corresponds to only
40msec. In opposite, in small frames (for example, 8000Hz/1ch), 64KB
buffer would be allocated and it corresponds to 4.1 seconds. But for such
machines that have 8000Hz/1ch device, in-kernel 64KB memory would probably
be expensive.
Now, inputbuf will always be allocated 16(NBLKIN) blocks, regardless of its
hardware format. It corresponds to 160msec on modern archs (if blk_ms=10),
or 640msec on antique archs (if blk_ms=40).


# 1.16 21-Aug-2021 andvar

s/recoding/recording/ in comments where it didn't actually mean recoding.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.15 13-Sep-2020 isaki

Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.19 23-Apr-2022 isaki

audio(4): Remove no longer used counters.
These were used at very early phase of development.


# 1.18 20-Apr-2022 isaki

audio(4): Rework AUDIO_GETOOFFS.
- Count .samples/.deltablks in blocks. It makes .deltablks integer wrap
around safe.
- Remove suspicious one block offset from .offset. I added the offset
because it was observed so on NetBSD7. But according to manpage, it
should not be. And it looks fine without the offset.
- Related to that, remove a comment in AUDIO_WSEEK.
Limit the user-visible buffer to usrbuf only.


# 1.17 20-Apr-2022 isaki

audio(4): Make recording buffer more robust.
Previously, main buffer in recording track was usrbuf, which is the closest
buffer to the userland. Because, this buffer arrangement was symmetrical
with the playback track, and had affinity with the past implementation.
However, in the current implementation, read(2) (from user application)
takes recorded block out from inputbuf, which is the closest buffer to
rmixer, to usrbuf. So it was not good way to use the usrbuf as main buffer.
Now, usrbuf in recording track holds only fragment bytes in order to
transfer to the userland, and main buffer in recording track is the inputbuf,
the closest to rmixer.

Buffer size of the inputbuf is also modified. Previously, it was less than
64KB or at least 4 blocks. This had affinity with playback track and the
past implementation. But this was not appropriate for both formats with
too large frames or too small frames. In large frames (for example,
192kHz/12ch), 184KB buffer would be allocated but it corresponds to only
40msec. In opposite, in small frames (for example, 8000Hz/1ch), 64KB
buffer would be allocated and it corresponds to 4.1 seconds. But for such
machines that have 8000Hz/1ch device, in-kernel 64KB memory would probably
be expensive.
Now, inputbuf will always be allocated 16(NBLKIN) blocks, regardless of its
hardware format. It corresponds to 160msec on modern archs (if blk_ms=10),
or 640msec on antique archs (if blk_ms=40).


# 1.16 21-Aug-2021 andvar

s/recoding/recording/ in comments where it didn't actually mean recoding.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.15 13-Sep-2020 isaki

Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.18 20-Apr-2022 isaki

audio(4): Rework AUDIO_GETOOFFS.
- Count .samples/.deltablks in blocks. It makes .deltablks integer wrap
around safe.
- Remove suspicious one block offset from .offset. I added the offset
because it was observed so on NetBSD7. But according to manpage, it
should not be. And it looks fine without the offset.
- Related to that, remove a comment in AUDIO_WSEEK.
Limit the user-visible buffer to usrbuf only.


# 1.17 20-Apr-2022 isaki

audio(4): Make recording buffer more robust.
Previously, main buffer in recording track was usrbuf, which is the closest
buffer to the userland. Because, this buffer arrangement was symmetrical
with the playback track, and had affinity with the past implementation.
However, in the current implementation, read(2) (from user application)
takes recorded block out from inputbuf, which is the closest buffer to
rmixer, to usrbuf. So it was not good way to use the usrbuf as main buffer.
Now, usrbuf in recording track holds only fragment bytes in order to
transfer to the userland, and main buffer in recording track is the inputbuf,
the closest to rmixer.

Buffer size of the inputbuf is also modified. Previously, it was less than
64KB or at least 4 blocks. This had affinity with playback track and the
past implementation. But this was not appropriate for both formats with
too large frames or too small frames. In large frames (for example,
192kHz/12ch), 184KB buffer would be allocated but it corresponds to only
40msec. In opposite, in small frames (for example, 8000Hz/1ch), 64KB
buffer would be allocated and it corresponds to 4.1 seconds. But for such
machines that have 8000Hz/1ch device, in-kernel 64KB memory would probably
be expensive.
Now, inputbuf will always be allocated 16(NBLKIN) blocks, regardless of its
hardware format. It corresponds to 160msec on modern archs (if blk_ms=10),
or 640msec on antique archs (if blk_ms=40).


# 1.16 21-Aug-2021 andvar

s/recoding/recording/ in comments where it didn't actually mean recoding.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.15 13-Sep-2020 isaki

Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.16 21-Aug-2021 andvar

s/recoding/recording/ in comments where it didn't actually mean recoding.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.15 13-Sep-2020 isaki

Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.15 13-Sep-2020 isaki

Support audio descriptor for fstat(1).
sys/dev/audio/*.h: export only what we need for fstat.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.14 29-Apr-2020 isaki

Set AUDIO_BLK_MS 40 msec on other old(slow) architectures not only m68k.
Thanks tsutsui@ for comment about architecture choice.
And move it from audiodef.h to audio.c as suggested by joerg@.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.13 28-Mar-2020 isaki

Reduce default AUDIO_BLK_MS from 40msec to 10msec on all platform except m68k
(m68k uses 40msec default as before). And remove the option from GENERIC.
- It's not good idea to set such parameter in individual GENERICs.
- 4msec is (probably no problem for most modern real hardware but)
too aggressive to be default.
- 10msec is too severe for antique machines but it's hard to draw a line.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.12 05-Mar-2020 riastradh

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did. opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.11 05-Mar-2020 riastradh

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.


Revision tags: ad-namecache-base3
# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.10 23-Feb-2020 isaki

Prevent a race between audiodetach and fileops methods using psref(9).
Fix PR kern/54427.
Thank you so much riastradh@


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.9 22-Feb-2020 isaki

Improve KASSERT messages.


Revision tags: ad-namecache-base2
# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

branches: 1.7.2; 1.7.4;
Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.8 25-Jan-2020 jmcneill

defopt AUDIO_BLK_MS


Revision tags: ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.7 06-Jul-2019 isaki

Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.7 06-Jul-2019 isaki

Implement auto recovery of the mixing volume.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.6 26-Jun-2019 isaki

Improve audiobell (and interfaces with audio).
- Generate pseudo sine wave if possible. It may improve timbre.
If it cannot represent a sine wave, it falls back to a triangular
wave or a rectangular wave.
- Volume adjustment.
- Calculate playback frequency based on mixer frequency.
Now audiobellopen() initializes playback parameters other than
sample_rate, and new audiobellsetrate() sets sample_rate.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.5 25-Jun-2019 isaki

Put the lowered mixing volume back when all playback tracks are closed.
TODO: about long life descriptor.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.4 10-Jun-2019 isaki

branches: 1.4.2;
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


Revision tags: phil-wifi-20190609
# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.3 23-May-2019 isaki

Remove unnecessary file lock.
It has been introduced to prevent multiple syscalls entering
simultaneously. But it's completely unnecessary.
It fixes firefox problem in PR kern/54177.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.


# 1.2 08-May-2019 isaki

Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c


# 1.1 21-Apr-2019 isaki

branches: 1.1.2;
file audiodef.h was initially added on branch isaki-audio2.