Commit Graph

104 Commits

Author SHA1 Message Date
thorpej
52a2804a5c 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.
2000-02-07 22:07:27 +00:00
thorpej
0835b779d1 Simplify sbdsp_pause(). 2000-01-20 19:27:03 +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
mycroft
04a784cb79 Fix one more #ifdef, and now it actually compiles again. *sigh* 1999-10-10 00:14:44 +00:00
augustss
84d5e946e6 Use NMPU not NMIDI around call to mpu_intr. 1999-08-04 10:50:52 +00:00
augustss
42fb510148 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.
1999-08-02 17:37:41 +00:00
mycroft
9e4bd01bff Make sure we clean up any DMA maps if the open fails. 1999-03-22 14:38:02 +00:00
mycroft
97de30ff26 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.)
1999-03-22 07:37:35 +00:00
mycroft
7da867ec93 Use DMAMODE_LOOPDEMAND. Tested on a ViBRA16. 1999-02-22 02:16:40 +00:00
mycroft
9907eda026 spaces -> tabs 1999-02-18 16:09:01 +00:00
mycroft
81bc49921a Remove some superfluous softc elements. 1999-02-18 15:47:29 +00:00
mycroft
5e2fc07a14 Add separate halt_output and halt_input routines. 1999-02-18 07:08:35 +00:00
mycroft
7741cae143 Fix slight ommission in previous. 1999-02-17 02:43:13 +00:00
mycroft
e5f5e628d2 Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.
1999-02-17 02:37:38 +00:00
mycroft
88ad3aa42b If we have an 8-bit DRQ, always pass that to isa_malloc(). 1999-02-17 01:22:47 +00:00
augustss
332d7c138f Avoid arithmetic on `void *' since that's not ANSI C. 1999-01-08 18:10:35 +00:00
augustss
cd09067eb4 * Redo the way the way the MIDI driver attaches to audio devices.
* Improve the midisyn layer a little.
* Add a driver for the Yamaha OPL[23] FM synths.
  The opl driver is not finished yet; it sounds pretty awful.

For some strange reason I cannot get any FM sound from my SB64 cards,
but a regular SB16 works fine.
1998-08-17 21:16:09 +00:00
augustss
b034eb97bf Fix typo. 1998-08-10 20:02:48 +00:00
mycroft
060f81eb62 Minor change. 1998-08-10 02:19:18 +00:00
mycroft
93703857ca Slow down, Wilbur. 1998-08-10 02:13:44 +00:00
mycroft
7514d511f7 Fix a typo I introduced in the MIDI code. 1998-08-10 02:12:30 +00:00
mycroft
8d77cae1b4 For models prior to the SB16, there is only one clock divider, so couple the
sample rates.  However, only do this if both play and record are being used
simultaneously; otherwise we can't play 22KHz on the SB1.
1998-08-10 01:25:33 +00:00
mycroft
3dcff6581b 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.
1998-08-10 00:20:39 +00:00
augustss
48bae9ee88 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).
1998-08-07 00:00:55 +00:00
thorpej
5f97398507 Adjust for changes to the ISA DMA API. 1998-06-09 00:05:44 +00:00
augustss
775d60ecd7 Use lower case "agc" for consistency. 1998-03-04 19:38:28 +00:00
bouyer
d411251c64 Fix for the vibra16x from Lennart Augusts: saying that the dsp4.16 was
a SB64 was just a guess. The vibra16x is really a sb16.
1998-01-30 11:55:36 +00:00
mycroft
187df9b86e Set the gain to 1/2 by default; 3/4 is too loud and can damage headphones and
speakers.
1997-12-02 13:17:39 +00:00
augustss
e7029fc0da 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.
1997-10-19 07:41:33 +00:00
augustss
b2004a534c Make sure the 'input' class is used even for the 1345 mixer. 1997-10-16 23:34:57 +00:00
mycroft
b551325998 AudioElinear -> AudioEslinear 1997-10-11 12:36:04 +00:00
mycroft
2d019e5efd AudioC[A-Z] -> AudioC[a-z] 1997-10-11 11:28:49 +00:00
augustss
d5ecfe9e6b Keep filter when setting source on SB Pro.
Close PR 2593.
1997-10-06 20:16:25 +00:00
augustss
25baf39689 Change the way we determine what interrupt routine to use to make
it work when drq8 == drq16.
1997-09-09 00:57:10 +00:00
augustss
e72ff15736 Substantial rewrite of the SB driver to make it do full duplex on an SB16.
Because of the braindead design of the SB the input and output have to
use different precisions (8 and 16 bits).  It is possible to set the driver
to use 8 bits on both and it will the emulate 8 bits on the output by
expanding it to 16 bits.
1997-08-29 21:41:36 +00:00
augustss
cd7e93c44d Add mute and channels swap to the mixer capabilites. 1997-08-24 23:50:40 +00:00
augustss
6616d47838 - 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.
1997-08-24 22:31:23 +00:00
augustss
f78dfdfe6e Avoid munging audio_defaults. 1997-08-19 23:35:44 +00:00
augustss
b99285b1e4 Round mixer values correctly when setting them.
This is important for the OSS emulation since OSS
uses a different range of values for the mixer.
1997-08-11 01:08:13 +00:00
augustss
c392128002 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.
1997-08-04 09:29:51 +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
augustss
a63034762b 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.
1997-07-28 20:56:05 +00:00
augustss
f6cd87f322 audio: Minor cleanup and enable looping DMA for PSS and PAS. 1997-07-28 01:31:50 +00:00
augustss
d58bc6796f audio: Simplify handling of AUDIO_SETFD and committing of encoding mode. 1997-07-27 23:51:48 +00:00
augustss
9745684ebe 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.
1997-07-27 01:16:32 +00:00
augustss
8727da130b In the name of backwards compatibility AUDIO_ENCODING_LINEAR has been
renamed AUDIO_ENCODING_SLINEAR and AUDIO_ENCODING_LINEAR reverts to the
NetBSD 1.2 sematics.  A kernel with COMPAT_12 defined will accept
AUDIO_ENCODING_LINEAR and treat it as before, without COMPAT_12 it
will be rejected.
1997-07-15 07:46:04 +00:00
augustss
86ad297c12 Fix a braino in record source selection and a pasto in detecting
16 bit mode recording.
1997-06-13 19:21:59 +00:00
thorpej
11e78a6b0d Pull thorpej-bus-dma branch into mainline. 1997-06-06 23:43:45 +00:00
jtk
1b429137ae make Jazz16 16-bit output work properly again. Still hangs somewhere
(not yet diagnosed) on occasion in high-speed mode, but a ^C will exit
immediately--no 30-second drainage timeout.
1997-05-29 04:57:02 +00:00
augustss
1bd32f9cad Add Alaw encoding emulation. 1997-05-28 00:07:46 +00:00