Questions et réponses de la communauté

Bienvenue sur le forum de questions et réponses d'Audiokinetic, propulsé par la communauté. C'est l'endroit où les utilisateurs de Wwise et Strata s'entraident. Pour obtenir une aide directe de notre équipe, veuillez utiliser la page « Tickets de soutien ». Pour signaler un bug, utilisez l'option Bug Report dans l'Audiokinetic Launcher. (Veuillez noter que les rapports de bug soumis au forum questions-réponses seront rejetés. L'utilisation de notre système de rapport de bug dédié garantit que votre rapport est vu par les bonnes personnes et a les meilleures chances d'être corrigé.)

Pour obtenir rapidement les meilleures réponses, suivez ces conseils lorsque vous posez une question :

  • Soyez précis : qu'essayez-vous de réaliser ou quel est le problème spécifique que vous rencontrez ?
  • Pensez à inclure les détails importants : incluez des détails tels que les versions de Wwise et du moteur de jeu, le système d'exploitation, etc.
  • Expliquez ce que vous avez essayé de faire : indiquez aux autres les mesures que vous avez déjà prises pour essayer de résoudre le problème.
  • Concentrez-vous sur les faits : décrivez les aspects techniques de votre problème. Se concentrer sur le problème aide les autres personnes à trouver rapidement une solution.

0 votes
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?
dans General Discussion par Brian W. (100 points)

1 Réponse

0 votes
> 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.
par Dan M. (2.6k points)
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.
...