Audiokinetic Wwise Knowledge Base

Performing unbuffered I/O on Windows

The CAkDefaultIOHookDeferred low-level I/O hook sample (located in WWISESDK/samples/SoundEngine/Windows/) opens files with FILE_FLAG_NO_BUFFERING and FILE_FLAG_OVERLAPPED flags. These flags, combined with correctly aligned memory, give optimal unbuffered I/O performance according to the Windows' documentation (refer to ::CreateFile()'s documentation for more details, where FILE_FLAG_NO_BUFFERING is described).

In order to ensure that I/O buffers that are passed to the low-level I/O hook's Read() function are always correctly aligned, you need to
1) Allocate a streaming I/O pool that is aligned to the disk's sector. By default, the streaming I/O pool creation will end up calling the AK::VirtualAllocHook memory hook. See this article for more details.
2) Declare a block size that is a multiple of the disk's sector size. This is done by returning the proper value in your implementation of AK::StreamMgr::GetBlockSize() (see CAkDefaultIOHookDeferred::GetBlockSize()).




Article Details

Last Updated
4th o March, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Continue