I can confirm the fix for this is in the upcoming release 2.02.23.
Hello.
I’m hitting the same initialization errors, leading to banks not being copied to the StreamingAssets folder. Using FMOD 2.03.04 and Unity 2022.3.40.
The build process is invoked in batch mode by a Jenkins instance running on a Windows 10 machine. Jenkins is started as a Windows service using a regular user account.
Replacing the code in EditorUtils.CreateSystem()
as instructed above didn’t yield any result.
I managed to work around the issue by adding a Jenkins step that copies the banks before invoking Unity and adding the FMODStudioCache asset to version control (which was previously ignored according to the documentation recommendations).
Are you able to share the full output log containing the errors you are getting?
Sure, here’s a log from a build before I implemented my workaround.
Password is S6njsHEBgo
(I can’t attach files to the post since I’m considered a new user)
Apologies for the delay, I believe this is actually more related to batch mode as it appears to be calling into the editor code of the plugin, which then wants to use the editor FMODSystem to recreate the cache assets.
https://www.fmod.com/docs/2.03/unity/user-guide.html#building-assetbundles
Hello, same apologies here.
FMOD is not configured to load from Asset Bundles but from the StreamingAssets folder.
The documentation you linked says to call theEventManager.CopyToStreamingAssets()
method before building but if you look at the log I provided it’s called during the build. Furthermore, this method relies on the cache being properly populated, but it is its initialization/refresh that causes the errors (they appear in the log before the call to CopyToStreamingAssets()
)
Hi,
Again, apologies for the delayed response.
Unfortunately, I was not able to reproduce the issue.
Thank you for the information.
Having another look through the logs I found:
XXXX\RandomUnitsMovement.cs(5,40): error CS0246: The type or namespace name 'UnitsMovementBaseEffect' could not be found (are you missing a using directive or an assembly reference?)
Which may be contributing to the issue?
Could I get some more information about the machine you are running the builds on? If you create a empty Unity project with FMOD installed do you experience the same issues?
Thanks
Hello.
The error you spotted is weird as the build completes successfully. Either way it’s unrelated, building an empty project with the same Unity and FMOD versions (2022.3.40f1 & 2.03.04) results in the same errors and the banks not being copied.
Again the build is invoked by Jenkins running as a Windows service under a regular user account. When manually building that same project by a human (opening the project in Unity and clicking the Build button in the Build Settings window) on the same machine under the same account it works correctly.
Jenkins version is 2.492.2.
You’ll find in this folder a zip file containing the aforementioned empty project and Jenkins pipeline file, a build log, the result of the systeminfo
command (sorry it’s in French and the encoding is broken) and some screenshots of the Jenkins service properties (again in French). Password is YTpQo9bQpK
. Feel free to ask if you need the result of some specific command.
Thank you for the information.
We have found issues in the past running Jenkins as a service. Would it be possible to try running it as a foreground process started as a regular user?
It works when Jenkins is run as a foreground process. Nevertheless this still feels like a workaround and thus not a satisfying solution, as we’re losing process management capabilities applicable to Windows services.
I’m probably missing something but why would an audio output device need to be initialized just to be able to list and copy files?
Thank you for testing that.
I agree this is not a solution.
Something that may trigger FMOD to initialize is if it identifies a difference in its cached banks. However, we should be gracefully handling a failed initialization.
We are seeing
FMOD Studio: Encountered Error: ERR_OUTPUT_INIT Error initializing output device.
Would it be possible to enable API logging to retrieve some more information about this error:
Again, thank you for your assistance in investigating the issue.
Complaint about this forum: my posts with links have been flagged as spam, and I am now unable to post links to my company’s hosting software. And since I’m still considered a new user I can’t add attachments to my posts.
I have restored your posts, the forum anti-spam bot is quite sensitive, I’ll see if I can calm it down.
Thank you and apologies for the issues with the forums.
I can see in the new logs is the update cache function is triggering the creation of the FMOD editor system:
FMOD: Event cache is missing or in an old format; creating a new instance.
Start importing Assets/Plugins/FMOD/Cache using Guid(7737a8fed11446a488318b920d1fa991)
FMOD Studio: Creating editor system instance
FMOD Studio: Encountered Error: ERR_OUTPUT_INIT Error initializing output device.
Unfortunately, I am still unable to reproduce the issue on my end.
Could I please grab the fmod_editor.log
which should be found in the base of your Unity project directory e.g.:"D:\UnityProjects\Project\fmod_editor.log"
Hopefully, this should tell us what outputs FMOD is attempting:
[LOG] system_create : Header version = 2.03.06. Current version = 2.03.06.
[LOG] Manager::init : maxchannels = 256 studioflags = 00000006 flags 00000000 extradriverdata 0000000000000000.
[LOG] SystemI::init : Initialize version=20306 (149358), maxchannels=256, flags=0x00020000
[LOG] SystemI::setOutputInternal : Setting output to 'FMOD WASAPI Output'
Hello. Here’s the full content of the fmod_editor.log
:
[LOG] system_create : Header version = 2.03.04. Current version = 2.03.04.
[LOG] Manager::init : maxchannels = 256 studioflags = 00000006 flags 00000000 extradriverdata 0000000000000000.
[LOG] SystemI::init : Initialize version=20304 (147563), maxchannels=256, flags=0x00020000
[LOG] SystemI::setOutputInternal : Setting output to 'FMOD WASAPI Output'
[LOG] OutputWASAPI::init : Mix Format (WAVEFORMATEX): wFormatTag=0xFFFE, nChannels=2, nSamplesPerSec=48000, nAvgBytesPerSec=384000, nBlockAlign=8, wBitsPerSample=32, cbSize=22.
[LOG] OutputWASAPI::init : Mix Format (WAVEFORMATEXTENSIBLE): wValidBitsPerSample=32, dwChannelMask=0x00000003, SubFormat=00000003-0000-0010-8000-00AA00389B71.
[ERR] OutputWASAPI::init : IAudioClient::Initialize returned 0x800706BE.
[LOG] SystemI::closeInternal : Closed.
[LOG] LiveUpdate::release :
[LOG] LiveUpdate::reset : Reset connection (reason Disconnected)
Hope this helps, and thank you for trying to resolve this issue.
Thank you very much,
Unfortunately, the error IAudioClient::Initialize returned 0x800706BE.
may be related to windows updates or remote procedures: Steam Community.
We could try forcing FMOD to FMOD Engine | Core API Reference - FMOD_OUTPUT. We will need to change EditorUtils.cs
under line 541
:
private static void CreateSystem()
{
RuntimeUtils.DebugLog("FMOD Studio: Creating editor system instance");
RuntimeUtils.EnforceLibraryOrder();
FMOD.RESULT result = FMOD.Debug.Initialize(FMOD.DEBUG_FLAGS.LOG, FMOD.DEBUG_MODE.FILE, null, "fmod_editor.log");
if (result != FMOD.RESULT.OK)
{
RuntimeUtils.DebugLogWarning("FMOD Studio: Cannot open fmod_editor.log. Logging will be disabled for importing and previewing");
}
CheckResult(FMOD.Studio.System.create(out system));
FMOD.System lowlevel;
CheckResult(system.getCoreSystem(out lowlevel));
// New lines to force no sound
CheckResult(lowlevel.setOutput(FMOD.OUTPUTTYPE.NOSOUND));
If this is able to build, we could look into forcing no sound on CI builds.
Please note, auditioning FMOD events in the editor will now work while this is set. To trigger the change, you can either delete the FMODStudioSettings
object or rebuild banks.
Thanks
I’m not sure I understand your last sentence, so I removed everything in the Jenkins workspace to force it to pull and fully reimport the Unity project.
I’m pretty sure I already tested adding this NOSOUND
, but maybe it was done too late back then. Regardless, it seems to work now. I have no error in the logs (both Unity’s and FMOD’s), and the banks are properly copied to the StreamingAssets folder.