Commit Graph

201 Commits

Author SHA1 Message Date
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
Peter Wemm
cb73359d42 Unused include: #include "sbc.h" 2000-06-10 07:17:29 +00:00
Jun Kuriyama
81c0587fa1 Add more ESS1869 PnP Sound Card PnPid.
Submitted by:	MIHIRA Yoshiro
PR:		kern/17349
2000-05-29 07:43:51 +00:00
Cameron Grant
35f9e4a1db handle emulated dma reads
don't try to get sample size from snd_dbuf
2000-05-26 21:15:47 +00:00
Yoshihiro Takahashi
7c14268dbd Supported the mss on PC-98 and Sound Blaster 98.
Submitted by:	"T.Yamaoka" <taka@windows.squares.net>
2000-05-19 15:41:52 +00:00
Cameron Grant
942aeab734 fix a speed bug that nobody noticed 2000-05-15 02:10:27 +00:00
Cameron Grant
f23598ec2c maybe make cmi8330 work - no feedback yet
implement bass/treble for yamaha opl-sax chips
2000-04-23 17:57:35 +00:00
Cameron Grant
674c45bd04 make drivers start at beginning of buffer when triggered - improves mmap.
not all tested.

not sure about aureal.c or csapcm.c
2000-04-17 16:57:12 +00:00
Cameron Grant
0a3eb835c2 bump the buffer size from 4k to 16k. should improve performance under load. 2000-04-01 21:28:09 +00:00
Cameron Grant
57376530f0 split up ess and sb code
rewrite ess mixer to use native registers
rewrite play/rec code to use more accurate timer when available
add code to use audio2 for playback, but disable it as no irqs are generated
2000-03-28 18:31:01 +00:00
Cameron Grant
87374c3d7a toast warnings on i386 2000-03-20 15:50:08 +00:00
Cameron Grant
3252a47be9 make als120 cards which report dsp version 3.x whilst only supporting 4.x
and *not* 3.x commands work
2000-03-20 15:34:27 +00:00
Poul-Henning Kamp
d8b47cbb70 Stop isadma from abusing the B_READ, B_RAW and B_WRITE flags.
Define ISADMA_{READ,WRITE,RAW} macros with the same numeric
values as the B_{READ,WRITE,RAW} and use them instead throughout.
2000-03-13 10:19:32 +00:00
Seigo Tanimura
ca6da1de5e Add the logical ID of Avance Logic ALS100. The vendor ID is also
checked, which was introduced in 1.18.

PR:		kern/16487
Submitted by:	Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
Approved by:	jkh
2000-03-09 02:13:21 +00:00
Cameron Grant
1a7d73a130 Partial fix: the following patch correctly configures the card for dual
channel DMA. The problem was that the SDC bit (0x04) can only be set in
the MCE state.

PR:		kern/16587
Submitted by:	Matthew Reimer <mreimer@vpop.net>
Approved by:	jkh (in person)
2000-03-05 15:51:09 +00:00
Cameron Grant
73bd6f4aab fix ess end-of-buffer repeating
Submitted by:	nhibma
Approved by:	jkh
2000-02-14 23:37:02 +00:00
Cameron Grant
a05382d9ae differentiate cmi8330 and als100 pnp cards based on their vendor id. this
is a kludge for 4.0
2000-01-29 00:18:29 +00:00
Andrew Gallatin
de6d75328e Add support for detection of the ESS 1688 found on my Dell Latitude LM 2000-01-28 04:28:11 +00:00
Peter Wemm
a3a2b1e1b2 Note the PnP id's for the NMX2210 next to the id's where they are used.
The pnpbios doesn't supply a description in the case we've seen so
supply one.
2000-01-23 13:17:03 +00:00
Cameron Grant
724efc44ec attach to non-ac97 neomagic chips and hope that ac97 ones do not have the
same pnpbios id
2000-01-13 06:11:32 +00:00
Daniel Eischen
d404cb51ee Add support for detection of the ESS 1878 chip. 2000-01-12 11:16:23 +00:00
Cameron Grant
9090c22ce7 general tidyup 2000-01-10 03:22:28 +00:00
Cameron Grant
2abc85f0c0 argh, forgot the bus_dma_tag_creates.
also, panic if channel init fails instead of derefing null.
2000-01-05 04:01:34 +00:00
Cameron Grant
9d1671b8c2 allocate isa bounce buffers of the right size for ess/mss cards, fixes
panics reported
2000-01-05 00:39:20 +00:00
Cameron Grant
43607766d6 revert buffer size to 64k 2000-01-01 21:50:20 +00:00
Peter Wemm
32ef0d3eb6 Attach the CS4610 PCI / CS4239 setup in isa compatability mode as CSC0100.
The PCI component is non-AC97 apparently.

PR:		15632
Submitted by:	gibbs
1999-12-30 20:04:11 +00:00
Cameron Grant
69cbc772d9 make ess cards use a 64k buffer again, by implementing esschan_init() 1999-12-30 04:04:43 +00:00
Cameron Grant
a0b57fb738 - latest 2ndbuffer patch
- make chn_setdir work for rec on isa cards
- note: es1371 does not irq in smp

Submitted by:	tanimura
1999-12-29 03:46:54 +00:00
Peter Wemm
7c361b70c5 Fix a mistake in the PNP EISA-encoding of the Avance ALS120 id.
Submitted by:	Bryan Liesner <bleez@netaxs.com>
1999-12-26 10:51:47 +00:00
Doug Rabson
7e864cbf08 Don't pass u_int32_t pointers to BUS_READ_IVAR since it tends to make
alphas panic.
1999-12-24 16:22:45 +00:00
Peter Wemm
2996751a32 Collapse a bunch of unused MD_CS42nn tags into a single one. This saves
going to a lot of trouble to identify it and set the tag and then not use
it.  Convert the pnp id matching to the preferred table based system.
@@@0001 (CMI8330 ldn 0) is a mss, not a SB.
1999-12-21 14:09:19 +00:00
Peter Wemm
93111ff410 Tidy up a few loose ends, including adding the pnp tags in comments.
Remove @@@0001 - it's an MSS, not a SB, at least according to the
original pre-sbc code and according to a pnpinfo report that Cameron has.
1999-12-21 14:04:14 +00:00
Peter Wemm
e9feccdcb4 Remove #if NISA > 0 - this is best done by the configuration process.
It had a heap of unreferenced stuff if there was no isa configured in the
system.
1999-12-21 13:55:46 +00:00
Cameron Grant
9035ec00a0 minor cleanup
Parts Submitted by:	Ville-Pertti Keinonen <will@ztango.com>
1999-12-21 08:43:28 +00:00
Cameron Grant
637e117737 don't use the sbpro mic vol register during init on ess cards; it causes
feedback and we use the native one elsewhere.
1999-12-21 06:18:03 +00:00
Cameron Grant
a451ce1dad minor cosmetics 1999-12-20 14:57:46 +00:00
Cameron Grant
71f78e06c6 make marcel's onboard ess1888 work
Submitted by:	marcel
1999-12-20 14:55:56 +00:00
Cameron Grant
34c18c4fc5 note to self: vibra16c is not vibra16x 1999-12-19 22:28:31 +00:00
Cameron Grant
ff00068cce fix for ess cards to use auto-init dma mode, so they work 1999-12-19 22:25:26 +00:00
Cameron Grant
09eb10434a remove unused mixer stuff 1999-12-19 18:18:55 +00:00
Cameron Grant
5c9abff13d fix a bug in sndstat output, tidy up a few bits 1999-12-19 15:07:56 +00:00
Cameron Grant
df74837fd9 generalise the code a bit, and add an irq handler so that the child devices
can share the irq
1999-12-19 14:44:08 +00:00
Cameron Grant
71dde75288 remove the restriction limiting the vibra16x to 8 bit
Noticed By:	Clive Lin <clive@CirX.ORG>
1999-12-19 14:21:38 +00:00
Cameron Grant
e53ad03a80 make vibra16x cards announce what they are in /dev/sndstat 1999-12-18 22:47:23 +00:00
Cameron Grant
354398891a make the vibra16x work for playback at least, record is untested 1999-12-18 22:21:47 +00:00
Seigo Tanimura
cf4f3dda81 Correct the logical ID of Avance Asound 110.
Submitted by:	Bryan Liesner <bleez@netaxs.com>
1999-12-18 12:17:02 +00:00
Cameron Grant
d4a72b067c make sb dependant on sbc
add support for non-pnp cards to sbc
move card identification to sbc
channel-swapping code is in sb now instead of dsp
vibra16x support is still broken, but will be fixed soon

note: sbc is now compulsory for sb cards

for pnp cards use:
device sbc0

for non-pnp cards eg:
device sbc0 at isa? port 0x240 irq 5 drq 3 flags 0x15
(hints as oldpcm)

both in addition to:
device pcm0

Reviewed by:	tanimura,dfr
Said he liked it: peter
1999-12-12 02:30:19 +00:00
Bill Fumerola
953fbebedd Reckognize the 'Avance Asound 100'
Submitted by:	Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
1999-12-07 01:53:24 +00:00
Peter Wemm
c2af6f650c Update for pnp adjustments regarding NPNP.
Also, optimize out a mess of #if's that were duplicating work already
done by config(8).  For example, if a file is marked as
"dev/sound/pci/foo.c optional pcm pci" then it's only added if pcm *and*
pci are present, so #if NPCM > 0 and #if NPCI > 0 are totally redundant.
A bit more work is still needed.

Discussed with: cg (a few weeks ago)
1999-12-06 18:26:33 +00:00
Cameron Grant
2ff5c01e98 conditionalise some warning messages
Submitted by:	Vladimir N.Silyaev <vns@delta.odessa.ua>
1999-12-05 20:25:29 +00:00
Seigo Tanimura
777b4568dd Add the logical ID of ViBRA16CL PNP on Micron Millenium II motherboards.
PR:		kern/15243
Submitted by:	Steven G. Kargl <kargl@troutmask.apl.washington.edu>
1999-12-04 10:13:17 +00:00
Seigo Tanimura
2efb116afa Call ISA_PNP_PROBE() to probe PnP cards, rather than match
the vendor and logical IDs directly.

Submitted by:	peter
Tested by:	Timo Geusch <freebsd@timog.prestel.co.uk>
1999-12-04 09:51:24 +00:00
Matthew N. Dodd
fe0d408987 Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered().  'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t.  Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything.  I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by:	peter, dfr
1999-12-03 08:41:24 +00:00
Doug Rabson
eab0f2ce01 Add ESS1879.
Submitted by: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
1999-11-30 09:11:06 +00:00
Doug Rabson
3dbbf1f548 Disable on x86 since it conflicts with PNPBIOS. 1999-11-27 17:03:08 +00:00
Seigo Tanimura
e61280105e Add another vendor ID(CTL0048) for SB32 PnP.
Submitted by:	Charles Anderson <caa@columbus.rr.com>
1999-11-27 06:33:27 +00:00
Daniel C. Sobral
1b6ef0a40c Add id for ESS 1869 OEM to Compaq on Presario 1621. 1999-11-26 18:58:03 +00:00
Seigo Tanimura
5d6784867c Attach the resources as given in the configuration in a proper way
for non-PnP cards.

Noticed by:	Pascal Hofstee <daeron@shadowmere.student.utwente.nl>
1999-11-25 01:13:52 +00:00
Cameron Grant
29618c3ae2 fix mixer to return properly scaled values 1999-11-22 16:20:48 +00:00
Seigo Tanimura
fe1a5d1c2f - Introduce the bridge drivers for Sound Blaser, GUS and Crystal
Semiconductor CS461x/428x.
- Add support for GUS and CS461x/428x pcm.

Bridges reviewed by:			dfr, cg
GUS non-PnP support submitted by:	Ville-Pertti Keinonen <will@iki.fi>
GUS PnP support tested by:		Michiru Saito <mich@mtci.ne.jp>
1999-11-22 06:07:49 +00:00
Cameron Grant
e479a8af2a fix for -fno-builtin
PR:		kern/14278
1999-11-21 17:15:12 +00:00