Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2012 17:46:16 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Ruslan Bukin <br@bsdpad.com>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: multi-mono-channel sound card
Message-ID:  <4F1ADDC8.90104@FreeBSD.org>
In-Reply-To: <mailpost.1327157687.2711952.14470.mailing.freebsd.multimedia@FreeBSD.cs.nctu.edu.tw>
References:  <mailpost.1327157687.2711952.14470.mailing.freebsd.multimedia@FreeBSD.cs.nctu.edu.tw>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F1ADDC8.90104>