Re: Polypaudio for Gnome 2.10, the next steps



On Wed, 24.11.04 21:39, Bastien Nocera (hadess hadess net) wrote:

> To use polyaudio by default in Totem, I'd need to know whether it
> supports 4.0, 4.1 and 5.1 outputs, and, if so, what it does for stereo
> (or mono) streams fed to a sound system that has more speakers than
> that.

Polypaudio is flexible regarding the number of channels. You may use
one, two, or more. All channels are treated the same. I don't have
 {4,5}.{0,1} equipment here, so I am unable to test it. I assume that
 everything works fine if the underlying driver supports it.

The current mixing code for merging or forking channels is very
simple. If the channel number of the input stream matches that of the
output device, the stream is not touched. Otherwise all channels are
mixed down to a single one and after that copied to all output
channels. For the special cases where only one or two channels are
involved, everything works as expected. However, if you want to
playback 5 channel sound on a stereo sound device, you won't get happy
with the current code. Yepp. I should really fix that. I know. Someone
should donate some 4.1 speakers to me... ;-)

What is the algorithm you'd expect? Perhaps something like this:

n1 is the number of channels of the input stream, n2 is the number of
channels of the output stream:

1. if n1 == n2, don't touch the data
2. if n2 == 1, mix all n1 channels t
3. if n2 > n1, copy n1 channels, fill all others with silence
4. if n2 < n1, copy n2 channels

Is that correct? What would you suggest?

Do i need explicit support for 4.0, 4.1 or 5.1? Perhaps for
distinguishing 4.1 from 5.0?

Lennart

-- 
name { Lennart Poettering } loc { Hamburg - Germany }
mail { mzft (at) 0pointer (dot) de } gpg { 1A015CC4 }  
www { http://0pointer.de/lennart/ } icq# { 11060553 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]