Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/msm6258.c
RevisionDateAuthorComments
 1.26  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.25  03-Sep-2018  riastradh branches: 1.25.2;
Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.24  02-Sep-2017  isaki branches: 1.24.2; 1.24.4;
Revert previous local conversion for vs(4).
 1.23  05-Aug-2017  isaki vs(4) became to able to play audio again.
At the moment the encoding conversion using set_params() does
not seem to work for me. So vs(4) uses local conversion to/from
ADPCM instead of it. But this should be a temporary work.
XXX The playback quality is very poor compared to before...
XXX Recording is not tested.
 1.22  05-Aug-2017  isaki Fix typo. 266 -> 256.
 1.21  02-Aug-2017  isaki Use endian conversion macros (and some rearrange for readability).
No functional changes.
 1.20  30-Jul-2017  isaki Improve diagnostic code.
If the specified encoding is wrong, it outputs a sound like a buzzer :)
rather than panic.
 1.19  27-Jul-2017  isaki Also allow SLINEAR_BE on msm6258_linear8_to_adpcm.
Before merging in-kernel mixing, it was called with SLINEAR_LE even if
big endian arch. But now it seems to be called with SLINEAR_<HostEndian>.
 1.18  15-Jul-2017  isaki branches: 1.18.2;
Add DIAGNOSTIC code.
 1.17  23-Nov-2011  jmcneill branches: 1.17.8; 1.17.26;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.16  16-Oct-2011  isaki branches: 1.16.2; 1.16.4;
Switch to 2-clause license.
 1.15  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.14  11-Dec-2005  christos merge ktrace-lwp.
 1.13  08-Jun-2005  he branches: 1.13.2;
Adapt to compiling with -Wcast-qual by adding const to some pointer casts.
 1.12  10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.11  07-Sep-2003  isaki branches: 1.11.4;
Remove an advertising clause.
 1.10  13-Apr-2002  isaki branches: 1.10.10;
Fix minor typo in adpcm_estim[].
 1.9  07-Apr-2002  isaki Rewrite encode/decode algorithm completely.
It improves playing/recording quality greatly
and it was almost done by Yosuke Sugahara <penta@fuchu.or.jp>.
Thanks a lot!

Add support of slinear8, slinear16_le, slinear16_be.
 1.8  02-Apr-2002  isaki initialize codec variables every open().
 1.7  02-Apr-2002  isaki Correct ADPCM -> linear8 conversion routine.
Now, we can record on vs0 (but it's very noisy)
 1.6  16-Mar-2002  isaki Fix mis-increment bug in converter msm6258_ulinear8_to_adpcm().
This fix needs factor_denom.
 1.5  13-Nov-2001  lukem add/cleanup RCSID
 1.4  16-Oct-2001  minoura #include mulaw.h for converter functions prototypes.
 1.3  03-May-2001  minoura branches: 1.3.2; 1.3.4;
Correct playing mu-law and linear.
 1.2  02-May-2001  minoura Oops, it contained some debug code.
 1.1  02-May-2001  minoura Software codec for Oki MSM6258 voice synthesizer.
Recording untested.
 1.3.4.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.6  17-Apr-2002  nathanw Catch up to -current.
 1.3.2.5  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.3.2.3  22-Oct-2001  nathanw Catch up to -current.
 1.3.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.3.2.1  03-May-2001  nathanw file msm6258.c was added on branch nathanw_sa on 2001-06-21 20:02:57 +0000
 1.10.10.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.10.4  17-Jan-2005  skrll Sync with HEAD.
 1.10.10.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.10.2  18-Sep-2004  skrll Sync with HEAD.
 1.10.10.1  03-Aug-2004  skrll Sync with HEAD
 1.11.4.2  05-Jan-2005  kent introduce FILTER_LOOP_PROLOGUE() and FILTER_LOOP_EPILOGUE() macros, and
simplify filter implementations by the macros.
 1.11.4.1  03-Jan-2005  kent adopt the filter pipeline framework
 1.13.2.1  21-Jun-2006  yamt sync with head.
 1.16.4.1  20-Nov-2011  jmcneill adapt to audiomp api changes
 1.16.2.1  17-Apr-2012  yamt sync with head
 1.17.26.1  28-Aug-2017  skrll Sync with HEAD
 1.17.8.1  03-Dec-2017  jdolecek update from HEAD
 1.18.2.2  15-Jul-2017  isaki 2873897
 1.18.2.1  15-Jul-2017  isaki file msm6258.c was added on branch perseant-stdc-iso10646 on 2017-07-15 10:17:10 +0000
 1.24.4.1  10-Jun-2019  christos Sync with HEAD
 1.24.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.25.2.3  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.25.2.2  03-May-2019  isaki Remove unnecessary header file.
 1.25.2.1  21-Apr-2019  isaki Adapt to audio2.

RSS XML Feed