Linux Surround Sound Speaker Position Issue

I’m having issues trying to figure out how to get audio to correctly play out of the surround sound speakers on Linux (specifically Ubuntu 16.04).

I have a test scene that plays a mono sound directly on each of the 5 speakers in order from front left, center, front right, surround right and then surround left. On Windows, the sound plays clearly on that speaker without any bleeding from the other speakers. On Linux however, the behavior is different and depends on the enable-remixing option in pulseaudio. If it is set (as it is by default in Ubuntu), then I would hear the sound that is supposed to play on the surround right speaker on that speaker and the front right speaker. If enable-remixing is disabled, then that sound isn’t heard at all.

I thought about using the SetSpeakerPosition function on Linux as a workaround, but the positions reported on Windows and Ubuntu already match.

I have confirmed that surround sound is enabled and working on Ubuntu by running speaker-test -c6 to play a static sound from all of the speakers individually. Is there something I’m missing in initializing FMOD in code? Or is there some setting in Ubuntu that needs to be changed?

Hi Daniel,

It sounds like there is a mismatch between what FMOD Speaker Mode is initializing as and what your Linux sound card is capable of.

Could you call GetDriverInfo() and see if the speaker mode and the number of speaker channels is matching what FMOD is initializing with?

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_System_GetDriverInfo.html#/

Thanks,
Richard

2 Likes

FMOD does seem to be initializing with the correct driver. My output shows it’s setting up with this driver:
CM106 Like Sound Device Analog Surround 5.1 - Num Channels: 6, Speaker Mode: FMOD_SPEAKERMODE_5POINT1

I seem to have resolved my issue. I’m running on Xubuntu 16.04 and when running 5.1 audio with PulseAudio, it treats the surround speakers as if they were rear-speakers. That in combination with PulseAudio’s automatic remixing to 5.1 channels caused me hear the audio bleeding between the front and rear channels.

To fix the issue, I had to remap the channels so that Linux treated the surround speakers as side speakers instead. I did that by modifying the file called default.conf under /usr/share/pulseaudio/alsa-mixer/profile-sets/. Under the mapping: [Mapping analog-surround-51], I modified the channel maps so it says “side-left,side-right” instead of the default “rear-left,rear-right”.

I don’t know if there is a way for FMOD to account for Linux treating the surround speakers as rear channels instead of side channels under 5.1 audio, but this was the way I was able to solve it.

1 Like

Hi Daniel,

Thanks for the update.

For 5.1 output with PulseAudio we target “side left” and “side right”, which the PA docs describe as “Dolby Surround Left” and “Dolby Surround Right”. Our speaker arrangement is in line with Dolby so this is a natural fit. That said, it looks like the default mapping config files provided with PulseAudio specify “Rear Left” and “Rear Right” which invokes a remixing. After investigating the PulseAudio source, when the speakers don’t match they just average the audio on the left and send it out speakers on the left, and the same for right. They don’t have any concept of speaker angle or placement of their speakers, just the concept of “onRight” or “onLeft”.

In short, FMOD is using the API correctly however PA isn’t redistributing the speakers properly.

It looks like they discussed the idea of fixing it in 2014:

https://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021210.html

Thanks,
Richard

2 Likes