From owner-freebsd-multimedia@FreeBSD.ORG Sun Jan 22 16:38:30 2012 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 EEF88106564A; Sun, 22 Jan 2012 16:38:30 +0000 (UTC) (envelope-from br@rtclab.com) Received: from mx.bsdpad.com (mx.bsdpad.com [46.4.68.80]) by mx1.freebsd.org (Postfix) with ESMTP id AF3418FC15; Sun, 22 Jan 2012 16:38:30 +0000 (UTC) Received: from mx.bsdpad.com ([46.4.68.80] helo=rtclab.com) by mx.bsdpad.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Rp0R2-0004tk-Hh; Sun, 22 Jan 2012 20:38:28 +0400 Received: (from br@localhost) by rtclab.com (8.14.5/8.14.5/Submit) id q0MGcSXw018831; Sun, 22 Jan 2012 16:38:28 GMT (envelope-from br) Date: Sun, 22 Jan 2012 20:38:28 +0400 From: Ruslan Bukin To: Alexander Motin Message-ID: <20120122163828.GA18783@jail.io> References: <4F1ADDC8.90104@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4F1ADDC8.90104@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-multimedia@FreeBSD.org Subject: Re: multi-mono-channel sound card 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: Sun, 22 Jan 2012 16:38:31 -0000 Hi, On Sat, Jan 21, 2012 at 05:46:16PM +0200, Alexander Motin wrote: > On 01/21/12 16:12, Ruslan Bukin wrote: > >My multichannel sound card (RME HDSPe AIO) is support > >SND_FORMAT(AFMT_S32_LE, 1, 0) only. > > > >I call pcm_addchan(..), which triggers chan_init(..,*snd_dbuf,..) > >Addr of snd_dbuf I write to card in slot N. > >In result I have /dev/dsp0.pN devices (one device per each mono channel) > > > >Works perfectly, sounds great, but in mono mode. > > > >I'm interested, what is the right way to implement > >stereo pair of channels per one device file like in OSS? > > pcm_addchan() registers set of equal playback/record channels that > are supposed to be mixed into the same signal. It is hardware > equivalent of vchans. It has nothing common with multiple speakers. > > Multichannel audio is always multiplexed and AFAIk there is no > demultiplexing in sound(4). Sound(4) can upmix/downmix channels, > change their order, format, rate, but not demultiplex. > > I see only two ways: > - implement demultiplexing in driver -- that is not easy, but I > believe it should be possible; > - export each input/output connector as separate PCM device and let > some user level software to do demultiplexing -- that is easy and > that is what snd_emu10kx does. snd_emu10kx(4) recommends to use > pulseaudio for demultiplexing. Thanks. I have implemented demultiplexing. Works great. I will release the driver soon. -Ruslan > > -- > Alexander Motin