WP8:仿真器中的XAudio2巨大延迟 [英] WP8 : XAudio2 huge latency in emulator

查看:81
本文介绍了WP8:仿真器中的XAudio2巨大延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我目前正在使用WP8 SDK的原生API,特别是Direct3D和XAudio2。

I am currently toying with native APIs of the WP8 SDK, in particular Direct3D and XAudio2.

我做的尚未拥有WP8真实设备,我正在使用模拟器进行所有开发和测试。

I do not own a WP8 real device yet and I am doing all the development and tests with the emulator.

首先,我对Direct3D部分没有任何问题,它在模拟器中准确,流畅地呈现所以我印象非常深刻。

Firstly, I had no problem with the Direct3D part, it's rendered accurately and smoothly in the emulator, so I'm quite impressed.

现在,关于XAudio部分,我的应用程序需要播放动态生成的声音数据。

Now, about the XAudio part, my app needs to play sound data that is generated dynamically.

所以我已经能够从循环缓冲区播放声音数据,我在XAudio语音的播放光标之前提供。从技术上讲,它工作正常,完全符合我的要求。

So far I have been able to play sound data from a circular buffer that I feed ahead of the play cursor of the XAudio voice. Technically it works fine and does exactly what I want.

问题是:我注意到在模拟器上测试应用程序时,我有很长的延迟。声音播放大约
300 ms 太晚了!这对我的应用程序来说是绝对不可接受的,它需要在
30 - 50 ms 最大值之间的延迟。

The problem is : I notice that I have huge latency when I test my app on the emulator. Sound is played approximately 300 ms too late! It's absolutely unacceptable for my app, it needs to have a latency somewhere between 30 - 50 ms max.

这种滞后似乎没有与我的实现有关,因为我还测试了一个播放预加载的wav文件的示例应用程序(https://skydrive.live.com/?cid=68f2640a052556e2&id=68F2640A052556E2%212379),我得到类似的令人发指的~300毫秒延迟
模拟器......

This lag doesn't seem to be related to my implementation because I also tested a sample app which plays preloaded wav files (https://skydrive.live.com/?cid=68f2640a052556e2&id=68F2640A052556E2%212379), and I get similar outrageous ~300 ms latency in the emulator...

那么,你能告诉我一个真实的设备情况是否更好?或者,如果我可以对模拟器进行一些调整?

So, can you tell me if the situation is better with a real device? Or if there are some tweaks I could do with the emulator?

如果情况与真实设备相同,我想我必须切换到WASAPI :(

If the situation is the same with a real device, I guess I'd have to switch to WASAPI :(

推荐答案

仅供参考,模拟器是一个不同的生物而不是真正的设备;例如它是基于X86而设备是ARM,音频机制使用驱动程序与PC的接口,这与ARM硬件完全不同。我认为这将是有意义的
使用真实硬件进行测试。

FYI, the emulator is a different creature than a real device; for example it is X86-based while the device is ARM, and the audio mechanism uses driver interfaces to the PC which is quite different from the ARM hardware.  I think it would make sense to test with real hardware.

-Mark


这篇关于WP8:仿真器中的XAudio2巨大延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆