CRI ADX  Last Updated: 2024-07-17 10:47 p
Check whether streaming is working

Isolate the cause of the issue

If there is an issue with the sound output when performing streaming playback, it does not always mean that the issue comes from the streaming itself. Please check the other possible causes.
If possible, change the data set from streaming playback to in-memory playback and rebuild the data, then check if this solved the issue.
If the issue occurs again, it may due to other ADX features instead of streaming. Check again the troubleshooting methods with in-memory playback.
Otherwise, if the issue disappears when switching to in-memory playback, the likely cause is streaming. Refer to the following section and confirm whether there are any issues with the streaming playback.

Obtaining the amount of data remaining in the streaming buffer.

When a streaming issue occurs, the cause can sometimes be identified by checking the data left in the streaming buffer. To do so, you can use the criAtomPlayer_GetInputBufferRemainSize function. For details about how to use this function, refer to Acquiring the Amount of Buffering .
Normally, the amount of data left in the streaming buffer will not be zero during streaming playback. If it reaches zero, it may be due to the issues that prevents the streaming data from loading, or hamper the ADX audio processing at regular intervals.

Blocked Streaming Data Loading

During streaming playback, the data required is constantly being read from the storage media. If the storage media cannot be accessed during playback, the data supply may be cut off and the sound will be intermittent.
The reasons why ADX may not be able to access the storage media are:
  1. If using an optical media, the disc is being ejected.
  2. If using network streaming, the connection is lost or the server is down.
  3. The application does not use the CRI File System API to read and write data.
  4. ADX audio processing is not executed.
  5. If the application is using the CRI File System API to load the data, processing is blocked in the load completed callback function.

Ejected Disc

If the disc or the storage media is removed, data can no longer be loaded. Refer to the development guidelines for each platform about how to perform error handling in your application when the disc is ejected. Please note that some platforms will forcibly end the application, while others will automatically resume the operation once the disc is reinserted.

Network Disconnection or Server Outage

ADX cannot be used to determine if the network connection is lost or if the server is down. Use network inspection tools to determine the cause of the disconnection or when the host server is down.

Application-specific Data Loading / Writing

Note that your application needs to use the CRI File System API to read and write data properly.
Generally, only one process or thread can access any given storage media at a time. If multiple read / write requests are issued to the storage media, the system will process the requests based on the order in which they were received.
If you use the CRI File System API to read and write data, the CRI File System library will set a priority for all requests and break down these requests into constant size chunks. Therefore, if your application uses the CRI File System API to load a large amount of data, the loading of streaming-related data will be executed prior to the loading of other data requested by your application.
However, if your application does not use the CRI File System API to read and write data, read and write requests will not be given a priority and the requests will not be broken down to load / write smaller chunks of data. This means that if your application requests to load a large amount of data, ADX streaming will be blocked until the requested data is completely loaded, resulting in insufficient data being loaded for streaming.

ADX audio processing is not being executed

In this case, the application will be unable to confirm when the loading has finished or to update the status of the streaming buffer, which will result in insufficient streaming data being loaded.
To check whether this issue is happening in your application, refer to Server Checking Processing Execution.

The CRI File System's load completed status is being blocked in the callback function

Check the implementation of the load completed callback function you registered in your application and determine if there is any code causing an infinite loop, locking the thread, or resulting in the thread being put to sleep for an extended period of time.
When using the loader of the CRI File System library to load data, you can register a load completed callback to notify your application when the loading has finished (instead of using status polling).
If this callback results in an infinite loop or a long period during which the thread is sleeping, or its processing takes time, all subsequent load requests will have to wait until the function finishes. This includes the streaming data load requests issued internally by ADX.

Other Troubleshooting

If the procedures described above cannot resolve the issue, it may due to something preventing ADX from loading the streaming data. Use the CRI File System library's file access log feature to obtain a log of the file access.
For details about how to obtain a file access log, refer to Tutorial 5: Outputting a file access log and File Access Log Viewer in the CRI File System FileMajik PRO Manual.