PulseAudio connection error in unit test on Linux

Hey there,

An automated unit test (that is for Linux I think) on our Github / CI page fails with the following error:

SetUp : Unhandled log message: '[Error] [FMOD] FMOD_PulseAudio_CheckOutputSupport : pa_context_connect returned -1.
'. Use UnityEngine.TestTools.LogAssert.Expect
FMODUnity.RuntimeUtils:DebugLogError (string) (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/RuntimeUtils.cs:582)
FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/RuntimeManager.cs:104)
FMOD.System:setOutput (FMOD.OUTPUTTYPE) (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/fmod.cs:1048)
FMODUnity.RuntimeManager:Initialize () (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/RuntimeManager.cs:330)
FMODUnity.RuntimeManager:get_Instance () (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/RuntimeManager.cs:207)
FMODUnity.RuntimeManager:get_StudioSystem () (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/RuntimeManager.cs:225)
FMODUnity.StudioListener:AddListener (FMODUnity.StudioListener) (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/StudioListener.cs:72)
FMODUnity.StudioListener:OnEnable () (at /project/subprojects/packages/seed-audio-fmod/Plugins/FMOD/src/StudioListener.cs:90)
UnityEngine.GameObject:AddComponent<FMODUnity.StudioListener> ()
Klang.Seed.AudioFMod.AudioFmodWrapper:.ctor (Klang.Seed.AudioFMod.IAudioFmodDataProvider) (at /project/subprojects/packages/seed-audio-fmod/Runtime/AudioFmodWrapper.cs:145)
...

I didn’t have that error before, I just updated the FMOD Unity plugin (from 2.02.03 or sth to 2.02.23), matching the right FMOD Studio version. The plugin is part of a package in Unity being used in multiple projects.

Unity is 2022.3.24f1.

ChatGPT told me that PulseAudio might not be running or is not properly configured on the system where the test is running, or that the test environment might lack necessary permissions, dependencies, or it might be running in an environment where audio is not properly set. How could I do any of these?

What error cause/solution would you see?

I don’t have a Linux computer to test it locally unfortunately. It runs fine locally on Windows and Mac without any errors.

Best,

Julian

Hi,

You appear to be running into a known issue with running FMOD on Linux systems with reduced audio services, which has already been passed on to the development team for further investigation. Another user who ran into the has posted a workaround here: Getting PulseAudio dependency to work in Ubuntu Docker image - #2 by joeanderson

As well as a GitHub repo demonstrating the error and the workaround: Getting PulseAudio dependency to work in Ubuntu Docker image - #4 by joeanderson

I would recommend giving that user’s workaround a try and seeing whether it resolves the issue for you.