From owner-freebsd-multimedia@FreeBSD.ORG Sat Jan 21 15:46:21 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 463481065675 for ; Sat, 21 Jan 2012 15:46:21 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id BFA358FC13 for ; Sat, 21 Jan 2012 15:46:20 +0000 (UTC) Received: by eekb47 with SMTP id b47so611690eek.13 for ; Sat, 21 Jan 2012 07:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LFIi8NhLTzgwbz+5OPyegZ6MQluzgDQdta4mO2iIciU=; b=nKwCqP1ACNpgSzJYeKvwtQDeQEzTUX5+d97COB9SpjJ2rDBAJeUHKRydajn/bapq1A lTN2na9ktHg3/pvCQ0XuGZHqkV0iLoT/cNTpvhTvIciFWhPyYZi+YeLG6secFP8rtL5m MJEHE1tS83DaU1BpbQRvNYctmuMijxkeUprtw= Received: by 10.14.99.15 with SMTP id w15mr711295eef.107.1327160779583; Sat, 21 Jan 2012 07:46:19 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id n17sm27142652eei.3.2012.01.21.07.46.17 (version=SSLv3 cipher=OTHER); Sat, 21 Jan 2012 07:46:18 -0800 (PST) Sender: Alexander Motin Message-ID: <4F1ADDC8.90104@FreeBSD.org> Date: Sat, 21 Jan 2012 17:46:16 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: Ruslan Bukin References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Sat, 21 Jan 2012 15:46:21 -0000 Hi. 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. -- Alexander Motin