Commit Graph

441 Commits

Author SHA1 Message Date
Cameron Grant
48875621e1 make the 4dwave nx chip work
Submitted by:	Philippe Anel <xigh@noos.fr>
2001-08-23 12:02:29 +00:00
Cameron Grant
92f39b2c05 MFS: make SNDCTL_DSP_SETTRIGGER work 2001-08-23 11:58:38 +00:00
Cameron Grant
1662598f0c MFS: allow multiple opens of mixer devices 2001-08-23 11:56:07 +00:00
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
George C A Reid
1ad86e6dd7 Set up the via_chinfo structures properly so we write to the correct
registers later on; this fixes the VIA82C686 sound problems recently
reported by a number of people.
2001-08-02 22:13:10 +00:00
Scott Long
19f2be11b0 Limit the device to only one playback channel until I can figure out why
a) newpcm insists on using only the highest number channel available, and
b) the maestro3 driver no longer likes anything above channel 0.
2001-07-19 20:53:52 +00:00
Scott Long
e93d24c2f0 Fix an off-by-one error in the dma tag. This was causing the VM system to
freak out occasionally.

MFC after:	1 week
2001-07-19 20:51:29 +00:00
Peter Wemm
57385865a9 Somehow I missed this. Use INTR_TYPE_AV (high priority) instead of
INTR_TYPE_TTY (lowest priority).
2001-07-09 23:44:54 +00:00
Cameron Grant
41a019c08d * simplify
* add support for mic record channel

* add support for setblocksize

* make mpsafe

* make getptr accurate

* reduce buffer size from 64k to 16k for better synchronisation
2001-07-03 17:27:13 +00:00
Cameron Grant
cbe7d6a3ed remove obsolete typedefs.
only define INTR_TYPE_AV if it is not already defined.
2001-07-03 12:53:09 +00:00
Brian Feldman
bc0e6469ff Correct obviously wrong mistakes. 2001-07-02 23:47:23 +00:00
Matt Jacob
5640e0ac5a make it compile again in -current 2001-07-02 17:36:11 +00:00
Brian Feldman
5e6abe66d8 Detect the device on e.g. Dell OptiPlex GX110s. 2001-07-02 15:29:38 +00:00
Brian Feldman
0cfa4761f7 Make all this compile on 4.3, modulus sbuf. 2001-07-02 15:27:28 +00:00
Cameron Grant
1b6c76a2fe intel ich/ich2 driver - this needs some work but is functional enough for
the impatient.

Hardware...
Provided by:    ps
Lost by:        <censored>
Found by:       <censored>
Not delivered by:       Ashley Penney <ashp@unloved.org>
Retrieved by:   greid, Andrew McKay <andy@openirc.co.uk>
Delivered by:   Andrew McKay <andy@openirc.co.uk>

PR:             kern/25507
Submitted by:   Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
2001-07-01 19:38:58 +00:00
Cameron Grant
113375dc42 add module version/dependancies 2001-07-01 18:59:15 +00:00
Cameron Grant
c76f01164f don't set a flag that is already set 2001-07-01 18:57:16 +00:00
Cameron Grant
4712b1eba1 set default 'monitor' volume (ac97 headphones) to 75% 2001-07-01 18:53:24 +00:00
Cameron Grant
f637a36cfd don't flag the playback hardchan as busy on devices with only one of them.
if a device has vchans already but they are all busy, allocate another one
at open() time, up to a maximum of hw.snd.maxvchans.

when creating/destroying vchans, don't make/remove a devnode for the
first/last one as it replaces a hardchan.
2001-06-27 19:59:45 +00:00
Cameron Grant
aa0baad55b tidy up/simplify dsp_clone() 2001-06-27 19:51:02 +00:00
Cameron Grant
cd9766c5f8 add a tunable/sysctl, hw.snd.autovchans. if this is set to a value n where
n > 0, n vchans will be assigned to any devices that subsequently register
with a single playback channel.
2001-06-26 21:54:55 +00:00
Cameron Grant
8e81760b1a the turtle beach santacruz implements ac97 eapd in an inverted sense -
inform the ac97 code of this.
2001-06-23 18:00:06 +00:00
Cameron Grant
f00f162a5f add defines and ifdefs so this code will compile on 4.x
add spls so this code will work on 4.x
2001-06-23 17:36:51 +00:00
Cameron Grant
79bb7d52b3 move a private struct definition from ac97.h to ac97.c
add proper handling of cards which take eapd=1 to mean 'produce sound'
instead of 'external amplifier power down'
2001-06-23 17:32:40 +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
Cameron Grant
b30d115684 stop csa from panicing in clkrun_hack() - we were using free'd memory
don't leak memory in clkrun_hack()

Submitted by:	grog (partially)
2001-06-18 19:58:03 +00:00
Thomas Moestl
916076fefc Call bus_teardown_intr when csa_attach fails after the interrupt has
been set up.

PR:		kern/28178
Reviewed by:	cg
MFC after:	2 weeks
2001-06-18 18:36:34 +00:00
Cameron Grant
74ffd13814 use devclass_get_maxunit() correctly 2001-06-18 00:10:47 +00:00
Cameron Grant
faeebea2b8 revise dsp_clone() to return the first nonbusy channel instead of simply
cycling channel numbers.

remove unused fields from struct snddev_info.
2001-06-17 23:23:06 +00:00
Cameron Grant
5210620e98 fix a potential panic in dsp_clone() if no pcm devices were detected 2001-06-17 20:15:29 +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
Cameron Grant
b8f0d9e0b2 various locking fixes, rework open logic and channel registration
PR:             kern/28084
2001-06-14 13:31:30 +00:00
Cameron Grant
94faf89997 identify es1371 revision a 2001-06-11 00:32:18 +00:00
Cameron Grant
7d07ee8c6b get clkrun the right way around
remove debug messages
2001-06-11 00:29:25 +00:00
Dag-Erling Smørgrav
d647935801 sbuf_new(9) now returns a struct sbuf * instead of an int. If the caller
does not provide a struct sbuf, sbuf_new(9) will allocate one and return
a pointer to it.
2001-06-10 15:48:04 +00:00
Seigo Tanimura
e6577f69a4 Catch up to csareg.h rev 1.3.
Forgotten by:	cg
2001-06-08 11:57:39 +00:00
Peter Wemm
0978669829 "Fix" the previous initial attempt at fixing TUNABLE_INT(). This time
around, use a common function for looking up and extracting the tunables
from the kernel environment.  This saves duplicating the same function
over and over again.  This way typically has an overhead of 8 bytes + the
path string, versus about 26 bytes + the path string.
2001-06-08 05:24:21 +00:00
Cameron Grant
49c5e6e20a lock sound device when adding/removing channels
implement setblocksize for vchans
don't panic when doing certain ioctls or aborting on a vchan
xmms now works with vchans
2001-06-07 20:06:22 +00:00
Peter Wemm
4422746fdf Back out part of my previous commit. This was a last minute change
and I botched testing.  This is a perfect example of how NOT to do
this sort of thing. :-(
2001-06-07 03:17:26 +00:00
Peter Wemm
81930014ef Make the TUNABLE_*() macros look and behave more consistantly like the
SYSCTL_*() macros.  TUNABLE_INT_DECL() was an odd name because it didn't
actually declare the int, which is what the name suggests it would do.
2001-06-06 22:17:08 +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
Cameron Grant
3c20ba7175 fix typo 2001-05-30 22:46:40 +00:00
Cameron Grant
8d41a999cd no longer used 2001-05-30 22:41:04 +00:00
Cameron Grant
20ac1df714 update this driver to use new firmware and incorporate many fixes.
this works on cs4630 chips, and should implement the clkrun hack for
thinkpads- this will display diagnostic messages when triggered until its
correctness is established.
2001-05-30 22:38:31 +00:00
Cameron Grant
6cf2606901 state the licencing terms for this file
Obtained From:	Yamaha
2001-05-30 19:05:47 +00:00
Cameron Grant
285648f9d2 beginnings of virtual playback channel support
instead of using two malloced arrays for storing channel lists, use an
slist.  convert the sndstat device to use sbufs and optionally provide more
detail about channel state.

vchans are software mixed playback channels.  they are not enabled by this
commit.  they use the feeder infrastructure to emulate normal playback
channels in a manner transparent to applications, whilst providing as many
channels are desired, especially suitable for devices with only one hardware
playback channel.  in the future they will provide additional features.

those wishing to test this functionality will need to add vchan.c to
sys/conf/files and use 'sysctl -w hw.snd.pcm0.vchans' to enable it.

blocksize and auto-rate selection are not yet supported.
2001-05-27 17:22:00 +00:00
Cameron Grant
4dce85407c add a new method for retrieving feeder parameters 2001-05-27 14:49:14 +00:00
Cameron Grant
fc60109d91 don't erase info in sndbuf_setup()
set free'd pointers to NULL in sndbuf_free()
add a new function
2001-05-27 14:39:34 +00:00
Scott Long
7edce08ac4 Fix DMA on machines with more than 128MB.
Obtained from:	cg
MFC after:	5 days
2001-05-25 16:05:22 +00:00