From owner-freebsd-multimedia@FreeBSD.ORG Sun Mar 21 10:22:56 2004 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E46A16A4CE for ; Sun, 21 Mar 2004 10:22:56 -0800 (PST) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (does-d9b90aeb.pool.mediaWays.net [217.185.10.235]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30D2143D2F for ; Sun, 21 Mar 2004 10:22:52 -0800 (PST) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [2002:d9b9:aeb:0:220:afff:fed4:dbcb]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id i2LIMfg01423 verified NO); Sun, 21 Mar 2004 19:22:45 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id i2LIMfp01422; Sun, 21 Mar 2004 19:22:41 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Sun, 21 Mar 2004 19:22:41 +0100 (CET) Message-Id: <200403211822.i2LIMfp01422@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL To: Michael Reifenberger From: Barry Bouwsma References: <20040222234549.R71343@fw.reifenberger.com> cc: freebsd-multimedia@freebsd.org Subject: Re: S/PDIF support X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2004 18:22:56 -0000 [ipv6-only address above] A few weeks late for this reply, but I hope it's still relevant... > is S/PDIF I/O supported under FreeBSD (-current)? I have had it working in -stable; should be no problem with -current, though I have needed to make a few source hacks... > If yes, which cards (esp. S/PDIF input)? I've had success with two particular cards, both of which should be available in .de ... The FM801-based 512i card from TerraTec has an optical s/pdif output, which Just Works in parallel with the normal line/speaker output -- provided you've hacked the chip detection to enable audio (patches for this get mentioned every few months on the lists). The card itself has no s/pdif input, while the fm801 chip should be capable of such, perhaps on a different card, probably with additional register frobbing. Playback has been very pleasing with my hardware, at the bitrates I use. This card is no longer being produced, but can probably still be found. There are apparently several cards based on the CMI8738 chip, some of which have both optical and electrical s/pdif in- and outputs -- the particular one I got was from Typhoon, and should be had for some EUR30 or so, a full 6-channel card. The support for this chip seems to be better under NetBSD than FreeBSD (more options), and FBSD s/pdif output needs to be enabled with a sysctl. I think it's either/or line or s/pdif out with FreeBSD at present. This card seems to be limited to 48 and 44,1kHz sample rate audio -- at least it doesn't play as nicely with my hardware as the FM801-based card. But my hardware is a bit suspect. I've hacked a few lines in the source in order to switch the input from analog mixer (which is rather noisy compared to other available cards) to one of the s/pdif inputs, to enable me to record. This can be done dynamically with NetBSD, while my simplistic hack gives me loadable modules with either optical or coaxial input support -- fine for me since I only need one of them. Probably someone with a bit of time and more skill can hack a sysctl akin to the spdif-output to select one of the possible inputs for recording. This card does not record 32kHz samplerate audio; only 44,1 and 48Khz based on my tests. The electrical input appears to need to be driven by a 5V signal -- one of my sources provides nothing; my other sources probably have ground loop problems that have given me distorted sound on all but one coax-in test. Optical input works great. In the absence of an s/pdif signal to record, my FreeBSD -stable reports a channel dead timeout, and seems to partially freeze the system until the recording process is killed. So there needs to be some input to the card for recording -- which recording is made at the actual sample rate of the s/pdif signal, naturally. I'm using multiple cards in one machine with some issues that I haven't bothered to track down as a problem with my hardware or with FreeBSD, but otherwise my needs are met, mostly. I have a small bit of static in my optical recordings made on the machine with two cards; I haven't noticed this slight crackling in recordings made on a different machine with a single card, but more research is necessary. With that out of the way, note that by default, FreeBSD cannot record from the s/pdif inputs. I suggest an inspection of the three NetBSD source files (pci/cmpci*) in comparison to FreeBSD's (based in part on NetBSD) as a basis for better hacks to enable recording, as well as hints as to further things this card/chip is capable of. I've seen two different makes of card with this chip and full s/pdif interconnections, as well as an identical-looking board for half the price without any s/pdif connectors and only 2 (or 4?) channel support. I suspect it should be no problem to find a suitable card. Those are the only s/pdif cards I've played with so far. Hope this late information is helpful, if only for the archives. barry bouwsma