Commit Graph

60 Commits

Author SHA1 Message Date
mycroft 2728fe0f3f Clean up. Attempt to make these safer against stray interrupts. 2004-07-09 02:42:45 +00:00
mycroft 921c2474ad There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.
2004-07-09 01:02:32 +00:00
kent 2adc11f1f3 remove/modify confusing error messsges. 2004-01-13 14:42:50 +00:00
soren 04fd7f9383 Only report codec readiness if DEBUG to avoid printing it on every resume. 2004-01-03 14:11:36 +00:00
kent a92ed9fb69 ICH4/ICH5:
When native i/o mapping fails, try compatible i/o mapping.
2003-12-28 12:31:30 +00:00
kent f9ae2a22c1 For ICH4/ICH5, use native BARs instead of compatible BARs.
The patch was provided by Lars Heidieker.
2003-11-22 08:49:41 +00:00
mycroft 2ef56c13e8 Force the codec into a known state before trying to determine its speed. 2003-11-06 07:13:33 +00:00
kent 26aa3703e4 auich_calibrate():
- make the buffer longer to improve the precision of measurement
 - round off the result to the nearest multiple of 1000.
2003-10-31 08:15:53 +00:00
kent c88bf03d33 For ICH4/ICH5, set IOSE flag to make them compatible to old ICHs. 2003-10-30 19:30:26 +00:00
mycroft c976b0b592 Eliminate bogus initializer (the code was technically wrong). 2003-10-28 22:56:19 +00:00
christos 125ccd91b1 Fix uninitialized variable warnings 2003-10-25 18:29:12 +00:00
kent cc9f31d5b2 auich_reset_codec:
wait for readiness of one of all codecs.
2003-10-24 04:06:44 +00:00
kent 5286b24afb Change the short names of nForce:
nForce-MCP -> nForce
 nForce-MCP-T -> nForce2
 nForce-MCP-T -> nForce3

Use snprintf() and strlcpy() instead of sprintf() and strcpy().
2003-10-23 17:14:54 +00:00
kent 3afd3b3671 - remove unused code
- print diagnostic messages if the primary codec does not get ready in
auich_reset_codec().
2003-10-23 17:05:26 +00:00
kent 27d4af4355 No need to check the codec ready flag in read_codec() and write_codec().
According to the ICH datasheets, the flag is unchanged unless resetting
the codec.

The flag is useless after enabling bus mastering.  This behavior is common
to all ICH chips.  The quirk handling code is removed.
2003-10-23 05:25:29 +00:00
manu 8beb6e32ae Patch from http://mail-index.netbsd.org/current-users/2003/09/04/0018.html
to fix problems with a sound card
2003-10-22 15:57:33 +00:00
fvdl ba07312903 Match the nForce3 AC-97 chip. 2003-10-22 11:32:12 +00:00
fvdl 5e8b006a17 Add missing field initializer. 2003-10-21 01:12:42 +00:00
mycroft aeeaf47b01 Cleanup:
* auich_calibrate() assumes that the AC97 part is in its reset state.  To
  ensure this, call audio_attach_mi() after auich_calibrate().
* Explicitly support 12000Hz and 24000Hz.  (Why is there a discrete list at
  all?)
* Fix an obvious recording bug -- we were acking the wrong interrupt.
* Ensure that we don't get an interrupt during the AC97 speed probe by clearing
  the "interrupt on completion" bit in the DMA setup.
2003-10-02 07:41:53 +00:00
kent 0eb86c3701 Support for 4ch/6ch audio playback. 2003-09-28 13:37:19 +00:00
erh a22558465d Add entry for Intel 82801EB AC-97 audio. Audio sounds fine with this,
although the mixer settings are a bit odd: outputs.master doesn't do anything,
but outputs.surround does.
2003-08-19 21:04:22 +00:00
kent 53af708049 Fix a regression of the last commit.
ICH4 needs IGNORE_CODEC_READY_MAYBE.
2003-06-13 07:27:17 +00:00
kent 93695b73fb Not only ICH4 but also ICH0 and ICH2 might set no ICH_PCR.
The patch was provided by lha.

PR: kern/21031
2003-06-13 05:13:42 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
thorpej b193480908 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.
2003-02-01 06:23:35 +00:00
thorpej 7ec10e2d99 Use aprint_*(). 2003-01-31 00:07:39 +00:00
kent e45b3e7121 Apply BUS_DMA_NOCACHE for the buffers in the case of 440MX. The
code was provided by DHOYASHIKI Shinichi in kern/19919, and
address kern/19435.
2003-01-28 02:09:34 +00:00
kent 19056063ce Add DIAGNOSTIC code provided in PR kern/19919 by DHOYASHIKI Shinichi. 2003-01-21 16:05:21 +00:00
gendalia e203560afd add support for nForce2 MCP-T 2003-01-16 01:00:06 +00:00
kent f22fb7c9b8 Fixed a problem that /dev/sound can not be opened in some cases.
auich_set_rate() modified audio_params::sample_rate to actual
sample rate though auich_set_params() rejected sample rates
other than some specific rates.  For example, setting 8000Hz
with auich_set_params() modified sample_rate to 7998Hz in the
case of overclocked AC97 codec, and calling auich_set_params()
again returned with EINVAL because sample_rate was 7998Hz and
auich_set_params() rejected 7998Hz.

For now, auich_set_params() never modify audio_params::sample_rate.
2003-01-15 04:49:35 +00:00
wiz 0db3e0b3d6 Fix typo in comment. 2002-10-12 19:45:54 +00:00
kent 3d86014c1c Kick auich_calibrate() by config_interrupts().
auichi_calibrate(): If the measured rate is less than 48k, use
48k.
2002-10-11 04:11:28 +00:00
kent d3307382f1 auich_set_params(): Don't return in the for loop. 2002-10-08 12:31:45 +00:00
kent 1adb5c1562 auich_softc:
Remove sc_fixed_rate and sc_ac97rate.  ac97_softc has such
information.

auich_attach():
Remove VRA/VRM enabling code.  ac97_attach() does it.

auich_set_rate():
Use ac97_codec_if::set_rate().

auich_get_props():
Return no AUDIO_PROP_MMAP if the codec is fixed-rate.

auichreg.h:
Remove unnecessary ICH_PM_*.
2002-10-08 10:25:45 +00:00
kent f06ae93219 Add some constant symbols for AC97 registers and values based on OpenBSD.
Rename some symbols to sync with OpenBSD:
	AC97_REG_EXTENDED_ID
	-> AC97_REG_EXT_AUDIO_ID
	AC97_REG_EXTENDED_STATUS
	-> AC97_REG_EXT_AUDIO_CTRL
	AC97_CODEC_DOES_VRA/AC97_ENAB_VRA
	-> AC97_EXT_AUDIO_VRA
	AC97_CODEC_DOES_MICVRA/AC97_ENAB_MICVRA
	-> AC97_EXT_AUDIO_VRM

ac97feature: "mic channel" -> "dedicated mic channel"
ac97_attach(): print extended capabilities; VRA, DRA, SPDIF, VRM, CDAC,
SDAC, LDAC.
2002-10-06 16:33:35 +00:00
kent 839ec5d8cb Improve nForce MCP support.
Submitted by: FUKAUMI Naoki <naoki at fukaumi dot org>
PR: kern/18524
2002-10-04 14:33:30 +00:00
kent c51dca5ba6 Remove a line added accidentally(?) at revision 1.21. 2002-10-02 17:08:10 +00:00
thorpej 9b2c2ec24d Add trailing ; to CFATTACH_DECL. 2002-10-02 16:50:59 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
dsainty 278bea1a2b Fix playback at 48kHz sample rate (integer overflow bug introduced in 1.18) 2002-08-28 10:51:03 +00:00
kent 4cb030f3b9 Fix division-by-zero when auich_set_params() is called before auich_calibrate(). 2002-08-16 11:22:13 +00:00
kent 3898bab95a - Port clock calibration code (auich_calibrate) from ich.c of FreeBSD to solve
kern/16373.
- SiS 7012 support from kern/17716 submitted by Quentin Garnier.
- ICH4 support
- Experimental support for nForce MCP, AMD768 and AMD8111.
- Rename the short name for ICH3: "i830M" -> "ICH3"
2002-08-07 10:31:09 +00:00
augustss 3f41adf3be When the DAC claims to support variable rate it doesn't seem to
always do this, so do some extra chechs and fall back on fixed rate.
2002-04-11 10:54:23 +00:00
kent a37082a494 whitespace and folding fix. 2002-03-23 17:17:10 +00:00
kent 4c9cd8bc91 Apply a patch by Mark Davies.
http://mail-index.netbsd.org/port-i386/2002/03/18/0000.html

Check codec status in auich_read/write_codec().
2002-03-21 09:17:20 +00:00
tacha 52d9a1d306 Use appropriate emulation functions and set ADC rate(not DAC date!) for recording.
Now /dev/audio with auich becomes usable.
2002-03-15 07:16:10 +00:00
kent 8574f78760 auich_set_params() sets 2 to hw_channels whenever monaural format is requested. 2002-03-10 16:48:58 +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 4cb7d87b12 Oops, I messed up the last commit, try again. 2002-02-14 12:52:01 +00:00