From owner-freebsd-multimedia@FreeBSD.ORG Thu Jul 7 11:57:11 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org 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 7081F16A41C for ; Thu, 7 Jul 2005 11:57:11 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from tomoyo.MyBSD.org.my (duke.voidnetwork.com [202.157.186.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0047743D45 for ; Thu, 7 Jul 2005 11:57:10 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from localhost (localhost [127.0.0.1]) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 566AC6CC9A; Thu, 7 Jul 2005 20:02:27 +0800 (MYT) Received: from tomoyo.MyBSD.org.my ([127.0.0.1]) by localhost (duke.voidnetwork.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 63624-01; Thu, 7 Jul 2005 20:02:25 +0800 (MYT) Received: from kasumi.MyBSD.org.my (unknown [60.50.147.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 2C90B6CC99; Thu, 7 Jul 2005 20:02:24 +0800 (MYT) Date: Thu, 7 Jul 2005 19:57:16 +0800 From: Ariff Abdullah To: Alexander Leidinger Message-Id: <20050707195716.780c01a9.skywizard@MyBSD.org.my> In-Reply-To: <20050707120503.5878d347@Magellan.Leidinger.net> References: <20050707064603.6c295451.skywizard@MyBSD.org.my> <20050707120503.5878d347@Magellan.Leidinger.net> Organization: MyBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-antivirus-mail-gateway at TOMOYO.MYBSD.ORG.MY Cc: freebsd-multimedia@freebsd.org, mat@cnd.mcgill.ca Subject: Re: Massive sound changes / fix (24/32bit pcm support, new sampling rate converter, various fixes) 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: Thu, 07 Jul 2005 11:57:11 -0000 On Thu, 7 Jul 2005 12:05:03 +0200 Alexander Leidinger wrote: > On Thu, 7 Jul 2005 06:46:03 +0800 > Ariff Abdullah wrote: > > > System wide changes > > =================== > > > > 1. sys/soundcard.h > > * Add definition for AFMT_(U|S)24_(B|L)E. This is somehow > > contradict with OSS/Voxware definition of 24bit, but > > anyway... > > Can you explain this a little bit more please? Being incompatible > isn't good (I haven't looked at the files, so I may understand > something wrong). > OSS define AFMT_x32_xE as: 1) 32bit data, packed within 32bit (4bytes) boundary. 2) 24bit data, packed within 32bit (4bytes) boundary where the data is stored in the 24 most significant bits and least significant 8 bits are not used and should be set to 0. While this might hold true in few cases, lots of application (notably mplayer, sweep) really deal / produce 24bit as what they should meant to be: 24bit data / 3bytes per sample. In this case, I have decided to handle 24bit pcm separately so the in-kernel conversion space did not confuse itself with 32bit variant. Here is a hint for you: After applying the patch and replacing /usr/include/sys/soundcard.h with the patched version (/usr/src/sys/sys/soundcard.h), recompile mplayer, and use it to *abuse* this new format. Something like: mplayer -af resample=128000:0:0,format=u24be somefile.. This will let mplayer doing the conversion + resample from any -> 128khz/u24be and directly play it to /dev/dsp. Notice that the in-kernel conversion *really* doing it job properly. Also note that, mplayer 24bit seeking/pausing is buggy, they should do it within 24bit boundary anyway. I can't think of any other applications that really can play 24/32 bit pcm files *directly*, except mplayer. Most applications tend to do conversion from 24bit to sign/float 32 for processing, notably audacity, and to sign 16 le for playing. Don't worry about incompatibilities. It doesn't break anything. You don't have to recompile anything (except mplayer, and that is because to enable the long-awaited disabled feature). -- Ariff Abdullah MyBSD http://www.MyBSD.org.my (IPv6/IPv4) http://staff.MyBSD.org.my (IPv6/IPv4) http://tomoyo.MyBSD.org.my (IPv6/IPv4)