[pulseaudio-discuss] Messing around with surround, also found a patch

Adriano Moura adriano.lols at gmail.com
Sun Oct 14 16:01:00 PDT 2012


2012/10/14 Tanu Kaskinen <tanuk at iki.fi>
> I didn't get why 5.1 REAR should end up in 7.1 SIDE. If the content
> creator decided to put audio in a REAR channel, why shouldn't it be
> played to a REAR speaker? Is 5.1 content actually created with the
> assumption that in practice the so-called "rear" channels end up in
> "side" speakers?

If you do a search for "5.1 speakers setup" you will notice that most
setups place the surround speakers at -90º/90º and nobody calls then
Rear or Back speakers, but Side or Surround speakers. I don't know why
we call then REAR in a 5.1 arrange... maybe it's an Alsa thing that we
borrowed? They also list then as REAR. But anyway, 5.1 arrangement is
definitely meant to be played trough surround/side speakers.

2012/10/14 Tanu Kaskinen <tanuk at iki.fi>
> I think PA_CHANNEL_MAP_ALSA should be strictly bound to the channel
> convention that alsa uses with its various surround devices. I think
> there's no alsa surround device for 6.1, so it makes sense not to define
> anything for 6.1 in pulseaudio either for PA_CHANNEL_MAP_ALSA.

I thought about that but since there is no app using
PA_CHANNEL_MAP_ALSA expecting 7ch to fail, it's not a bad workaround
until all software can select a proper mapping.

2012/10/14 Tanu Kaskinen <tanuk at iki.fi>
> It sounds like mplayer is likely buggy in this regard - I think it
> should set the channel map based on the content, not just assume that
> all 7-channel content uses the same channel map. The content should in
> most cases include the full channel map information. If there really is
> such crappy content types for multi-channel audio which don't include
> the channel map information, then I think mplayer should use
> PA_CHANNEL_MAP_DEFAULT instead of PA_CHANNEL_MAP_ALSA. Currently the
> default definition is AIFF, though, which doesn't contain any mappings
> above 6 channels, and even the 6-channel definition doesn't seem to be
> very suitable for being the default (no LFE channel). So, I think this
> is a bug in pulseaudio. PA_CHANNEL_MAP_DEFAULT needs to be redefined
> somehow. After that's done, mplayer can use PA_CHANNEL_MAP_DEFAULT
> instead of PA_CHANNEL_MAP_ALSA (but only in those cases where the
> content doesn't contain any channel map information).

mplayer is probably doing it's own magic to convert the internal
channel map into something compatible with PA_CHANNEL_MAP_ALSA (I've
played stuff with WAVEEX and it works fine). I wouldn't blame then for
choosing ALSA chmap since WAVEEX is kind of insane (you would need to
add empty useless channels for most things to work as it is now), OSS
would be weired and AIFF is kind of useless.
PA_CHANNEL_MAP_DEFAULT should definitely point towards something more
useful, but the most useful as of now is ALSA anyway, unless we patch
WAVEEX. Maybe we need a PA_CHANNEL_MAP_PULSE?

Better yet, they should call pa_channel_map_init where you can pass
your own pa_channel_map struct, but I think nobody talks much about
that or has tried to translate their internal ch map to one
understandable by pa using this method. That's also why I think
pa_channel_map_init_auto should be more about what is most
common/broad than what is written on some documentation that we can't
properly emulate.

2012/10/14 Tanu Kaskinen <tanuk at iki.fi>
> I don't understand why openal would use PA_CHANNEL_MAP_WAVEEX to define
> its channel map, though. When openal creates a stream in pulseaudio, I
> would expect it to know exactly the channel map, and if it doesn't match
> with the WAVEEX definition, then it should use some other definition (or
> initialize the pa_channel_map struct manually).
>
> That said, if the mapping that you suggest for WAVEEX isn't any less
> conformant than the current mapping, this sounds like a useful change to
> make. Potentially it can break other applications that assume that the
> mapping is what it is now, but I find the existence of such applications
> quite unlikely...

Again, I think they either didn't want to mess with
pa_channel_map_init or didn't realize WAVEEX was broken for 6.1 and
up... Well, few people have surround setups, even less so 6.1/7.1. (I
also don't, But I'm using binauralization with some nifty jack and
jconvolver DSP)

2012/10/14 Tanu Kaskinen <tanuk at iki.fi>
> If it really is the case that the content authors use the 5.1 rear
> channels as if they were side channels, then I think the best place to
> adapt to that would be calc_map_table() in src/pulsecore/resampler.c.
>
> Thanks for your efforts!
>
> --
> Tanu
>

I tried looking at this code once before but didn't really understand
it... Will give it another try soon.


More information about the pulseaudio-discuss mailing list