Multiple Listeners Broken

I updated to version 4.11 and had to notice that in a splitscreen enviroment only the first player (viewport) receives sounds. The other players are muted.

I also tried with ‘Create Audio Device for Every Player’ checked (Located under Editor Preferences/Play/Multiplayer Options), but it didn’t work.

This was not the case in the previous versions.

You can check this issue by placing a sound source with attenuation and alternately walk the players into the source. Only with Player 1 there will be audio playback.

Hey ,

I just tested what you are reporting and did not get the same results. I enabled the ‘Create Audio Device for Every Player’ and also the ‘Route 1st Gamepad to 2nd Client’. I then pressed play in the viewport and was able to hear sounds on each respective viewport window.

Could you provide me with some steps to reproduce the issue on my end?

Cheers,

Thank you very much Mr. for taking the time. It’s good to hear that this feature still works!

I even tested it in a new project to ensure that it doesn’t work. I guess there is an error on my part. I’ll take a closer look what could be wrong and report back.

You are welcome. Let me know if you are still unable to get it to work properly. Perhaps you are overlooking a setting or a checkbox. I know that happens to me sometimes :slight_smile:

When you say you are using splitscreen – are you talking about multiple PIE windows? There is a difference between the two. Splitscreen uses one PIE window and multiple listeners will be set and updated. In the case of splitscreen, sounds should spatialize themselves (panning and distance attenuation) relative to the nearest listener. To be honest, I don’t know how to actually create a splitscreen game in UE4 so would have to find somebody who knows how to confirm this is working. Andrew, do you know how to do that?

As for the other way, multiple PIE windows, what happens is an audio device is created unique for each PIE window. In that case, the audio for the currently active (in-focus) window plays by default while the background window does not play audio (i.e. it’s actually playing, but is muted). When you tab between the PIE windows, you should hear the audio for each. You can “solo” one window so that when you tab out you’ll still hear the audio, to do that use the console command “SoloAudio” on the window you want to solo.

Thank you MinusKelvin for helping out.

Well, I hope Mr. and I haven’t talked about different cases! When I said splitscreen, I was in fact talking about old school splitscreen, where one game instance is running and up to 4 local players can play.

You can enable this when you activate it under ‘Project Settings/ Local Multiplayer/ Use Splitscreen’. Now you create in your level blueprint an event ‘begin play’ and add the node '‘Create Player’.

With the console command ‘SSSwapControllers’ you can switch between the players.

I somehow saw strange behaivours: Sometimes I had sounds playing for the second player, but only if the camera was looking towards the first player.
Edit: That was a wrong observation: If the second player is near enough the first player, but the audio listener (the camera) is in the audio source, the sound is hearable. But if the second player is not near the first player there are no sounds to hear.

Maybe it has to do something with the new audio focus system, I’m not so sure.

(at)AndrewHurley:
I couldn’t find what could be wrong and thus created a test level to download:

https://dl.dropboxusercontent.com/u/78559347/SoundTest.rar

I have setup the splitscreen and placed a fire soundeffect in the area and added footsteps. Just press ‘Num 0’ to quickly change to the different players while playing.

Hope it helps

I will test the project you provided and return with my test results. I do now how to set up splitscreen, but was not sure that was the multiplayer set up you were using.

Hey ,

Thanks for sending us the test project. Was able to reproduce the issue and come up with a fix. I’ll try and get it approved for 4.11.2 since it’s a pretty simple fix. If you need it ASAP, the change is to simply move the code that transform’s sound positions relative to primary listener until after distance attenuation is calculated:

At first, I thought the issue was that the Listener used in that transform block was from 0 and not ClosestListenerIndex. That indeed did fix the attenuation issue (since it was actually a no-op) but the panning was incorrect. The above fix fixes both distance attenuation and panning for multiple listeners.

Thank you very much MinusKelvin for the quick fix! That helped a lot.

Hint: The code which MinusKelvin mentions can be found in the ‘ActiveSound.cpp’ file.