freebsd-nq/sys
Alexander Leidinger f856af0466 Extend the emu10kx driver. With the words of the author:
---snip---
New features:
1.	Optional multichannel recording (32 channels on Live!, 64 channels
 	on Audigy).

 	All channels are 16bit/48000Hz/mono, format is fixed.
 	Half of them are copied from sound output, another half can be
 	used to record any data from DSP. What should be recorded is
 	hardcoded in DSP code. In this version it records dummy data, but
 	can be used to record all DSP inputs, for example..

 	Because there are no support of more-than-stereo sound streams
 	multichannell stream is presented as one 32(64)*48000 Hz 16bit mono
 	stream.

 	Channel map:

 	SB Live! (4.0/5.1)
 	offset (words)	substream
 	0x00		Front L
 	0x01		Front R
 	0x02		Digital Front L
 	0x03		Digital Front R
 	0x04		Digital Center
 	0x05		Digital Sub
 	0x06		Headphones L
 	0x07		Headphones R
 	0x08		Rear L
 	0x09		Rear R
 	0x0A		ADC (multi-rate recording) L
 	0x0B		ADC (multi-rate recording) R
 	0x0C		unused
 	0x0D		unused
 	0x0E		unused
 	0x0F		unused
 	0x10		Analog Center (Live! 5.1) / dummy (Live! 4.0)
 	0x11		Analog Sub (Live! 5.1) / dummy (Live! 4.0)
 	0x12..-0x1F	dummy

 	Audigy / Audigy 2 / Audigy 2 Value / Audigy 4
 	offset (words)	substream
 	0x00		Digital Front L
 	0x01		Digital Front R
 	0x02		Digital Center
 	0x03		Digital Sub
 	0x04		Digital Side L (7.1 cards) / Headphones L (5.1 cards)
 	0x05		Digital Side R (7.1 cards) / Headphones R (5.1 cards)
 	0x06		Digital Rear L
 	0x07		Digital Rear R
 	0x08		Front L
 	0x09		Front R
 	0x0A		Center
 	0x0B		Sub
 	0x0C		Side L
 	0x0D		Side R
 	0x0E		Rear L
 	0x0F		Rear R
 	0x10		output to AC97 input L (muted)
 	0x11		output to AC97 input R (muted)
 	0x12		unused
 	0x13		unused
 	0x14		unused
 	0x15		unused
 	0x16		ADC (multi-rate recording) L
 	0x17		ADC (multi-rate recording) R
 	0x18		unused
 	0x19		unused
 	0x1A		unused
 	0x1B		unused
 	0x1C		unused
 	0x1D		unused
 	0x1E		unused
 	0x1F		unused
 	0x20..0x3F	dummy

Fixes:
1.	Do not assign negative values to variables used to index emu_cards
 	array. This array was never accessed when index is negative, but
 	Alexander (netchild@) told me that Coverity does not like it.
 	After this change emu_cards[0] should never be used to identify
 	valid sound card.
2.	Fix off-by-one errors in interrupt manager. Add more checks there.
3.	Fixes to sound buffering code now allows driver to use large playback
 	buffers.
4.	Fix memory allocation bug when multichannel recording is not
 	enabled.
5.	Fix interrupt timeout when recording with low bitrate (8kHz).

Hardware:
1.	Add one more known Audigy ZS card to list. Add two cards with
 	PCI IDs betwen old known cards and new one.

Other changes:
1.	Do not use ALL CAPS in messages.

Incomplete code:
1.	Automute S/PDIF when S/PDIF signal is lost.

Tested on i386 only, gcc 3.4.6 & gcc41/gcc42 (syntax only).
---snip---

This commits enables a little bit of debugging output when the driver is
loaded as a module. I did a cross-build test for amd64.

The code has some style issues, this will be addressed later.

The multichannel recording part is some work in progress to allow playing
around with it until the generic sound code is better able to handle
multichannel streams.

This is supposed to fix
CID:		171187
Found by:	Coverity Prevent

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2007-01-06 18:59:35 +00:00
..
amd64 MFi386 rev 1.56: 2007-01-06 15:58:34 +00:00
arm Hints are handled differently on -current 2007-01-05 10:30:51 +00:00
boot MFp4: differences for bwct ethernet attachment 2006-12-20 18:26:37 +00:00
bsm
cam fix botch 2006-12-21 23:20:51 +00:00
coda change vop_lock handling to allowing tracking of callers' file and line for 2006-11-13 05:51:22 +00:00
compat Fix amd64 build. 2007-01-01 14:47:45 +00:00
conf MFp4: add BWCT kernel configuration 2007-01-05 02:08:35 +00:00
contrib Clean up pfr_kentry_pl2 as well. This fixes a kernel panic in the vm.zone 2007-01-01 16:51:11 +00:00
crypto Initialize T1 to silent gcc warning. 2006-10-22 02:19:33 +00:00
ddb Threading cleanup.. part 2 of several. 2006-12-06 06:34:57 +00:00
dev Extend the emu10kx driver. With the words of the author: 2007-01-06 18:59:35 +00:00
fs Simplify code in union_hashins() and union_hashget() functions. These 2007-01-05 14:06:42 +00:00
gdb
geom Softc may be NULL in g_journal_orphan(), so don't be surprised. 2006-12-02 09:10:29 +00:00
gnu Previously, the mount_ext2fs binary listed the acceptable mount 2006-11-18 18:22:11 +00:00
i4b Fix fat-fingering in previous commit. 2006-12-29 16:38:22 +00:00
i386 regen after addition of linux_utimes and linux_rt_sigtimedwait 2006-12-31 13:20:31 +00:00
ia64 Add a lwpid field into per-cpu structure, the lwpid represents current 2006-12-20 04:40:39 +00:00
isa Be consistent with the spelling of "dependent" in user-visible places. 2006-12-30 11:55:47 +00:00
isofs/cd9660 The ISO9660 spec does allow files up to 4G. Change the i_size 2006-12-08 07:43:53 +00:00
kern - Don't let SCHED_TICK_TOTAL() return less than hz. This can cause integer 2007-01-06 12:33:43 +00:00
libkern
modules Extend the emu10kx driver. With the words of the author: 2007-01-06 18:59:35 +00:00
net style(9) nit. Prefer struct[space]name[space]{ to make grep searches more 2007-01-01 21:49:39 +00:00
net80211 Fix compile error. 2007-01-06 05:38:18 +00:00
netatalk Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netatm Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netgraph Various bpf(4) related fixes to catch places up to the new bpf(4) 2006-12-29 13:59:50 +00:00
netinet o One more typo in the comment. 2007-01-06 13:12:24 +00:00
netinet6 a) macro-ization of all mbuf and random number 2006-12-29 20:21:42 +00:00
netipsec s,#if INET6,#ifdef INET6, 2006-12-14 17:33:46 +00:00
netipx Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netkey
netnatm
netncp Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netsmb Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nfs NFSv4 client: 2006-11-28 19:33:28 +00:00
nfs4client NFSv4 client: 2006-11-28 19:33:28 +00:00
nfsclient NetApp filers return corrupt post op attrs in the wcc on NFS error responses. 2006-12-11 19:54:25 +00:00
nfsserver The nfsm_srvpathsiz() macro in nfsrv_symlink() in nfs_serv.c should 2007-01-02 20:42:08 +00:00
opencrypto
pc98 Allow machdep.cpu_idle_hlt to be set from the loader. This should allow 2006-12-06 18:27:17 +00:00
pccard
pci Restore agp aperture size after resume, in case it is modified after boot. 2007-01-06 08:31:31 +00:00
powerpc In cpu_reset(), call OF_reboot() instead of OF_exit(). The latter 2006-12-28 23:56:50 +00:00
rpc
security Teach the stub policy about some of the more recent entry points that have 2007-01-01 01:47:18 +00:00
sparc64 add new large page sizes for use by shared loader 2006-12-18 07:28:59 +00:00
sun4v Invert the logic inside of two KASSERTS which resulted in two kernel panics 2006-12-31 02:50:07 +00:00
sys - Close a race between enumerating UNIX domain socket pcb structures via 2007-01-05 19:59:46 +00:00
tools
ufs change vop_lock handling to allowing tracking of callers' file and line for 2006-11-13 05:51:22 +00:00
vm - Add a new function uma_zone_exhausted() to see if a zone is full. 2007-01-05 19:09:01 +00:00
Makefile o Add cam to a list of cscope dirs. 2006-11-26 18:27:16 +00:00