Commit Graph

25 Commits

Author SHA1 Message Date
jmcneill
8a962f23f2 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.
2011-11-23 23:07:28 +00:00
jmcneill
8877e89cfb auconv_exact_match: don't check precision, validbits, or channels for AC3 2011-09-07 00:11:58 +00:00
jmcneill
f250a93597 Add AUDIO_ENCODING_AC3 encoding type. 2011-09-06 01:16:43 +00:00
yamt
b1fea83762 remove extra semicolons. 2009-01-03 03:43:21 +00:00
cube
492d8b0d9e Split device_t and softc for audio(4), and other related cosmetic changes. 2008-03-04 18:23:44 +00:00
thorpej
ebd626809e TRUE -> true, FALSE -> false 2007-03-01 17:31:35 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jmcneill
aca78114dc Revert local changes not meant for previous commit. 2006-03-18 14:31:26 +00:00
jmcneill
e0476e5490 Check the return value of AUCONV_MALLOC. Fixes a pile of CIDs related to
auconv.
2006-03-18 13:12:15 +00:00
pooka
fd66aebd5b fix tyop in debug printf 2006-02-26 23:52:08 +00:00
pooka
bf4d72443b make compile with AUCONV_DEBUG: rename encoding_names to encoding_dbg_names
to avoid -Wshadow collision
2006-02-26 23:23:59 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
kent
23b5d91433 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
2005-01-10 22:01:36 +00:00
kent
0de9e471b6 add the following four functions:
extern int auconv_set_converter(const struct audio_format *, int,
				int, struct audio_params *, int);
extern int auconv_create_encodings(const struct audio_format *, int,
				   struct audio_encoding_set **);
extern int auconv_delete_encodings(struct audio_encoding_set *);
extern int auconv_query_encoding(const struct audio_encoding_set *,
				 audio_encoding_t *);

These are helper functions for implementing audio_hw_if::set_params() and
audio_hw_if::query_encodings().
2004-11-13 08:08:22 +00:00
kent
569fb75aef audio.c: revert a part of previous change.
auconv.c: correct handling of size parameter.
2002-03-15 14:55:03 +00:00
kent
a1f23f2a90 Move sampling rate conversion functions to aurateconv.c.
Introduce "aurateconv" attribute for audio devices.
Add aurateconv to uaudio and auich.
(due to kern/15845 and kern/15848)
2002-03-09 20:30:42 +00:00
kent
c329c38eef Sampling rate and mono-stereo conversion described in
http://mail-index.netbsd.org/tech-kern/2002/03/04/0005.html

auconv.c: Add conversion functions

audio.c: Sample alignment, calling conversion functions, etc.

audio_if.h: Add four hw_* members to "struct audio_params"

audiovar.h: Add conversion buffers, etc.

auich and uaudio: Add conversion request code to *_set_params().
2002-03-07 14:37:02 +00:00
augustss
30981eee37 Add ulinear8 to/from slinear16 transforms. 2002-02-18 19:50:03 +00:00
mrg
2f90cc02e7 <dev/auconv.h> -> "auconv.h"; this makes auconv.c portable. 2002-01-15 16:39:50 +00:00
lukem
2bbe2de647 add RCSIDs 2001-11-13 05:32:49 +00:00
augustss
9cf205c410 ANSIfy. 2001-10-02 23:31:54 +00:00
augustss
860ebb7a92 Make little endian and big endian version of all functions
that deal with 16 bit samples.  Let the drivers decide which ones
to use.
1999-11-01 18:12:19 +00:00
augustss
4d74b89725 Add trivial conversions between 8 and 16 bits. 1997-08-24 22:20:24 +00:00
augustss
658656bb99 Audio changes:
- Change the way attach and open works to allow multiple audio
	  devices.
	- Split the mulaw.c file into two to avoid dragging in mulaw
	  convertsion when they are not needed.  Add 16 bit alaw/mulaw tables.
	- Change the way audio properties are gotten.
	- Recognize more versions os SoundBlaster.
1997-07-31 22:33:08 +00:00