Commit Graph

161 Commits

Author SHA1 Message Date
Cameron Grant
67b1dce3bc many changes:
* add new channels to the end of the list so channels used in order of
addition

* de-globalise definition of struct snddev_info and provide accessor
functions where necessary.

* move the $FreeBSD$ tag in each .c file into a macro and allow the
/dev/sndstat handler to display these when set to maximum verbosity to aid
debugging.

* allow each device to register its own sndstat handler to reduce the amount
of groping sndstat must do in foreign structs.
2001-08-23 11:30:52 +00:00
Brian Feldman
bc0e6469ff Correct obviously wrong mistakes. 2001-07-02 23:47:23 +00:00
Brian Feldman
0cfa4761f7 Make all this compile on 4.3, modulus sbuf. 2001-07-02 15:27:28 +00:00
George C A Reid
733a4ea771 Use the M_ZERO flag to malloc(9)
Reviewed by:	cg
MFC after:	1 week
2001-06-21 19:45:59 +00:00
Peter Wemm
46700f1259 Use INTR_TYPE_AV for the interrupt handlers because:
1: most drivers are sensitive to timing, and
2: the handlers are MPSAFE and need a chance to get into the kernel
before some other non-mpsafe handler blocks the ithread on Giant in
shared irq cases.

Reviewed by:	cg  (in principle)
2001-06-16 22:59:46 +00:00
Cameron Grant
d95502a838 use a global devclass for all drivers - i'm not entirely sure why this
worked before.

mixer, dsp and sndstat are seperate devices - give them their own cdevsws
instead of demuxing requests sent to a single cdevsw.

use the si_drv1/si_drv2 fields in dev_t structures for holding information
specific to an open instance of mixer/dsp.

nuke /dev/{dsp,dspW,audio}[0-9]* links - this functionality is now provided
using cloning.

various locking fixes.
2001-06-16 21:25:10 +00:00
Joerg Wunsch
b794010414 Move out the files from src/sys/isa/ic/ to src/sys/dev/ic/, so they
can be made userland-visible as <dev/ic/...>.  Also, those files are
not supposed to contain any bus-specific details at all, so placing
them under .../isa/ has been a misnomer from the beginning.

The files in src/sys/dev/ic/ have been repo-copied from their old
location (this commit is a forced null commit there to record this
message).
2001-06-04 21:04:14 +00:00
George C A Reid
94d79d6dea Remove a bogus comment which I forgot to get rid of after testing 2001-05-15 20:05:19 +00:00
Seigo Tanimura
9d68b59376 - Eliminate locks in functions called only during probe and attach.
- Finish transmitting data to mpu when a buffer gets empty.

Submitted by:	KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
2001-05-08 12:15:26 +00:00
Cameron Grant
f72b6281c2 lock the mutex, not the softc pointer. 2001-04-10 13:52:26 +00:00
George C A Reid
9de0de1dd4 Reinitialise the DSP and mixer after a resume from suspend
PR:		22372
Submitted by:	Hiroyuki Aizu <aizu@jaist.ac.jp>
Reviewed by:	cg
2001-04-08 23:02:06 +00:00
Seigo Tanimura
6c2b22e90e Again initialize a mutex well, then lock it.
PR:		kern/26188
Submitted by:	Jim Bloom <bloom@acm.org>
2001-04-03 05:15:58 +00:00
John Baldwin
0006681fe6 Switch from save/disable/restore_intr() to critical_enter/exit(). 2001-03-28 03:06:10 +00:00
Cameron Grant
26799605fc fix whitespace bogons 2001-03-25 21:43:24 +00:00
Cameron Grant
35910bd13e release resources if one of the speculative probes in opti_detect() fails,
otherwise resource_list_alloc panics when opti_detect tries its next probe.
2001-03-25 19:09:06 +00:00
Cameron Grant
4e5f69d4dd the softc is not a mutex, don't try to lock it.
Submitted by:		George Reid <greid@ukug.uk.freebsd.org>
2001-03-25 18:56:48 +00:00
Cameron Grant
66ef8af5b0 mega-commit.
this introduces a new buffering mechanism which results in dramatic
simplification of the channel manager.

as several structures have changed, we take the opportunity to move their
definitions into the source files where they are used, make them private and
de-typedef them.

the sound drivers are updated to use snd_setup_intr instead of
bus_setup_intr, and to comply with the de-typedefed structures.

the ac97, mixer and channel layers have been updated with finegrained
locking, as have some drivers- not all though.  the rest will follow soon.
2001-03-24 23:10:29 +00:00
Cameron Grant
64738af72b add support for opti924 and opti930 chips
both should work in non-pnp mode, the 924 should also work in its rather
braindead pnp mode- it will adopt port 0x530 unless given hints due to it
starting up in soundblaster mode and thus not requesting a valid mss port
address.

Submitted by:	George Reid <greid@ukug.uk.freebsd.org>
2001-03-24 00:22:01 +00:00
Cameron Grant
c6c3b893e5 destroy child devices on detach to prevent ever-increasing numbers of
pcm/midi devices trying to attach if the module is repeatedly loaded and
unloaded.
2001-03-17 16:04:25 +00:00
Cameron Grant
bd22a64c45 fix a typo preventing the second dma channel being released
use isa_dma_release when releasing dma channels
2001-03-16 21:04:14 +00:00
Seigo Tanimura
5ddde3e6fd - Do not touch the Giant.
Requested by:	jhb

- Initialize a mutex prior to locking it.

Spotted by:	dcs
2001-03-14 07:29:47 +00:00
Cameron Grant
86c1b69bbb increase timeouts for ad_wait_init() 2001-03-05 17:59:36 +00:00
Cameron Grant
1b0dabf0c0 Add speaker volume adjusting support
Submitted by:	Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
PR:		i386/21452
2001-02-27 12:44:31 +00:00
Seigo Tanimura
87a636ccb0 - Mutexify midi(4). The driver runs under the giant lock by default.
If you ever want to run midi(4) out of the giant lock, uncomment
MIDI_OUTOFGIANT in midi.h. Confirmed to work for csamidi with WITNESS
and INVARIANTS.

- midi_info, midi_open and seq_info are now tailqs, allowing arbitrary
numbers of devices to be configured.

- Do not send an active sensing message to reset midi modules.

- Clone /dev/sequencer*. /dev/sequencer0 and /dev/sequencer are generated
upon initialization.
2001-02-26 07:36:24 +00:00
Seigo Tanimura
941afeb22d Encapselate midi_info, nmidi and nsynth into midi.c. 2001-02-18 15:58:56 +00:00
Cameron Grant
d60a6a8e0c quieten the esscontrol device 2001-02-02 16:41:06 +00:00
John Baldwin
399fde35e8 Tag unused functions with __unused. 2001-01-23 22:18:41 +00:00
Warner Losh
94648ce60d Add the ES1681, as found in my Digital HiNote UltraII. It works with
the ES18xx DSP code and is now my MP3 juke box engine.

Reviewed by:	cg
2001-01-04 17:12:57 +00:00
Cameron Grant
826737698c change irq handler slightly, get rid of superflous messages 2000-12-27 04:04:36 +00:00
Cameron Grant
350a5fafb1 update code dealing with snd_dbuf objects to do so using a functional interface
modify chn_setblocksize() to pick a default soft-blocksize appropriate to the
sample rate and format in use.  it will aim for a power of two size small
enough to generate block sizes of at most 20ms.  it will also set the
hard-blocksize taking into account rate/format conversions in use.

update drivers to implement setblocksize  correctly:
updated, tested: 	sb16, emu10k1, maestro, solo
updated, untested: 	ad1816, ess, mss, sb8, csa
not updated: 		ds1, es137x, fm801, neomagic, t4dwave, via82c686

i lack hardware to test: ad1816, csa, fm801, neomagic
others will be updated/tested in the next few days.
2000-12-23 03:16:13 +00:00
Cameron Grant
0f55ac6c1a kobjify.
this gives us several benefits, including:

* easier extensibility- new optional methods can be added to
  ac97/mixer/channel classes without having to fixup every driver.

* forward compatibility for drivers, provided no new mandatory methods are
  added.
2000-12-18 01:36:41 +00:00
Cameron Grant
ab3978871b adjust dma channels for vibra16x; recording should now work. full duplex does
not work on vibra16x, so is disabled.
2000-11-07 00:38:59 +00:00
Cameron Grant
e258e032ac fix paste-o in mixer code - actually set right channel volume instead of
doing the left channel twice.
2000-11-06 02:47:43 +00:00
Cameron Grant
b15e2b4bee kill old sb driver 2000-11-01 00:56:52 +00:00
Cameron Grant
eadd0f839e split up sb16 and sb/sbpro drivers
we do not support sb versions <2.00, and the sb8 driver has not been tested
yet.

these drivers are not yet enabled by default.
2000-10-28 19:20:03 +00:00
Cameron Grant
9ec437a334 add reinit functions to mixers
unstaticize chn_start()
add reset/resetdone functions to channels
2000-10-26 20:46:58 +00:00
Cameron Grant
badd7dc127 do not attach to soundblaster 1.x - they are unsupported 2000-10-26 20:31:16 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Maxim Sobolev
6e3c38712b Reduce buffer size from 64K to 4K.
Approved by:	cg
2000-10-09 14:54:32 +00:00
Cameron Grant
306f91b60b detach support
remove un-needed setdir functions
add bus_teardown_intr calls where necessary
destroy our dma tags where necessary
destroy ac97 before releasing resources
2000-09-09 19:21:04 +00:00
Poul-Henning Kamp
db90128160 Avoid the modules madness I inadvertently introduced by making the
cloning infrastructure standard in kern_conf.  Modules are now
the same with or without devfs support.

If you need to detect if devfs is present, in modules or elsewhere,
check the integer variable "devfs_present".

This happily removes an ugly hack from kern/vfs_conf.c.

This forces a rename of the eventhandler and the standard clone
helper function.

Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include
like <sys/queue.h>

Remove all #includes of opt_devfs.h they no longer matter.
2000-09-02 19:17:34 +00:00
Cameron Grant
33dbf14a17 change mixer api slightly
change channel interface - kobj implementation coming soonish
make pcm_makelinks not panic if modular
add pcm_unregister()

these changes support newpcm kld unloading, but this is only implemented
by ds1.c
2000-09-01 20:09:24 +00:00
Cameron Grant
513693be6c rework feeder sytem to allow feeders in klds
modify driver capability reporting format to list every audio format
seperately- required for above and because we could not previously indicate
that mono was unsupported.

there should be no functional impact.
2000-08-20 22:18:56 +00:00
Cameron Grant
becc0678b7 Recognize ESS 1888 in Dell Latitude XPi
PR:		kern/18714
Submitted by:	Sean O'Connell <sean@stat.Duke.EDU>
2000-08-19 18:17:15 +00:00
Cameron Grant
5151584d21 add suspend/resume for yamaha chips
Submitted by:	Ira L Cooper <ira@MIT.EDU>
2000-07-30 21:15:35 +00:00
Richard Seaman Jr.
307754cbe2 PR:19945
Reviewed by:tanimura
Fix boot panic introduced by newmidi code.
2000-07-18 20:18:16 +00:00
Seigo Tanimura
fb0ef52838 Finally merge newmidi.
(I had been busy for my own research activity until the last weekend)

Supported devices:

SB Midi Port			(sbc + midi)
SB OPL3				(sbc + midi)
16550 UART			(midi, needs a trick in your hint)
CS461x Midi Port		(csa + midi)

OSS-compatible sequencer	(seq)

Supported playing software:

playmidi			(We definitely need more)

Notes:

/dev/midistat now reports installed midi drivers. /dev/sndstat reports
only pcm drivers. We need the new name(pcmstat?).

EMU8000(SB AWE) does not sound yet but does get probed so that the OPL3
synth on an AWE card works.

TODO:

MSS/PCI bridge drivers
Midi-tty interface to support general serial devices
Modules
2000-07-11 11:49:33 +00:00
Cameron Grant
f314f3dad2 add module metadata. this is a hack, sound drivers will eventually present a
bus to which pcm, mixer, etc will attach.
2000-07-03 20:52:27 +00:00
Brian Somers
a54185c7ba Add (another) PnP entry for the ESS ES1869 (Compaq OEM)
Submitted by:	mdharnois@home.com
PR:		19206
2000-06-12 09:09:37 +00:00
Peter Wemm
a99bef94ed Untangle some #include between gusc.c/mss.c - gusc.c could create
an attachment node for something that may not have been compiled in.
2000-06-10 07:20:54 +00:00