multi-mono-channel sound card
Alexander Motin
mav at FreeBSD.org
Sat Jan 21 15:46:21 UTC 2012
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
More information about the freebsd-multimedia
mailing list