CRI ADX  Last Updated: 2024-07-17 10:47 p
Is there anything to be aware of when using ADX and Sofdec2 together?

Cautions on Library Initialization

(1) Error Callbacks

There can only be one error callback function for all libraries.
If criErr_SetCallback is called multiple times, any callback function registered will be overwritten by the one registered after it.
(If this occurs, the callback function(s) registered earlier will not be called even if an error occurs.)

(2) Initialization Order

The libraries must be initialized in the following order.

  • (1) CRI File System library initialization (criFs_InitializeLibrary)
  • (2) CRI Atom library initialization (criAtomEx_Initialize_*)
  • (3) CRI Mana library initialization (criMana_Initialize_*)
Cleanup processing must be performed in the opposite order of initialization.

  • (1) CRI Mana library cleanup processing (criMana_Finalize_*)
  • (2) CRI Atom library cleanup processing (criAtomEx_Finalize_*)
  • (3) CRI File System library cleanup processing (criFs_FinalizeLibrary)
[Remarks]
You can omit initialization/cleanup of the CRI File System library when using the CRI Atom library.
If initialization of the CRI File System library is omitted, initialization of the CRI File System library is performed in the CRI Atom library.

(3) Thread Framework

You must specify the same thread framework for both the CRI Atom and CRI File System libraries.
When each library is initialized, the same thread framework type (thread model) must be set in the following structure member variables.
  • The thread_model member of the CriFsConfig structure
  • The thread_model member of the CriAtomExConfig structure
[Remarks]
You can set a different thread model from the CRI Atom and CRI File System libraries for the CRI Mana library thread framework.
  • The thread_model member of the LibConfig structure

Resources Shared Between Libraries

(1) Threads

The CRI Atom library server processing thread and CRI File System library server processing thread are the same thread.
If a CRI Atom library thread parameter is changed (e.g., by a function such as criAtomEx_SetThreadPriority_PC), the CRI File System library's server processing thread parameters will also be changed.

(2) Binders

The CRI Atom library uses a binder when an AWB file is loaded.
The CRI File System library must be initialized such that a number of binders equivalent to the number of AWB files loaded can be allocated.
[Caution]
Binders are also required when loading ACB files for stream playback via a function such as criAtomExAcb_LoadAcbFile , in addition to cases when an AWB file is loaded via a function such as criAtomAwb_LoadToc .
(When an ACB file for stream playback is loaded, the corresponding AWB file is also loaded.)

(3) Loaders

The CRI Atom and CRI Mana libraries use the CRI File System library's loaders for stream playback.
When performing stream playback, loaders must be allocated for the number of voices in the voice pool and the number of Mana players in addition to the loaders used to load the files for stream playback.
The following APIs use loaders (CriFsLoaderHn) temporarily when the functions are called.
(Loaders are allocated via the criFsLoader_Create function when these functions are first called.)

- criAtomEx_RegisterAcfFile
- criAtomEx_RegisterAcfFileById
- criAtomEx_GetAcfVersionFromFile
- criAtomEx_GetAcfVersionFromFileById
- criAtomExAcb_LoadAcbFile
- criAtomExAcb_LoadAcbFileById
- criAtomExStreamingCache_LoadWaveformByNameAsync
- criAtomExStreamingCache_LoadWaveformByIdAsync
Adjust the number of loaders so that there is at least one free loader handle when calling any of the above functions.
[Caution]
Of the above API functions, the user must separately handle the destruction of the loader handles returned by the criAtomExStreamingCache_LoadWaveformByNameAsync and criAtomExStreamingCache_LoadWaveformByIdAsync functions.
For all other APIs above, the criFsLoader_Destroy function is called to destroy the loaders at the end of each function call.

(4) Server Processing

The CRI Atom library server processing (criAtomEx_ExecuteMain) and CRI File System library server processing (criFs_ExecuteMain) functions hold the same entities.
Therefore, execute only one of these server processing functions when using the CRI Atom and CRI File System libraries together.
(Executing both functions will perform server processing twice.)
[Caution]
When using with the CRI Mana library, you must also execute the CRI Mana library's server processing (::criMana_ExecuteMain function) in addition to the CRI Atom (or CRI File System) library's server processing.

Streaming Playback Cautions

(1) D-BAS

When performing simultaneous sound and video streaming playback, you must specify the number of streams and maximum bitrate to the D-BAS as the sum for both of these streams.
[Remarks]
When loading data other than sound/movie streaming data, there is no need to add any parameters to the D-BAS when it is created.
Background loading of data through a loader or other means is performed without buffering at any free time during streaming, so there is no need to consider these parameters when creating the D-BAS.

(2) Priorities

Sound and movie streaming is executed at a higher priority than the highest priority that can be set for a loader (CRIFSLOADER_PRIORITY_HIGHEST).
Therefore, streaming playback of a sound and/or movie will not be interrupted even if a large amount of data is attempted to be loaded by a loader.
[Caution]
Loading data occurs frequently while streaming data is being loaded. Therefore, loading data during streaming is slower than when not streaming.