From owner-cvs-all@FreeBSD.ORG Sat Jan 6 18:59:36 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEAA216A403; Sat, 6 Jan 2007 18:59:35 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D14BE13C44B; Sat, 6 Jan 2007 18:59:35 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l06IxZQR041754; Sat, 6 Jan 2007 18:59:35 GMT (envelope-from netchild@repoman.freebsd.org) Received: (from netchild@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l06IxZko041753; Sat, 6 Jan 2007 18:59:35 GMT (envelope-from netchild) Message-Id: <200701061859.l06IxZko041753@repoman.freebsd.org> From: Alexander Leidinger Date: Sat, 6 Jan 2007 18:59:35 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/sound/pci emu10kx-pcm.c emu10kx.c emu10kx.h src/sys/modules/sound/driver/emu10kx Makefile X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jan 2007 18:59:36 -0000 netchild 2007-01-06 18:59:35 UTC FreeBSD src repository Modified files: sys/dev/sound/pci emu10kx-pcm.c emu10kx.c emu10kx.h sys/modules/sound/driver/emu10kx Makefile Log: 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 Revision Changes Path 1.5 +223 -22 src/sys/dev/sound/pci/emu10kx-pcm.c 1.6 +172 -32 src/sys/dev/sound/pci/emu10kx.c 1.3 +4 -9 src/sys/dev/sound/pci/emu10kx.h 1.2 +3 -0 src/sys/modules/sound/driver/emu10kx/Makefile