From owner-freebsd-multimedia@FreeBSD.ORG Wed Mar 18 15:59:21 2009 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8561106566C for ; Wed, 18 Mar 2009 15:59:21 +0000 (UTC) (envelope-from CQG00620@nifty.ne.jp) Received: from mail2.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id 761308FC22 for ; Wed, 18 Mar 2009 15:59:21 +0000 (UTC) (envelope-from CQG00620@nifty.ne.jp) Received: from asahi-net.jp (m037093.dynamic.ppp.asahi-net.or.jp [219.121.37.93]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id 2D50E6D04D for ; Thu, 19 Mar 2009 00:40:27 +0900 (JST) Date: Thu, 19 Mar 2009 00:40:26 +0900 From: WATANABE Kazuhiro To: freebsd-multimedia User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/21.3 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20090318154027.2D50E6D04D@mail2.asahi-net.or.jp> Subject: [patch] SPDIF output preliminary support for (YAMAHA) AC97 codecs X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 15:59:22 -0000 Hi, all. I've created a patch that enables SPDIF output for (YAMAHA) AC97 codecs: http://homepage2.nifty.com/dumb_show/unix/work/ac97_spdif_20090210.diff To create this patch, I referred the following article: [PATCH]: ICH5 [ac97 rev2.3] spdif support http://lists.freebsd.org/pipermail/freebsd-hackers/2004-September/008196.html This patch will create a "dev.pcm.X.spdif" sysctl(8) variable for AC97 codecs that has a SPDIF interface. If you set the variable to "1", it enables the SPDIF output interface. I think a number of AC97 codecs will be able to use their SPDIF output interface with this setting. But some codecs will need more hacks (ex. slot mapping). For YAMAHA YMF753 and YMF743, "dev.pcm.X.spdif_out" and "dev.pcm.X.spdif_src" variables will also be created. These selects a SPDIF output pin and output source. spdif_out SPDIF output pin ------------------------------------------------------------------ 0 none 1 pin 43 2 pin 47 (By default it's used by the EAPD function) 4 pin 48 (The AC97 spec. standard) (YMF753 only) ------------------------------------------------------------------ spdif_src SPDIF output source ----------------------------------- 0 AC-Link 1 A/D Converter ----------------------------------- I've only tested the patch on 7.1-RELEASE and 8-current with the following hardware: * NEC PC-VC3004D (SiS 7012 (snd_ich) + YAMAHA YMF753) pcm0: port 0x1400-0x14ff,0x1080-0x10ff irq 18 at device 2.7 on pci0 pcm0: Reserved 0x100 bytes for rid 0x10 type 4 at 0x1400 pcm0: Reserved 0x80 bytes for rid 0x14 type 4 at 0x1080 pcm0: [MPSAFE] pcm0: [ITHREAD] pcm0: pcm0: Codec features tone, 18 bit DAC, 5 bit master volume, Yamaha Ymersion pcm0: Primary codec extended features SPDIF, AMAP, reserved 4 pcm0: ac97 codec dac ready count: 0 pcm0: Mixer "vol": pcm0: Mixer "bass": pcm0: Mixer "treble": pcm0: Mixer "pcm": pcm0: Mixer "speaker": pcm0: Mixer "line": pcm0: Mixer "mic": pcm0: Mixer "cd": pcm0: Mixer "rec": pcm0: Mixer "igain": pcm0: Mixer "line1": pcm0: Mixer "phin": pcm0: Mixer "phout": pcm0: Mixer "video": pcm0: clone manager: deadline=750ms flags=0x8000001e pcm0: sndbuf_setmap 10f0000, 4000; 0xd44e7000 -> 10f0000 pcm0: sndbuf_setmap 10f8000, 4000; 0xd44eb000 -> 10f8000 pcm0: measured ac97 link rate at 48010 Hz, will use 48000 Hz It has an optical SPDIF output, and works well with the following setting: dev.pcm.0.spdif=1 dev.pcm.0.spdif_out=4 --- WATANABE Kazuhiro (CQG00620@nifty.ne.jp)