Home | History | Annotate | Download | only in isa
History log of /src/sys/dev/isa/sbdspvar.h
RevisionDateAuthorComments
 1.62  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.61  23-Nov-2011  jmcneill branches: 1.61.50; 1.61.54;
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.60  12-May-2009  cegger branches: 1.60.12; 1.60.14;
struct device * -> device_t, no functional changes intended.
 1.59  15-Mar-2008  cube branches: 1.59.4; 1.59.16; 1.59.18;
Split device_t and softc for sb(4) and all its attachments.
 1.58  13-Apr-2006  cube branches: 1.58.16; 1.58.34; 1.58.54; 1.58.58;
Fix grammar in a comment, and use named constants for better readability.
 1.57  11-Dec-2005  christos branches: 1.57.4; 1.57.6; 1.57.8; 1.57.10; 1.57.12;
merge ktrace-lwp.
 1.56  13-Jan-2005  kent branches: 1.56.10;
ansify and KNF
 1.55  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.54  09-Jul-2004  mycroft branches: 1.54.2;
Forgot to commit this.
 1.53  08-Jul-2003  itojun function prototype must not have variable name
 1.52  03-May-2003  wiz branches: 1.52.2;
DMA, not dma nor Dma.
 1.51  01-Feb-2003  thorpej Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.50  19-Dec-2000  mjl Add quirk for Avance Logic ALS100+, which doesn't like it's irq/drq
being set in pnp mode.
 1.49  26-Jun-2000  simonb Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.48  07-Feb-2000  thorpej branches: 1.48.4;
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
 1.47  10-Oct-1999  mycroft branches: 1.47.2;
Oops; this should get mpu.h, not midi.h.
 1.46  09-Oct-1999  mycroft NMIDI -> NMPU, to be consistent with sbdsp.c.
 1.45  09-Oct-1999  mycroft NMIDI -> NMPU, to be consistent with sbdsp.c.
 1.44  02-Aug-1999  augustss branches: 1.44.2;
Move the mpu device declaration to conf/files.
Let the mpu device attach at the sb device, and then midi at the mpu.
Update the mpu at eso attachment.
 1.43  01-Aug-1999  augustss Move the MPU driver isa/ to ic/.
(I didn't move it in the repository because the revision history
is very short and uninteresting. :)
 1.42  22-Mar-1999  mycroft branches: 1.42.4;
Several things:
* Rearrange the speed mapping table and adjust the code so that the highest
rate can actually be used. Previously we ended up rounding up slightly
lower speeds and then losing because set_params couldn't set the mode
back to the current one.
* Allow 260 as a valid I/O address, since the SB1 can be jumpered to this.
* Change the MPU-401 code so it can be attached as a separate device.
(XXX Really, the SB code ought to just attach a subdevice itself.)
* Do not attach an OPL on the SB1. Writing to the OPL registers at
SB_base+0 on this card wedges my machine.
(XXX Should we access it at 388 instead? The Creative web site claims
that this board *does* have an OPL2, but I haven't played with this
extensively.)
* Allocate the SB DMA channels at open time, rather than attach time, so
that a single DRQ can be used for multiple cards (if only one is in use
at a given time).
(XXX Let me tell you why this is a horrible hack. If the ISA DMA code
tries to allocate a bounce buffer after boot time, it will generally fail,
because there is no contiguous memory below 16MB and the code to allocate
contiguous pages doesn't know how to move things around. Now, we
shouldn't ever be using bounce buffers here, because we use
isa_dmamem_alloc(). So we just turn off BUS_DMA_ALLOCNOW and we don't
actually try to. That's cool, and it even works, but isa_dmamem_alloc()
has the same problem. It just happens that we allocate the ring buffers
at boot time, and whenever we reallocate them (due to the buffer size
changing), we just deallocated the previous (contiguous) buffer, so we get
lucky. This is absolutely disgusting and needs to be fixed.)
 1.41  19-Feb-1999  mycroft Move IRQ setup into frontend. Need to move DRQ handling as well.
 1.40  18-Feb-1999  mycroft Remove some superfluous softc elements.
 1.39  18-Feb-1999  mycroft Add separate halt_output and halt_input routines.
 1.38  17-Feb-1999  mycroft Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.
 1.37  10-Aug-1998  mycroft Use the new trigger_{in,out}put interface.
Also, even on the SB1, we can leave the DMA controller in auto-initalize
mode and just send a command to the board for each block. This may help
prevent FIFO underruns.
 1.36  07-Aug-1998  augustss Add MIDI support. The MIDI devices can be accessed as ``raw'' through
the /dev/rmidiN devices, or with a sequencer interface via /dev/music.
So far the only supported MIDI device is the MPU401 port on SoundBlaster
(and only on SB on isapnp, since we do not have locators with multiple
values yet).
 1.35  29-Jun-1998  thorpej When hooking up the interrupt handler, use an interrupt share type
specified by the front-end.
 1.34  09-Jun-1998  thorpej Adjust for changes to the ISA DMA API.
 1.33  19-Oct-1997  augustss Make the audio API (almost) SunOS compatible.
The changes is to allow some limited mixer manipulation through
the audio device (instead of the mixer device).
This rendered 4 methods in audio_hw_if unused so garbage collect these.
 1.32  16-Oct-1997  augustss Make sure the 'input' class is used even for the 1345 mixer.
 1.31  30-Aug-1997  augustss Make SB full duplex. Ooops, I forgot this in the last commit.
 1.30  24-Aug-1997  augustss Add mute and channels swap to the mixer capabilites.
 1.29  24-Aug-1997  augustss - Change audio_hw_if a little: set_param now sets the play and record modes
at the same time instead by using two different calls. This enables
it to check more easily if the combined mode is all right.
- Improve the error checking in audio.c.
- Add a new audio property, AUDIO_PROP_INDEPENDENT, show if the
play and record settings are independent.
- Fix some buglets in audio.c.
 1.28  04-Aug-1997  augustss Audio:
* Make it possible to use software assisted encodings that expand the
sample size.
* Use 16 bits per sample when emulating mulaw coding on the SB.
* Prepare for SB16 without CT1745 mixer.
 1.27  31-Jul-1997  augustss 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.
 1.26  28-Jul-1997  augustss branches: 1.26.2;
Audio: Remove the machine dependant code I put in audio.c by mistake.
This adds another method to audio_hw_if. Also remove a field from
audio_hw_if that was not read-only.
 1.25  27-Jul-1997  augustss audio: Simplify handling of AUDIO_SETFD and committing of encoding mode.
 1.24  27-Jul-1997  augustss Changes to the sudio system:
- It is now possible to handle devices that want "looping" DMA,
e.g. the SoundBlaster correctly. The WSS and SB drivers use this.
To do this several new methods were introduced in audio_hw_if.
- Different silence handling (forced by previous change).
- The audio driver can now be mmap()-ed, but due to problems in
the VM system only for writing for now.
- The OSS (Linux) audio emulation takes advantage of some of the
new features.
 1.23  06-Jun-1997  thorpej Pull thorpej-bus-dma branch into mainline.
 1.22  23-May-1997  augustss Redo the way selecting the mode for SB cards is done completely.
It is now table driven since there are so many different variations
of SB cards out there.
Also fix a bug that stopped SB2 and SBPro from working.
 1.21  19-May-1997  augustss Redo the SB mixer code. The driver can now distinguish between the
four different mixer options: none, CT1335, CT1345, and CT1745.
It should now be possible to access most of the SB16 functionality.
 1.20  09-May-1997  augustss branches: 1.20.2;
Change the interface between high and lowlevel audio drivers again:
Set the encoding parameters slightly differently.
Remove the SW encoding/decodinf functions from this interface
and move them to the audio_parameter struct; this is both more efficient
and flexible.
 1.19  29-Apr-1997  augustss Change the interface between the high and low level audio drivers
so that all audio encoding parameters are set at once. This simplifies
the interface and make error checking easier.
 1.18  20-Mar-1997  mycroft Use autoinitialize DMA mode on the SB2 and later. Partly from Torsten Duwe.
 1.17  20-Mar-1997  mycroft Add 16-bit DRQ support on PnP, and enable 16-bit output.
 1.16  20-Mar-1997  mycroft Combine set_encoding and set_precision into a single set_format interface.
 1.15  13-Mar-1997  mycroft Don't share the silence block between devices. Make silence filling work for
more encodings, and make it device-independent. From Lennart Augustsson, in
PR kern/3305.
 1.14  16-Jan-1997  christos - convert to bus_space_*
- split attachment code to sb_isa.c
 1.13  29-Apr-1996  christos branches: 1.13.2;
Fix gcc -Wall warnings.
 1.12  16-Mar-1996  jtk add MediaVision Jazz16 chipset support. It must be configured with
'flags 1' on the sb? kernel configuration file line (because it frobs a
noncontiguous IO port to configure the Jazz16 extensions).

Also, remove static sb_device structure and fill in user's buffer on
each request.
 1.11  01-Mar-1996  mycroft Add support to the ISA DMA framework for auto-initialize mode.
Add experimental SB16 code, disabled for now.
 1.10  18-Feb-1996  jtk Add bass/treble input filter adjustment controls to SB (Pro) driver
 1.9  16-Feb-1996  mycroft Various:
* Snap the sample rate when setting it, and remember only the time constant.
* Set the time constant when changing between play/record.
* Always return the actual sample rate with AUDIO_GETINFO.
 1.8  16-Feb-1996  mycroft Various, including:
* Add more delays while writing registers.
* Replace sc_dma{in,out}_inprogress with sc_dmadir.
* Eliminate the need for sc_locked.
* Add more DPRINTF()s.
 1.7  10-Nov-1995  mycroft Convert IRQ, DRQ, and port numbers to int.
 1.6  08-May-1995  brezak Remove strings
 1.5  17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.4  28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3  25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.2  08-Mar-1995  brezak Cleanup for SB16 (From Jan Sparud)
 1.1  21-Feb-1995  brezak SoundBlaster driver for SB, SB16 and SBPRO
 1.13.2.1  18-Jan-1997  thorpej Update from trunk.
 1.20.2.2  24-May-1997  thorpej Update from trunk.
 1.20.2.1  13-May-1997  thorpej Adapt to new software interface to the on-board ISA DMA controller.
 1.26.2.3  01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.2.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.26.2.1  23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.42.4.1  02-Aug-1999  thorpej Update from trunk.
 1.44.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.47.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.47.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.48.4.1  30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.52.2.4  17-Jan-2005  skrll Sync with HEAD.
 1.52.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.52.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.52.2.1  03-Aug-2004  skrll Sync with HEAD
 1.54.2.2  09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.54.2.1  03-Jan-2005  kent * adopt the filter pipeline framework

* ic/ad1848.c, isa/ess.c, isa/sbdsp.c
remove direct call of set_params() for the default encoding.
It should be called by the MI audio framework.
 1.56.10.2  17-Mar-2008  yamt sync with head.
 1.56.10.1  21-Jun-2006  yamt sync with head.
 1.57.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.57.10.1  19-Apr-2006  elad sync with head.
 1.57.8.1  24-May-2006  yamt sync with head.
 1.57.6.1  22-Apr-2006  simonb Sync with head.
 1.57.4.1  09-Sep-2006  rpaulo sync with head
 1.58.58.1  03-Apr-2008  mjf Sync with HEAD.
 1.58.54.1  24-Mar-2008  keiichi sync with head.
 1.58.34.1  23-Mar-2008  matt sync with HEAD
 1.58.16.1  27-Feb-2007  ad Add MP locking for audio drivers.
 1.59.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.59.16.2  11-Dec-2008  ad Checkpoint work in progress.
 1.59.16.1  08-Dec-2008  ad Convert some more drivers.
 1.59.4.1  16-May-2009  yamt sync with head
 1.60.14.1  19-Nov-2011  jmcneill port ad-audiomp2 branch changes to 5.99.56
todo:
- port ad-audiomp2 pcppi changes
- these drivers need to be fixed:
- emuxki
- gcscaudio
- hdafg
- uaudio
- umidi
- MD audio drivers
 1.60.12.1  17-Apr-2012  yamt sync with head
 1.61.54.1  03-May-2019  isaki Adapt sbdsp to audio2.
- Use new query_format/set_format interfaces.
The formats are created from sb[pr]modes tables.
- Drop INDEPENDENT property for models proir to SB_16.
 1.61.50.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed