WASAPI IAudioClient::Initialize long ~500ms delay

Sviatoslav Romankiv 10 Reputation points
2023-02-07T14:16:49.38+00:00

Experiencing long delays (-500ms) delays when calling IAudioClient::Initialize.

The issue is reproducible using WASAPIRendering sample application from https://github.com/microsoft/Windows-classic-samples after running app and selecting "2. default media device":

User's image

Intel Vtune profiler shows that all this time is spent inside some RPC call:

User's image

Sound devices info:

Name	Realtek Audio
Manufacturer	Realtek
Status	OK
PNP Device ID	INTELAUDIO\FUNC_01&VEN_10EC&DEV_0236&SUBSYS_10280A20&REV_1000\5&4790050&0&0001
Driver	C:\WINDOWS\SYSTEM32\DRIVERS\RTKVHD64.SYS (6.0.9261.1, 6.24 MB (6,548,024 bytes), 2/27/2022 4:26 PM)
	
Name	Intel® Smart Sound Technology for USB Audio
Manufacturer	Intel(R) Corporation
Status	OK
PNP Device ID	INTELAUDIO\CTLR_DEV_A0C8&LINKTYPE_06&DEVTYPE_06&VEN_8086&DEV_AE50&SUBSYS_0A201028&REV_0001\0601
Driver	C:\WINDOWS\SYSTEM32\DRIVERSTORE\FILEREPOSITORY\INTCUSB.INF_AMD64_2F4C83F014FFDAEE\INTCUSB.SYS (10.24.0.6815, 862.16 KB (882,848 bytes), 11/30/2021 2:33 AM)

System info:

OS Name	Microsoft Windows 10 Pro
Version	10.0.19045 Build 19045
Other OS Description 	Not Available
OS Manufacturer	Microsoft Corporation
System Name	LWO1-LDL-A15808
System Manufacturer	Dell Inc.
System Model	Latitude 5420
System Type	x64-based PC
System SKU	0A20
Processor	11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz, 1805 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date	Dell Inc. 1.15.1, 12/20/2021
SMBIOS Version	3.2
Embedded Controller Version	255.255
BIOS Mode	UEFI
BaseBoard Manufacturer	Dell Inc.
BaseBoard Product	054CCV
BaseBoard Version	A00
Platform Role	Mobile
Secure Boot State	Off
PCR7 Configuration	Binding Not Possible
Windows Directory	C:\Windows
System Directory	C:\Windows\system32
Boot Device	\Device\HarddiskVolume1
Locale	Ukraine
Hardware Abstraction Layer	Version = "10.0.19041.2251"
User Name	SYNAPSE\sviatoslav.romankiv
Time Zone	FLE Standard Time
Installed Physical Memory (RAM)	16.0 GB
Total Physical Memory	15.4 GB
Available Physical Memory	641 MB
Total Virtual Memory	28.4 GB
Available Virtual Memory	7.33 GB
Page File Space	13.0 GB
Page File	C:\pagefile.sys
Kernel DMA Protection	Off
Virtualization-based security	Not enabled
Device Encryption Support	Reasons for failed automatic device encryption: PCR7 binding is not supported, Un-allowed DMA capable bus/device(s) detected, WinRE is not configured
Hyper-V - VM Monitor Mode Extensions	Yes
Hyper-V - Second Level Address Translation Extensions	Yes
Hyper-V - Virtualization Enabled in Firmware	Yes
Hyper-V - Data Execution Protection	Yes

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,689 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 10,041 Reputation points Microsoft Vendor
    2023-02-08T02:34:07.14+00:00

    Hello,

    Welcome to Microsoft Q&A!

    I suggest you could feedback the issue base on the document link.

    User's image

    If you want to resolve this issue as soon as possible, you can open an incident via 'Contact us' tab at link below: https://developer.microsoft.com/en-us/windows/support/

    Please choose the 'Technical Support - Coding/Debugging' for Windows SDK for this issue. In-addition, if the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged.

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Ruurd Adema 0 Reputation points
    2023-11-21T13:44:12.36+00:00

    Cross reference to the JUCE forum about the same issue:

    https://forum.juce.com/t/wasapi-2-3s-delays-on-creating-audio-devices/54971/7

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.