コミュニティQ&A

Audiokineticのコミュニティ主導のQ&Aフォーラムへようこそ。ここはWwiseとStrataのユーザのみなさまがお互いに協力し合う場です。弊社チームによる直接のサポートをご希望の場合はサポートチケットページをご利用ください。バグを報告するには、Audiokinetic LauncherのBug Reportオプションをご利用ください。(Q&AフォーラムではBug Reportを受け付けておりませんのでご注意ください。専用のBug Reportシステムをご利用いただくことで、バグの報告が適切な担当部門に届き、修正される可能性が高まります。)

最適な回答を迅速に得られるよう、ご質問を投稿される際は以下のヒントをご参考ください。

  • 具体的に示す:何を達成したいのか、またはどんな問題に直面しているのかを具体的に示してください。
  • 重要な詳細情報を含める:Wwiseとゲームエンジンのバージョンやご利用のOSなど詳細情報を記載してください。
  • 試したことを説明する:すでに試してみたトラブルシューティングの手順を教えてください。
  • 事実に焦点を当てる:問題の技術的な事実を記載してください。問題に焦点を当てることで、ほかのユーザのみなさまが解決策を迅速に見つけやすくなります。

0 支持
I'm working on PS4 and during profiling it's noted that the wwise threads occupy core #0, I want to prevent this happening.

Finding documentation is sparse, to say the least and it's not documented really at all in the wwise documentation I've been able to find. So far, I've got this:

        AkPlatformInitSettings platformSettings = new AkPlatformInitSettings();
        AkSoundEngine.GetDefaultPlatformInitSettings(platformSettings);
        uint allCoresExcept0 = 0xfffffffe;
        platformSettings.threadLEngine.dwAffinityMask = allCoresExcept0;
        platformSettings.threadMonitor.dwAffinityMask = allCoresExcept0;
        platformSettings.threadOutputMgr.dwAffinityMask = allCoresExcept0;
        platformSettings.threadBankManager.dwAffinityMask = allCoresExcept0;

The whole platformSettings parameter is only read from the engine, how do I get it to be applied before initialization?
Brian W. (100 ポイント) General Discussion

回答 1

0 支持
> Finding documentation is sparse, to say the least and it's not documented really at all in the wwise documentation

The documentation is fine any further detail would only serve to teach people how thread affinity works in addition to where to specify the mask for each thread and is therefore outside the scope of the Wwise SDK documentation.

> I've been able to find. So far, I've got this:

That code looks fine and the mask is correct - although as a matter of taste you might consider ~0x1 to be clearer - what you are missing is to specify these settings in the call to AkSoundEngine.Init.

Also note that the stream manager's devices create threads. If you wish to ensure that all the Wwise created threads do not run on cpu0 specify the affinity mask here also.
Dan M. (2.6k ポイント)
Actually, it would have to be ~(uint)0x01 :) I picked the bitmask, just for preference right now.
"any further detail would only serve to teach people how thread affinity works". Isn't that the point of documentation?


For future reference, here is my fix.

AkWwiseInitializationSettings.cs, inside InitializeSoundEngine()

    public static bool InitializeSoundEngine()
    {
#if UNITY_EDITOR
        Instance.ActiveSettingsHash = GetHashOfActiveSettings();
        Instance.ActiveSettingsHaveChanged = true;
#endif

        AkInitializationSettings settings = ActivePlatformSettings.AkInitializationSettings;
        uint allCoresExcept0 = ~(uint)1;
        settings.platformSettings.threadLEngine.dwAffinityMask &= allCoresExcept0;
        settings.platformSettings.threadMonitor.dwAffinityMask &= allCoresExcept0;
        settings.platformSettings.threadOutputMgr.dwAffinityMask &= allCoresExcept0;
        settings.platformSettings.threadBankManager.dwAffinityMask &= allCoresExcept0;

        if (AkSoundEngine.Init(settings) != AKRESULT.AK_Success)
> Actually, it would have to be ~(uint)0x01 :)

Actually, no it wouldn't.

https://godbolt.org/z/SkRHnF
https://en.cppreference.com/w/c/language/integer_constant
Dan, when I try the statement "uint allCoresExcept0 = ~1", I get an error from the compiler saying "Constant value '-2' cannot be converted to uint".

Anyway, Problem solved. Thanks for the help.
...