Commit Graph

511 Commits

Author SHA1 Message Date
orion
98cc9db9b5 Change ich_calibrate to busy wait on buffer fill level and use a more
likely looking rate calculation.

Install interrupt handler before calling ich_init as the initialization
occasionally generates spurious interrupts.

These changes are derived from cg's work in progress version of this
driver.
2002-01-18 18:44:41 +00:00
tanimura
c7b71266e6 Add the system default timer engine. 2002-01-04 01:16:18 +00:00
tanimura
c9a37a6cea - Provide toggles to show debug messages. Set new sysctl variables
hw.midi.debug and hw.midi.seq.debug to 1 to enable debug log.

- Make debug messages human-frendly.

- Implement /dev/music.

- Add a timer engine required by /dev/music.

- Fix nonblocking I/O.

- Fix the numbering of midi and synth devices.
2002-01-04 01:13:49 +00:00
tanimura
a46d1d7f89 - Do not uiomove with a mutex locked.
- Move from msleep/wakeup to condvar.

- Return either zero or a positive errno value from a function.
  Return additional result via references.

- Unify the typedef of callback functions.
2002-01-01 17:36:26 +00:00
cg
00857bfbaf make mmapped vchans work 2001-12-23 13:10:29 +00:00
pb
3d484db474 Fixes apparent hang at probe time due to an extremely long timeout
(experienced with an Opti931/ISA PnP card).

Approved by:	cg
2001-12-21 23:26:55 +00:00
cg
84081fd046 fix mmapped playback
remove dead debugging code
2001-12-21 22:34:01 +00:00
orion
748fd60224 Save and restore state for suspend/resume.
PR:		kern/28692
Obtained from:	SAKIYAMA Nobuo <sakichan@sakichan.org>
2001-12-21 19:20:28 +00:00
orion
3e097bafba Correct unexpected interrupt detection. 2001-12-19 18:26:53 +00:00
orion
3d7b11bb97 Nitlets. 2001-12-19 18:04:04 +00:00
orion
308c6566ff Clear resume interrupts - these can occur during initialization and
must be cleared to prevent machine hanging (presently aflicts -current
and -stable).

Problem reported by Bruce Montague <brucem@cse.iitkgp.ernet.in>

PR:		kern/29769 (probably)
2001-12-19 17:38:38 +00:00
orion
96b6116d6e Add calibration test to determine extent of AC97 overclocking (if any). 2001-12-18 03:29:31 +00:00
jhb
a3b98398cb Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_
  prefix.
- MI wrapper functions critical_enter/exit maintain a per-thread nesting
  count and a per-thread critical section saved state set when entering
  a critical section while at nesting level 0 and restored when exiting
  to nesting level 0.  This moves the saved state out of spin mutexes so
  that interlocking spin mutexes works properly.
- Most low-level MD code that used critical_enter/exit now use
  cpu_critical_enter/exit.  MI code such as device drivers and spin
  mutexes use the MI wrappers.  Note that since the MI wrappers store
  the state in the current thread, they do not have any return values or
  arguments.
- mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is
  assigned to curthread->td_savecrit during fork_exit().

Tested on:	i386, alpha
2001-12-18 00:27:18 +00:00
orion
9b9b8305c7 Added a sysctl control variable "ac97rate" to allow manual tuning of
the link rate - some ich motherboards overclock ac97 out of the box.

Will hopefully replace this with a callibration loop in time for 4.5R
freeze.

Problem reported by Luigi Rizzo and fix derived from his code (put
diff in ich.c rather than ac97.c).

MFC after:	3 days
2001-12-17 01:57:42 +00:00
orion
1ce1fbf5b8 Addition of sysctl variable to enable spdif. By default spdif is disabled.
MFC after:	3 days
2001-12-17 01:39:36 +00:00
guido
aebaef0c19 Get rid of irritating (bogus) message:
pcm0: ac97 codec failed to reset extended mode (0, got 80)
This was due to not masking off the correct extended function bits
in the read value from the extended status reg.

MFC after:	2 days
2001-12-10 20:27:18 +00:00
obrien
7fd9a6a23a Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
guido
19c1d909f1 Fix resume for HP Omnibook 500's.
MFC after:	1 week
2001-12-05 10:36:32 +00:00
iwasaki
560d91adcd Add suspend/resume support.
MFC after:	1 week
2001-11-24 18:00:33 +00:00
orion
9c629e4ed0 Fix typo introduced with last commit. 2001-11-22 23:38:26 +00:00
orion
724cc16dd3 Correct extmode initialization.
MFC after:	3
2001-11-21 04:26:04 +00:00
orion
2bfeee833a Emit a warning if invalid mode passed to ac97_setextmode.
MFC after:	3 days
2001-11-21 04:08:10 +00:00
orion
dc35e47b82 Set extmode according to extcaps. Fixes codec sample rate failures
that causes noisy playback with rates other than 48k (reported by
Olexander Kunytsa).

MFC after:	3 days
2001-11-21 04:06:52 +00:00
asmodai
fa6dc65332 Remove clkrun_hack for ThinkPad 570.
PR:		28031
Submitted by:	Tan Koan-Sin <freedom@csie.nctu.edu.tw>
MFC after:	2 weeks
2001-11-15 18:51:08 +00:00
tanimura
abb3f5c7b4 Avoid crash of minor numbers between /dev/midistat and /dev/dspr*. 2001-11-03 12:47:19 +00:00
peter
4f5eb2c0c5 Add Id for 82801CA (ICH3?). The ich driver seems to work fine on the
laptop that had it.
2001-11-03 05:07:59 +00:00
jhb
db5d9e122b Change the module name from 'snd_sonicvibes' to 'snd_vibes' as that is
the filename (thus the "old" module name) and the name used by
snd_driver.ko.
2001-10-24 21:44:07 +00:00
jhb
92be3d689f Change module name from 'snd_als' to 'snd_als4000' to match name in
snd_driver.ko.
2001-10-24 21:42:06 +00:00
jhb
c93ab06452 Change the module name from 'via' to 'snd_via82c686' to match the KLD
filename and in snd_driver.ko.
2001-10-24 21:38:08 +00:00
jhb
dc2dd8ef90 Change the module name from 'snd_cmipci' to 'snd_cmi' to match the
filename, module name in the loader, the dependency in snd_driver.ko, and
to be consistent with other sound drivers.
2001-10-24 21:35:31 +00:00
cg
65134543aa fix SNDCTL_DSP_GETISPACE behaviour 2001-10-24 12:40:54 +00:00
cg
92b4270436 improve recording behaviour 2001-10-24 12:33:21 +00:00
imp
4d6173a55f These two used sioreg.h as well. This is mildly bogus, but it is harder
to fix right in a hurry.

This (almost) fixes LINT.

Submitted by:	bde
2001-10-22 15:59:49 +00:00
scottl
9eb9a2e7aa Turn on the hardware volume buttons that are present on most laptops with
these chips.  There is a new hint, hint.pcm.N.hwvol_config, that can be set
to 1 or 0 to select which pins the buttons are connected to.  I'm open to
suggestions on where to document this.  Also bump the number of playback
channels up to 4.

MFC after:	3 days
2001-10-14 19:22:51 +00:00
orion
6923b3865d use pcm_getbuffersize() 2001-10-10 17:56:35 +00:00
scottl
c2316fb3b7 Update to using the pcm_getbuffersize() method.
Fix an off-by-one error in the saving of the dsp memory.
Up the play channels to 2.

MFC after:	3 days
2001-10-09 19:46:09 +00:00
cg
046dce9528 use pcm_getbuffersize()
only creat a mic recording channel if the codec supports it
2001-10-08 06:10:39 +00:00
cg
52fbddb20a use pcm_getbuffersize()
use seperate dma tags for buffers and control info
2001-10-08 06:01:13 +00:00
cg
2c46a9f5ab use pcm_getbuffersize() 2001-10-08 05:59:54 +00:00
cg
54bd95ef30 * register the correct number of channels
* include hw buffer size in sndstat info
2001-10-07 23:31:52 +00:00
cg
90f02c6299 use mixer channel numbers, not channel masks- this should fix sb/sbpro mixer
problems.
2001-10-07 23:28:34 +00:00
greid
a6cad80bb4 Add another pnpid for the AWE64
PR:		30909
Submitted by:	Kinji Itoh <kinji-i@gray.plala.or.jp>
MFC after:	7 days
2001-09-29 12:38:58 +00:00
cg
16faee5a1d release isa dma channels on unload. 2001-09-29 08:01:42 +00:00
cg
3113c29f95 allow the hardware buffer size to be controlled with hints
release isa dma channels on unload (ad1816, ess, sb8)
2001-09-29 07:57:07 +00:00
jhb
69b2d3f3db Use the passed in thread to selrecord() instead of curthread. 2001-09-21 22:46:54 +00:00
cg
b86875b944 when setting blocksize, fix blockcount to 2 to reduce latency with smaller
block sizes.
2001-09-18 15:19:44 +00:00
cg
30230e56a5 make buffer size adjustable. 2001-09-18 15:12:35 +00:00
cg
fb1faed56b don't enable the mic record channel unless the codec supports it.
allow hardware buffer size to be specified using hints.
2001-09-18 14:53:01 +00:00
cg
afd9c60fd0 change tracking of channel counts.
add method for retrieving "buffersize" hints for pcm devices, adjusted for
specified minimum, maximum and default values.
2001-09-18 14:50:52 +00:00
cg
89b447d520 add a tunable/sysctl, hw.snd.targetirqrate, to modify the default target
irq rate for apps that do not set a blocksize.
2001-09-18 14:45:09 +00:00