Commit Graph

491 Commits

Author SHA1 Message Date
cg
a7aa01b9b6 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
cg
38f9230afb add functions for sound drivers to use for locking and setting up interrupt
handlers.  these are not yet used, but will allow compatibility for driver
modules from 5.x to 4.x.
2001-02-27 07:45:09 +00:00
cg
e5b0fe79ae MFS: 4.x/5.x compatibility #ifdefs 2001-02-27 07:01:49 +00:00
cg
27c9f9bb29 MFS: 4.x/5.x compatibility #defines 2001-02-27 06:58:55 +00:00
tanimura
b098573911 - 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
tanimura
548e16646a Encapselate midi_info, nmidi and nsynth into midi.c. 2001-02-18 15:58:56 +00:00
nyan
40f4dcb8fc Don't assume bus_space_handle_t == the start address of resource.
Use rman_get_start() instead.
2001-02-16 13:29:41 +00:00
cg
11f0b5a538 add a format feeder for conversion from alaw to ulaw and vice versa.
Submitted by:   Orion Hodson <O.Hodson@cs.ucl.ac.uk>
2001-02-13 22:00:57 +00:00
cg
c467270698 make attempts to set unsupported speeds or formats non-sticky. this should
fix problems with apps that probe for a variety of settings.

Submitted by:	Orion Hodson <O.Hodson@cs.ucl.ac.uk>
2001-02-13 21:57:34 +00:00
cg
0c712ef560 add power management support.
Submitted by:	Orion Hodson <O.Hodson@cs.ucl.ac.uk>
2001-02-13 21:00:22 +00:00
cg
1cd44c5d5b back out rev 1.49, looks like i committed it from the wrong tree.
include the changes 1.49 was supposed to have.

Noticed by:	peter
2001-02-07 20:45:40 +00:00
cg
2b52ef3ebe conditionalize "hwptr went backwards" messages
modify default buffer size heuristic to not max out at 4k.  mpg123 should now
behave better under load.
2001-02-07 06:48:28 +00:00
cg
4ca1265524 add driver for CS4281 sound chips
Submitted by:   Orion Hodson <O.Hodson@cs.ucl.ac.uk>
2001-02-04 19:23:35 +00:00
cg
a1cdce5a42 add driver for CMedia CMI8338/CMI8738 sound chips
Submitted by:   Orion Hodson <O.Hodson@cs.ucl.ac.uk>
2001-02-04 19:13:40 +00:00
cg
b3fc288e1c quieten the esscontrol device 2001-02-02 16:41:06 +00:00
scottl
bc10e2d4b6 Driver for the ESS Maestro3 and Allegro sound chips. Note that due to the
amount of GPL'd firmware in the driver, it will only be built as a module.

Approved by:	cg
2001-02-01 20:29:16 +00:00
cg
2565bf6979 don't grope around inside snd_dbuf structures as they will change in future 2001-01-24 01:36:15 +00:00
cg
99127615ba fix certain cards failing to attach
Submitted by:	Russell Cattelan <cattelan@thebarn.com>
2001-01-24 01:27:31 +00:00
cg
456c0fc978 fix blocksizing for playback, implement blocksizing for record 2001-01-24 01:22:53 +00:00
cg
9de50bdcce some cosmetics, changed channel setup and revamped irq handling - ignore
repeated interrupts
2001-01-24 01:20:04 +00:00
cg
2cc907a0c7 prevent excessively small buffer sizes resulting in hundreds of irqs per
second
2001-01-24 01:15:50 +00:00
jhb
4799f0d266 Tag unused functions with __unused. 2001-01-23 22:18:41 +00:00
jhb
7ca7c002be Catch up to the name changes in the hwvol API. 2001-01-11 23:26:38 +00:00
jhb
15fe5fedcb - Move all of the hwvol functions into a mixer_hwvol_* namespace, and make
all of the hwvol members of struct snd_mixer live in a hwvol_* namespace.
- When changing the mixer device via the hwvol_mixer sysctl, reset the
  muted state so that a mute operation on a new device won't try to
  unmute the new device with the old device's saved volume.
- When the volume is muted, if a down or up volume request is received,
  first restore the saved volume level and then adjust it.

Reviewed by:	cg
2001-01-11 23:26:16 +00:00
jhb
0058a1591e Woops, use the SYSCTL_STATIC_CHILDREN() macro instead of manually
expanding it for _hw_snd.
2001-01-11 23:22:33 +00:00
jhb
60ec6a741a Call mixer_hwinit() when attaching. 2001-01-05 07:07:48 +00:00
jhb
a7d7562a91 - Make the 'hwvol_mixer' and 'hwvol_step' variables be specific to a
specific snd_mixer device rather than global across all mixers.
- Add per-mixer mute status and saved mute_level so that the mixer_hwmute()
  function can now toggle the mute state when the mute button is pressed.
- Create a dynamic sysctl tree hw.snd.pcmX when a pcm device is registered.
- Move the hw.snd.hwvol_* sysctl's to hw.snd.pcmX.hwvol_* so that they
  are now properly device-specific.  Eventually when the mixers become
  their own devices these sysctl's will move to live under a mixerX tree.
- Change the interface of the hwvol_mixer sysctl so that it reports the
  name of the current mixer device instead of the number and is settable
  with the name instead of the number.
- Add a new function mixer_hwinit() used to setup the dynamic sysctl's
  needed for the hwvol support that can be called by drivers that support
  hwvol.

Reviewed by:	cg
2001-01-05 07:07:03 +00:00
jhb
56f540e9eb The 'maxchans' count is one more than the number of channels, so
'chancount' never got up to equaling 'maxchans'.  As a result,
pcm_makelinks() was never called, and one always had to set the sysctl to
get the /dev/mixer and other symlinks generated in the DEVFS case.  Instead,
change the test in pcm_addchan() to call pcm_makelinks() after the first
channel is initialized, since the aliases are linked to channel 0.

Reviewed by:	cg
2001-01-04 23:49:00 +00:00
imp
5504e01ce2 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
jhb
59a7acdd4d Rename the loader tunable from hw.sndunit to hw.snd.unit.
Submitted by:	cg
2001-01-03 02:09:31 +00:00
jhb
9598ea3cc7 - When acknowledging interrupts, write the value 0xff to the interrupt
status register rather than 0.  Without this, a single hardware volume
  event triggers an interrupt storm.
- Implement hardware volume control for the Maestro chips.  This version
  only handles the case where both channels are adjusted at the same time.

Reviewed by:	cg
2001-01-03 01:32:57 +00:00
jhb
99e2a84a1f Add a new API for soundcards that have hardware volume control:
- The mixer_hwmute() function can be called when a soundcard receives a
  mute request.
- The mixer_hwstep() function can be used to adjust the volume of one or
  both channels.
- The 'hw.snd.hwvol_step' sysctl determines the amount that mixer_hwstep()
  adjusts the volume by on each call.
- The 'hw.snd.hwvol_mixer' sysctl specifies the mixer device to adjust the
  volume on for both functions.  The values used correspond to the
  SOUNDCARD_MIXER_* constants.
2001-01-03 01:29:47 +00:00
jhb
aa1bf8b0b3 Create a new sysctl node 'hw.snd' and move 'hw.sndunit' to
'hw.snd.unit'.

Reviewed by:	cg
2001-01-03 01:25:26 +00:00
cg
798d2297a8 change irq handler slightly, get rid of superflous messages 2000-12-27 04:04:36 +00:00
cg
1e51ad7c0a move parametric defines and structure definitions from .h to .c 2000-12-25 02:49:28 +00:00
cg
4b49e441f5 indent debugging printfs, change a couple of messages slightly 2000-12-25 02:21:16 +00:00
cg
7fb05e9c25 update to return correct blocksize- these chips have a fixed irq rate, so
block size varies only with format and rate.
2000-12-25 01:42:13 +00:00
cg
b4b1930100 fairly substantial rewrite- seperate out play/record code, implement
setblocksize, simplify resource allocation
2000-12-24 03:56:41 +00:00
cg
97cafaa0df compensate for broken codecs that return 0xffff on unimplemented registers
instead of 0.
2000-12-24 03:33:21 +00:00
cg
45ae398e8d implement setblocksize properly 2000-12-23 22:24:43 +00:00
cg
f87f7d8216 fix a panic if the requested blocksize was greater than the data rate,
resulting in a divide by 0.
2000-12-23 06:09:43 +00:00
cg
2807ccd53d kill a warning 2000-12-23 05:19:32 +00:00
cg
2386a8e31f fix a typo 2000-12-23 05:16:39 +00:00
cg
d0b795f25b 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
cg
ef90d6ebd3 fix a debugging leftover (min speed=48khz) 2000-12-20 05:21:17 +00:00
cg
2fae4aec24 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
julian
18434fa2a8 Bump the buffersize from 0x1000 to 0x4000.
0x1000 gets underflows on my dell 7500 whenever I moved the mouse.
(reported as "hwptr went backwards...", with jumpy sound)
Sounds great now....
2000-11-21 12:22:11 +00:00
cg
b7783e49d5 do not blindly assume 8khz is supported on open(). try for 8khz but respect
minspeed/maxspeed specified by the hw driver.

Submitted by:	Andrew Gordon <arg@arg1.demon.co.uk>
2000-11-18 03:43:04 +00:00
cg
307f173be5 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
cg
6b4272c663 slight mods to isa dma and channel flushing code 2000-11-07 00:32:35 +00:00
cg
f44d3f03ba if a channel dies, rejuvenate it on close() 2000-11-07 00:29:24 +00:00
cg
4e383ab4ca add AFMT_8BIT for easier determination of formats 2000-11-06 22:22:52 +00:00
cg
29f3115061 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
cg
152326a127 fix es1370 mixer by adding reinit function to it's mixer function list. 2000-11-06 02:37:28 +00:00
cg
28815ef0ae kill old sb driver 2000-11-01 00:56:52 +00:00
cg
a7f52826c1 switch over to new sb8/sb16 code 2000-11-01 00:53:16 +00:00
cg
0ecc67db2e add commented-out dependancies on the new sb8 and sb16 drivers 2000-10-28 19:35:54 +00:00
cg
ceaa4e2ae6 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
cg
53904fdeb6 implement SNDCTL_DSP_POST 2000-10-27 22:20:45 +00:00
phk
54ca48450c Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning.  The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by:   various.
Significant brucifications by:  bde
2000-10-27 11:45:49 +00:00
cg
f395b4d615 add reinit functions to mixers
unstaticize chn_start()
add reset/resetdone functions to channels
2000-10-26 20:46:58 +00:00
cg
d877bb8d5a do not attach to soundblaster 1.x - they are unsupported 2000-10-26 20:31:16 +00:00
cg
faddab638d handle AFMT_QUERY right 2000-10-26 01:34:54 +00:00
phk
beadbd4365 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
sobomax
e277d9ce66 Reduce buffer size from 64K to 4K.
Approved by:	cg
2000-10-09 14:54:32 +00:00
nsayer
f01a7783fc Add suspend/resume hooks.
Submitted by: sean@stat.duke.edu
2000-09-28 14:02:49 +00:00
cg
3e27c54902 prepare for adding a rate conversion feeder.
move format conversion feeders to feeder_fmt.c - no pertinent history so no
repo-copy.
2000-09-23 22:11:32 +00:00
cg
27a6dc9c5a only probe mandatory channels on known bad codecs 2000-09-23 22:00:09 +00:00
jhb
a307605d91 Enable the snd_maestro module and have the snd_driver module depend on it.
Approved by:	cg
2000-09-23 17:35:37 +00:00
tanimura
e368cca5cf Since the unit number of a midi/sequencer device is expressed in 4
bits, we can configure only up to 16 units.
2000-09-18 10:17:38 +00:00
cg
9bd1dd51e8 dynamify- probe codec for supported channels
add channel mappings for mixer
2000-09-17 23:51:00 +00:00
cg
2078d1f36c fix warnings 2000-09-17 23:46:32 +00:00
cg
cda24837e2 disable 16bit mono support- this will be handled by software conversion to
stereo as hardware mono is very noisy
2000-09-09 21:31:06 +00:00
cg
b5350bb3a5 add 16bit mono/stereo conversion feeder
prefer feeder chains of length 1 over length 2
2000-09-09 21:24:03 +00:00
cg
a081b436a3 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
cg
434a102504 ess maestro driver - not enabled by default
Submitted by:   Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
2000-09-06 20:10:55 +00:00
cg
4940b0a8a7 initial support for multiple ac97 codecs 2000-09-05 21:08:01 +00:00
cg
37e1644191 add detach support 2000-09-05 21:06:11 +00:00
cg
b878b7cbc6 allow a null setdir implementation 2000-09-05 21:00:45 +00:00
cg
55b00bdc52 be more verbose about failed unload attempts 2000-09-05 20:58:51 +00:00
cg
d76980428d tidy up a little, add a mask for 32bit formats 2000-09-05 20:56:31 +00:00
peter
fe3678e285 Fix warnings by moving static functions before they are used. 2000-09-03 05:32:09 +00:00
cg
31386ce34a update for phk's last devfs commit 2000-09-02 23:14:46 +00:00
phk
e47f61e183 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
cg
0ab175f21b add a missing return statement, doh. 2000-09-02 18:55:01 +00:00
cg
a6b7de97e3 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
cg
5c34b0eac7 remove stuff accidentally left in last commit 2000-08-29 20:53:56 +00:00
cg
0ee01daa5c suspend/resume for ds1 driver
PR:		misc/20891
Submitted by:	Ira L. Cooper <ira@mit.edu>
2000-08-29 20:50:42 +00:00
cg
ca84dc3f91 make the test for hwptr going backwards more picky- now it only triggers if
15/16 of the buffer is skipped or we go backwards by < 1/16 of buffer size.
2000-08-29 16:32:26 +00:00
cg
db66cff047 add devfs support. when devfs is enabled, sysctl hw.sndunit is used to set
which sound unit the /dev/{dsp,mixer,dspW,audio} links point at.  this can
also be set from the loader.
2000-08-29 16:21:33 +00:00
cg
6fbcea0a07 add driver for forte-media fm801
PR:             conf/20698
Submitted by:   dimmy the wild <diwil@dataart.com>
2000-08-29 16:12:28 +00:00
dfr
e2deb384a8 Fix disordered arguments to bus_space_barrier(). 2000-08-28 21:02:18 +00:00
cg
cc65486f22 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
cg
9bda127a3e fix SNDCTL_DSP_GETODELAY
PR:		kern/20340
Submitted by:	Takashi SHIRAI <shirai@nintendo.co.jp>
2000-08-19 18:29:46 +00:00
cg
91bc9d7f23 don't complain about bad irqs if using a shared irq 2000-08-19 18:22:20 +00:00
cg
048ff1b84d 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
nsayer
301ab84115 This patch appears to solve the problems with recording resulting
in bogus hwptr warnings. Further comments sought on -hackers
were not forthcoming. I can only hope that calling DELAY() like
this doesn't cause any heartburn.
2000-08-13 19:20:02 +00:00
nsayer
3073d41f6a Missed a step when activating the solo driver. 2000-08-09 20:28:19 +00:00
cg
ea1ade141f change irq handling slightly
add another non-ac97 256av
2000-08-09 18:51:27 +00:00
cg
02ab8f7294 MFS: module macro changes 2000-08-09 18:46:48 +00:00
nsayer
c1fe03bbd9 A couple of cosmetic fixes, plus a biggie: When checking the DMA
position, channel 1's dma position register must be quiescent. So
the driver will spl, pause the DMA, delay a bit and hold as still as
possible while snapping the picture.

I'm sure there HAS to be a better way to do this, but if there is, it's
not documented.

So far as I can tell, this fixes recording, which means the Solo is open
for business.
2000-08-09 07:14:56 +00:00
cg
ecc21b00b9 MFS: sync with peter's isadma fixup 2000-08-09 01:22:09 +00:00
cg
e5c56d96de activate via82c686 audio driver 2000-08-09 01:08:59 +00:00
cg
63dc0f7f4a new driver: via 82c686 chipset audio
not personally tested, but i'm assured it works

Submitted by:	David Jones <dej@ox.org>
PR:		kern/20161
2000-08-09 00:55:55 +00:00
cg
5d9a1c9f9c warn if hwptr goes backwards 2000-08-09 00:42:00 +00:00
cg
743aa0c1db fix the staticy sound issue
use timer instead of per-channel interrupts

do playback like the linux driver - may fix nmi-with-ecc issue
2000-08-06 18:10:05 +00:00
nsayer
b7b1206010 Simplex devices will always report EBUSY on 2nd (and subsequent)
opens if the reference count is not decremented on close.

Note that this may result in the reference count being corrupted
on full duplex devices (due to mismatching opens/closes), but the
code doesn't use the reference count for anything on full duplex
devices.
2000-08-02 22:47:44 +00:00
nsayer
5e1fccd0d6 1. Increase the size of the DMA buffer.
2. Offer half duplex with both playback and record on channel 1 or
full duplex with playback always on channel 2 as a compile-time option.

3. 16 bit record output is byte swapped for some dumb reason. Report the _BE
AFMTs for recording.
2000-08-02 22:45:57 +00:00
nsayer
f04eb97268 Undo some of my own damage. With this patch, it appears that both
recording and playback now work correctly.
2000-08-02 19:37:43 +00:00
nsayer
63383ff588 Fix channel 1 playback the rest of the way. There are a couple of
hiccups, but playback now proceeds mostly normally using both channel 1
and 2.
2000-08-02 15:09:39 +00:00
nsayer
f67558eb8f Get playback on channel 1 closer to working. 8 bit samples work.
16 bit samples have some sort of choppiness, the nature of which
is not completely clear, but it clearly has something to do with
dma buffer synchronization. But at least channel 1 makes noise now.
2000-08-02 08:01:00 +00:00
nsayer
a493e558f7 Fix channel 1, sort of. recording now generates IRQs and the output
appears to be the correct length, but quality of output has not yet
been tested. Also, full duplex audio (that is, playback on channel 1)
does not yet work. Two constants and I am there!

Obtained from:	major hints from ALSA
2000-08-02 06:36:55 +00:00
nsayer
2b61c92449 Reverse the sense of the signed/unsigned formatting bit.
This dramatically cleans up playback quality, at least with mxaudio.
2000-08-01 04:18:15 +00:00
cg
fb1049d339 almost-there ess solo-1 driver, committed so people can tell me why it
doesn't generate irqs.
2000-07-31 16:17:40 +00:00
cg
0c173f44b3 add suspend/resume for yamaha chips
Submitted by:	Ira L Cooper <ira@MIT.EDU>
2000-07-30 21:15:35 +00:00
cg
8bfb4dc90b fix a potential local DoS attack 2000-07-30 19:38:26 +00:00
cg
9446f7ff16 fix a bug where opening /dev/dsp twice resulted in it being busy until reboot 2000-07-30 19:36:13 +00:00
cg
24f340732c do the ac97 init delay for all chips and increase it to 500ms 2000-07-30 02:33:37 +00:00
cg
1107e981d0 make this file suitable for 4-stable as well as 5-current 2000-07-18 21:23:48 +00:00
dick
873fedbae4 PR:19945
Reviewed by:tanimura
Fix boot panic introduced by newmidi code.
2000-07-18 20:18:16 +00:00
tanimura
7716c5370a 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
cg
679ed1b54d do-nothing module that depends on all sound drivers 2000-07-03 21:00:44 +00:00
cg
809e9b3b6c 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
roberto
5cc49e5836 This is the patch to make my soundcard, a Creative Ensoniq AudioPCI (an
es1371 chip, device id 0x58801274 rev 0x02).

Submitted by:	Kenneth Wayne Culver <culverk@wam.umd.edu>
2000-07-02 14:17:41 +00:00
cg
cdd0f2dff3 add record channel irq timeouts too 2000-06-20 23:42:08 +00:00
cg
cc71ce279b fix a bug where opening for write would not fail if channel allocation failed
when playing, if we stall for 1s with no data advancing, abort and mark the
channel dead - fail all future operations
2000-06-20 23:27:12 +00:00
cg
e9eaaa68ef make mixer reads return the value written instead of the value set
people seem to want this even though it breaks oss spec compliance
2000-06-19 20:31:58 +00:00
cg
65a5eef02b replace a line erroneously removed in 1.28, should fix xmms
make buf_clear handle unaligned lengths
2000-06-17 19:29:40 +00:00
cg
a6f4815b7e add alpha-quality recording code and handle pci error interrupts - this may
prevent the card generating an nmi on ecc systems.  for now a message is
printed on every pci error and it seems every time we start playng we get one
2000-06-13 23:24:40 +00:00
cg
1c4f19e2d7 handle closing differently - should fix the end-of-sample cutoff bug 2000-06-13 23:18:43 +00:00
brian
9259507e31 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
df75627b6c 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
32d2bf7f38 Unused include: #include "sbc.h" 2000-06-10 07:17:29 +00:00
peter
26d9019aaf Unused includes: #include "pci.h", #include "pcm.h" 2000-06-10 07:15:15 +00:00
dan
1226423ba7 Increase delay from 10mu to 1000mu when reading play control size. This
allows the YMF744 to initialize properly.
2000-06-09 16:44:30 +00:00
cg
3b62c472a0 handle duplex properly in the AIOGCAP ioctl - this may (partially?) fix rat 2000-06-07 11:51:30 +00:00
cg
ac9632abb9 this driver does not support the cs4281 and probably never will, different code
will be required
2000-06-06 22:42:57 +00:00
cg
a8b0277ad1 support recording 2000-06-06 22:34:09 +00:00
cg
d22fc7d403 improve recording 2000-06-06 22:30:22 +00:00
cg
abb00fd380 don't panic if we try to add a channel we said we wouldn't 2000-06-06 22:24:53 +00:00
peter
bf702b6764 With this evil hack the DS1 driver works on our Intel desktop
motherboards that use YMF740's.  It has a strange subvendor and subdevice
ID and requires a disturbingly long delay after the ac97 codec init.
Cameron hasn't had this driver tested on another 740 yet, so we don't know
if this is a quirk of all 740's, or if its just something about the codec
that Intel used.
2000-06-01 03:58:27 +00:00
cg
ba367be739 if a device has no play or no record channels, set its simplex flag. 2000-06-01 01:32:30 +00:00
cg
76b331914e if we get bad values for playctrlsize, the firmware may not have initialised
yet so retry.
2000-06-01 01:29:05 +00:00
cg
31a7173f2e add a bit more diagnostic info for the bus_dmamap_load failure case 2000-05-31 19:04:12 +00:00
cg
b4335ed1f6 yamaha ds1/ds1e pci sound driver - work in progress, mixer and playback only.
tested on ymf724f only.

conf/files entry is commented out, enable it manually to test this code and
let me know results.
2000-05-31 03:21:36 +00:00
kuriyama
15890db665 Add more ESS1869 PnP Sound Card PnPid.
Submitted by:	MIHIRA Yoshiro
PR:		kern/17349
2000-05-29 07:43:51 +00:00
peter
b67ad017c0 Use the correct name for a mapping register, not the old FreeBSD 2.x
compatability name.
2000-05-28 15:15:14 +00:00
cg
2d78819395 fix the return value of the SOUND_PCM_WRITE_CHANNELS ioctl
re-enable old pcm ioctls
2000-05-27 14:40:17 +00:00
cg
fe693a0d08 move various fields from pcm_channel to snd_dbuf
improve chn_read code- don't stop/restart on overrun, just dump data

more error checking on ioctls
2000-05-26 21:55:13 +00:00
cg
437ef4fa6b if we have a codec init routine, fail the attach if init fails 2000-05-26 21:42:50 +00:00
cg
e7de7487d9 handle emulated dma reads
don't try to get sample size from snd_dbuf
2000-05-26 21:15:47 +00:00
jake
961b97d434 Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
jake
d93fbc9916 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
nyan
5921014a42 Oops, rman_get_bushandle() should be converted to rman_get_virtual()
if resources are mapped to memory.
2000-05-20 16:15:50 +00:00
nyan
61405e3c6a 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
cg
85a224d838 fix a speed bug that nobody noticed 2000-05-15 02:10:27 +00:00
phk
36c3965ff9 Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter
2000-05-05 09:59:14 +00:00
cg
05c83e1b4b fix the 100% cpu in xmms issue 2000-05-04 19:06:34 +00:00
phk
ce2aa22c93 Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00
cg
dc9d94db23 duh, i forgot to change a bitmask, sorry alexander
Submitted by:	Alexander Matey <matey@cis.ohio-state.edu>
2000-04-26 23:08:12 +00:00
cg
a036330123 fix minor numbers for multi-channel devices
Submitted by:	Alexander Matey <matey@cis.ohio-state.edu>
2000-04-26 20:06:52 +00:00
cg
31b2ee0458 repo-copied to sys/gnu/dev/sound/pci/emu10k1.h 2000-04-26 19:53:46 +00:00
cg
d392acef96 update for new location of emu10k1.h under sys/gnu 2000-04-26 19:51:19 +00:00
cg
ea94bdbf08 implement settrigger according to spec
fixes for non-blocking mode
2000-04-23 18:09:18 +00:00
cg
33a9f13a32 maybe make cmi8330 work - no feedback yet
implement bass/treble for yamaha opl-sax chips
2000-04-23 17:57:35 +00:00
cg
3b6430fd03 try the fix from creative bugzilla for nmi problem
Obtained from:	creative labs bugzilla
2000-04-18 19:11:38 +00:00
cg
57539462d6 more mmap fixes 2000-04-17 17:06:47 +00:00
cg
d3deb9312d 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
cg
6dcc92e9d3 make mmap sort-of work. there seem to be interactions with certain hw
drivers, so still work in progress.

do various mmap-related ioctls right.

improve blocksize control.

bits of cleanup.
2000-04-15 05:04:12 +00:00
cg
ce54393508 make poll() dtrt, previously when playing it would trigger if there was less
than 1 byte ready to play instead of room for at least 1 byte to be written.
similarly for recording.
2000-04-05 05:54:02 +00:00
cg
3a6463a95b decrease buffer size to 4k
use a seperate channel for generating irqs so we get a buffer-half-empty
interrupt, prevents repeating on underflow
2000-04-05 02:14:26 +00:00
cg
a00d5b661c allow /dev/dsp to be opened seperately for reading and writing. 2000-04-05 01:13:42 +00:00
cg
02dcd03a45 try increasing 2ndbuffer size to 64k 2000-04-05 00:56:02 +00:00
cg
322951289b move buffer size definition to .c file for consistency, and reduce it to 4k 2000-04-05 00:38:00 +00:00
cg
21caf00783 make the click on starting output go away 2000-04-04 02:16:15 +00:00
cg
cb309fc3fb fix missing defines and prototype for emu_vdump() 2000-04-03 00:28:43 +00:00
cg
d45e1e2b8b unfinished sblive driver, playback/mixer only for now - not enabled in
conf/files

i don't seem to be clearing the cache right resulting in a short initial
burst of noise, despite doing the same as creative and alsa.  i'm committing
now so more eyes can pore over the code.
2000-04-02 07:41:17 +00:00
cg
a3c065ea56 fail in attach if we seem to have no ac97 codec 2000-04-01 22:24:03 +00:00
cg
0136b30782 bump the buffer size from 4k to 16k. should improve performance under load. 2000-04-01 21:28:09 +00:00
cg
fb4f8b3940 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
cg
a553c0f5cf don't check extended features on codecs known to hang. should fix neomagic
problems.
2000-03-24 03:14:35 +00:00
cg
951269d7a5 toast warnings on i386 2000-03-20 15:50:08 +00:00
cg
699a6893fb 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
cg
effa7bc907 update the ac97 layer:
* add a callback for initialising the mixer interface
* support ac97 2.1 variable rate audio feature

fix ac97-using drivers for the above

add suspend/resume support for neomagic
2000-03-20 15:30:50 +00:00
cg
2a1e86107d add a function to reinitialize the mixer, to be called by drivers on
resuming after suspend
2000-03-20 15:21:50 +00:00
n_hibma
da12839ce8 Spelling mistake 2000-03-15 22:11:00 +00:00
phk
8e89e2d03f 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
tanimura
27e4b96f78 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
cg
3e2fdbb2dd 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
cg
a69329aaa1 fix ess end-of-buffer repeating
Submitted by:	nhibma
Approved by:	jkh
2000-02-14 23:37:02 +00:00
peter
7760fba064 Tidy up stray or bogus #if NFOO > 0 and #include "foo.h". 2000-01-29 18:48:30 +00:00
peter
1129f8f225 Remove a rather bizzare set of #ifdefs and #defines that all worked out
to be a NO-OP.
2000-01-29 18:44:01 +00:00
cg
c7803fdb7d 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
gallatin
b223e32eee Add support for detection of the ESS 1688 found on my Dell Latitude LM 2000-01-28 04:28:11 +00:00
cg
c54637f284 handle simplex devices right 2000-01-26 20:27:45 +00:00
peter
bd4781a52d 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
tanimura
5ecc620e52 The pointer of the serial FIFO in the DSP seems to make an error
upon starting/stopping the DSP. Correct the pointer in addition
to clearing the FIFO.
2000-01-23 07:04:02 +00:00
cg
0a67c016a3 kludge to fix the end-of-sample repeating bug. i don't know why it happens;
none of my hw does it, but this should fix it for now.

Tested by:	wpaul
2000-01-18 18:59:03 +00:00
cg
fc15400060 update ac97 layer to use device_printf when printing messages 2000-01-18 17:13:43 +00:00
peter
780b88254a Some SB128's (ES1371) have a different PCI vendor id. Vendor == 0x3274
instead of the normal 0x1274.

Tested by:	des
2000-01-17 07:54:00 +00:00