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

Adriano Moura adriano.lols at gmail.com
Fri Oct 5 18:45:02 PDT 2012


I've been using pulseaudio with surround content for quite a bit and
found some oddities around.

When playing 5.1, 5.0 or 6.1 content, surround channels are labeled as
REAR channels. This might be fine for people with up to 6.1 output
since the surround channels are also labeled as REAR anyways, and most
setups physically arrange it as a SIDE channel (not behind the
listener, but exactly +/-90º) . However, once you try (for ex) 5.1
over 7.1 the 5.1 REAR channel ends up as the 7.1 REAR channel which is
supposed to be behind the listener in a 7.1 setup. Ideally 5.1 REAR
would end up as 7.1 SIDE which matches the same physical arrangement.
One way to achieve this is changing 5.0/5.1/6.1 ch map to use SIDE
instead of REAR.

Another little nitpick is the lack of 6.1 mappings. Quite a bit of
software rely on "pa_channel_map_init_auto" to find a usable mapping
but fails because there is no case for 7 channel mapping, or it just
returns a plainly wrong one. For example, running a 6.1 movie with
smplayer/mplayer would fail because no 7ch mapping was available in
"PA_CHANNEL_MAP_ALSA".

Also, "PA_CHANNEL_MAP_WAVEEX" gives many wrong channel maps. As far as
I know WAVEEX is supposed to work with a bitmask to select which
channels you want to work with, not to religiously give the channels
in the order the MS documentation provides. Let me put it better, you
are supposed to hide the channels you don't need but still keep what
you need at the same original order. Since "pa_channel_map_init_auto"
does not provide any means to pass this bitmask, the WAVEEX condition
should just return what is most common for X channels.
For example, 7.1 (8ch) should have
FL, FR, FC, LFE, RL, RR, SL, RR in this order, and not
FL, FR, FC, LFE, RL, RR, FLC, FRC.
Anything between RR and SL would be ignored.
This, for example, fixes every single openal game/app with 7.1 sound.
You can actually play minecraft and amnesia without a silly "Front
Left of Center" channel making it's presence known.

The good thing is.. I've come up with a patch that fixes these issues.
But I cant guarantee it's a 100% fix. Fixing WAVEEX can't be done
without guessing what some random app means about "4 channels!" and
swapping REAR for SIDE in 5.0/5.1/6.1 mappings is probably not be the
best way to solve this issue.

If you want to test this, I highly recommend using this little command:
watch "pacmd list-sink-inputs | grep -B 7 client:"
You can easily keep track of what the hell is happening with channel mapping.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_chmap_v3.patch
Type: application/octet-stream
Size: 10037 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20121005/db9270d3/attachment.obj>


More information about the pulseaudio-discuss mailing list