Commit Graph

136 Commits

Author SHA1 Message Date
augustss 54281b8662 Avoid spaces in tsleep() string. 1998-05-18 18:27:43 +00:00
augustss 88edb37522 Be more verbose if attaching the audio device fails. 1998-05-15 15:45:58 +00:00
augustss df71a424d6 Change debug printing a littel again. 1998-04-28 23:19:20 +00:00
augustss 127acabd9c Add a few more debug messages and clean up debug printing a little. 1998-04-28 09:07:12 +00:00
augustss 44c6ce78d2 Avoid the name free so the MALLOCLOG option works again.
Fix some typos.
1998-03-03 09:16:15 +00:00
thorpej 43ba4e27bd Adjust for config changes. 1998-01-12 08:44:08 +00:00
augustss a908b2b30e Fix three problems spotted by mycroft:
- Closing the audio device should stop recording.
- Manipulating the pause function could accidentally start playing or recording.
- AUDIO_FLUSH could accidentally start playing or recording.
1997-12-03 01:01:19 +00:00
augustss b366d54e2e Fix slight glitch in last commit when AUDIO_DEBUG is on. 1997-10-29 02:11:45 +00:00
augustss 9f84e63746 Do audio attachment the right way. From Chris Demetriou.
(Maybe I'll get the hang of the configuration stuff one of these days. :-)
1997-10-29 02:00:20 +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
is 25ea46120a TMS320AV110 (mpeg layer 2 decoder chip) and ZBUS Melody board, which uses it.
No optionboards yet for Melody, only audio driver.
MPEG data types for audio.c
1997-10-16 23:57:56 +00:00
augustss 31ab81c6e4 Aignore interrupts if the device isn't open. 1997-10-16 16:41:18 +00:00
augustss 0d79fbe5c5 Don't test for unused methods. 1997-10-14 18:43:42 +00:00
mycroft 3cdff9d435 GETPROPS does not indicate whether the device is currently in full-duplex
mode.  Reinstate GETFD to return this information.
1997-10-11 11:16:28 +00:00
augustss 4f2068ec29 Sanity check hi/lo water mark settings better. 1997-10-07 22:40:43 +00:00
augustss ffcdaf144d Move around splaudio() to (hopefully) get rid of some rare race conditions.
Add a missing call to round_blocksize.
Add some MIDI stuff that will be used in the future.
1997-09-06 01:14:48 +00:00
thorpej d2a9d1970d Don't deference a bad pointers if you try to open an audio device that's
not configured.
1997-08-27 18:54:28 +00:00
augustss 955e1e9119 Make sure audio device starts in half-duplex mode and document the fact. 1997-08-26 19:03:55 +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 332ad95e76 Change the MI audio driver so it attaches to the MD driver in the
normal way.  This requires adding a line to the config files to
get audio to work again.
1997-08-19 23:49:33 +00:00
augustss e5b75f05d4 Make a slight change to when blocksize, hi- and lo-water marks are
recalculated.  The new semantics is more intuitive(?) and makes Doom
work :-)
1997-08-18 23:20:09 +00:00
augustss 34085fae66 Implement /dev/audioctl. It behaves much like /dev/sound, but only
allows ioctl() and can be opened at any time.
1997-08-18 21:19:02 +00:00
augustss 8f096d087f Implement delivery of SIGIO on changes to /dev/mixer. 1997-08-11 01:38:12 +00:00
augustss 9a770a177f Make setting the audio block size sticky.
Change the calculated block size to correspond to 50 ms of sound
(was 20 ms, it seems needlessly small).
1997-08-08 00:03:26 +00:00
augustss 3c6f8bc89e Restructure a little to make sure AUDIO_FLUSH restarts the looping DMA. 1997-08-06 23:08:26 +00:00
fair aae99e192d %x -> 0x%x 1997-08-06 07:39:59 +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 3bef8402d3 Implement FIONBIO in audio_ioctl. 1997-08-01 17:04:00 +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 d5b1561c91 Temporary fix to make it compile on non-i386. 1997-07-28 09:28:04 +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 63decd9438 Fix divide by 0 bug in audio driver. 1997-07-27 23:06:04 +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 73ff4bd775 Allow more than one hardware driver to attach to the audio upper layer. 1997-05-27 23:24:56 +00:00
augustss 1fd29f4172 Make the audio default parameters into a globally accessible constant. 1997-05-20 12:51:43 +00:00
augustss d7a82223f4 Change lowater calculation a little.
Fix mixer setting bug and add some missing splaudio().
Set SB drq16 to 5 and don't pretend to be SB v1.0.
1997-05-17 23:26:33 +00:00
augustss 4b487c00bd Clean up audio_silence_copyout(). 1997-05-11 00:41:12 +00:00
jtk c7be49441e fix typo: LINEAR should have been ULINEAR 1997-05-10 19:01:53 +00:00
augustss e63a553175 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.
1997-05-09 22:16:27 +00:00
augustss c397fa8357 Return audio buffer size in audio_info_t with ioctl() AUDIO_GETINFO.
Use the buffer size to implement one more OSS ioctl().
1997-05-07 19:24:25 +00:00
augustss c4a52794f1 Convert to new orthogonal audio encoding scheme and implement
some of the new encodings.  The change to ioctl AUDIO_GETENC is
NOT backwards compatible.
1997-05-07 18:51:31 +00:00
kleink 269ccaa71b Fix typo in last commit; from Thorsten Frueauf <frueauf@ira.uka.de>
in PR/3566.
1997-05-01 12:27:10 +00:00
augustss 526ef2f618 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.
1997-04-29 21:01:33 +00:00
pk 231a4bfb1f Remove bogus pointer cast.
Accept FIONBIO ioctls.
1997-04-19 21:25:43 +00:00
mycroft 2c6048e49f Make sure to recalculate the block size after changing the
sampling rate.  Also, nuke the global variable audio_blocksize.
1997-03-20 16:13:55 +00:00
mycroft c1cc14fa25 Combine set_encoding and set_precision into a single set_format interface. 1997-03-20 06:48:48 +00:00
mycroft 8b4878a6ba Fill in silence-padded blocks so we don't get gaps. From PR 3357,
by Lennart Augustsson.
1997-03-20 03:19:53 +00:00
mycroft b0c4e068d0 Modify audio_fill_silence() to take an encoding number rather than a softc*
and mode.
1997-03-13 02:45:07 +00:00
mycroft ac3b8b13b7 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.
1997-03-13 02:19:32 +00:00
perry 1c47a4325b close 3079 from Jason Baker -- fixes a test in audio_poll 1997-01-18 04:02:58 +00:00
pk 39379f9a46 Reset `sc_async' on device close. 1996-11-01 23:05:45 +00:00
jtk aa8449a9ef fix compile errors & warnings 1996-10-16 01:12:18 +00:00
christos 86373f8cf9 backout kprintf changes 1996-10-13 01:37:04 +00:00
christos 5d85fa8122 printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:25:05 +00:00
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
mycroft e1ea13d92a Fix typo. 1996-09-01 23:54:53 +00:00
mycroft 664a66d009 Add mmap method for audio devices.
XXX This is just a placeholder to avoid updating conf.h again.
Also, clean up some error values.
1996-09-01 21:33:43 +00:00
mycroft 4abbd9427d Remove intr.h for now. This requires more work. 1996-05-13 02:26:15 +00:00
mycroft 682960c500 Use intr.h on alpha and i386. 1996-05-13 01:01:55 +00:00
christos 1e2c047be7 - Don't use dev_conf.h
- Remove unnecessary prototypes
- Fix ioctl arguments
- Don't use kprintf(...TO_LOG...); directly. This does not set the log
  priority, and uses priority of the previous message. Use log() with %:
1996-03-30 22:51:23 +00:00
mycroft 5c3bc6f120 Use %p as appropriate. 1996-03-29 00:11:42 +00:00
christos e023a87a11 Bring prototypes into scope. 1996-03-14 19:05:07 +00:00
christos d318abdbc4 prototypes for ccd audio and ncr5380 1996-03-07 15:00:07 +00:00
mycroft d1b5c90fd6 Check for errors while changing gain. 1996-02-20 11:47:22 +00:00
mycroft 5f732f379e Trivial (and probably not very good) implementation of SIGIO. 1996-02-20 10:00:31 +00:00
jtk 4f3fc10939 Fix PR#2060 (add AUDIO_PERROR ioctl to query # of playback drops), also
fix semantics of AUDIO_WERROR (now returns a count).

Also repair audio driver back to "real-time mode" where user must
provide data quickly enough for real time audio or silence is played
until user catches up.  Add optional "play all" mode (additional bit in
mode field) to play all samples provided, with silence when needed to
avoid buffer underrun.
1996-02-17 02:28:56 +00:00
mycroft 8ba7909bb4 Eliminate sc_silence, and handle output interrupts somewhat differently.
From John Kohl, slightly edited.
1996-02-16 02:25:43 +00:00
mycroft 47246947c7 Adjust the low and high watermarks. Based on a suggestion from Lennart
Augustsson.
1996-02-08 03:05:34 +00:00
scottr 186d69c204 Don't adjust the number of blocks in the ring buffer if the driver
is currently outputting silence.  Fix from Lennart Augustsson
<augustss@cs.chalmers.se>, closes PR #2010.
1996-02-05 21:11:10 +00:00
mycroft 0b6a86dfe5 Make the block size always a whole number of samples. 1996-01-07 06:21:02 +00:00
pk de0584fa25 Avoid zero blocksize (from David Huang; PR#1770). 1996-01-05 13:16:30 +00:00
cgd 13bf4371ae delete extra (blank) line in comment block 1995-11-24 23:45:40 +00:00
brezak 693043d786 GUS audio driver from John Kohl. 1995-07-19 19:58:09 +00:00
brezak 0589b5a222 Make mode a flag set. Full-dpulex fixes from John Kohl. 1995-07-07 01:52:30 +00:00
brezak cea924779e call hw->setfd with param not ptr to it 1995-06-04 15:33:50 +00:00
brezak c68110e043 Remove strings 1995-05-08 22:01:34 +00:00
brezak 2d93a58abd Don't call hardware close in mixer_close(). From Rolf Grossmann <grossman@informatik.tu-muenchen.de> 1995-05-08 17:42:07 +00:00
brezak f5675abf16 Set mixer type for rec and play level set. PR#1027 1995-05-08 16:06:38 +00:00
brezak 8951a20fe2 Auto-select open mode when opened half-duplex. From John Kohl. PR#1006 1995-05-05 22:36:14 +00:00
pk 30f71c550f A couple of fixes frm Rolf Grossmann. 1995-04-24 19:13:52 +00:00
mycroft fa37f29dc8 Make some functions non-static. 1995-04-17 23:04:31 +00:00
mycroft ff6c206c3f Use void* rather than caddr_t in many places. 1995-03-25 00:00:53 +00:00
brezak 1f5bdc75a9 New audio subsystem 1995-02-21 01:35:58 +00:00