Re: [闲聊] HTPC/CAT建构的自身经验

楼主: Oswyn (Oswyn)   2020-03-17 21:39:03
: → alanswill: 看不懂QQ,不过我在网络上查到的都是说event比push还要 03/16 06:39
: → alanswill: 新? 03/16 06:39
Sorry 漏看了回复
这问题很复杂,首先M$自己就用了一堆不同的名词来表示或说明 WASAPI 的工作模式
event-driven、timer-driven、event-driven (pull) mode、pull mode
有时用这个有时用那个,不去细看其工作方式很容易搞错
像 WASAPI (push) 为什么要叫 push 我到现在还搞不懂,因为文件中有叫 pull mode
所以另一个就是 push 吗,哪为什么 WASAPI (event) 不叫作 WASAPI (pull) ...
※ 从名称中是谁推谁谁拉谁、十分让人混淆
网上有些查到的 WASAPI 说明是错误的,因为名称太乱实在很容易搞混
因为狗出来不同来源的说明有完全相反或不合理的状况
所以我是花了不少时间去挖 Windows Audio team 的软件工程师 Matthew van Eerde
在官网论坛及 Blog 的回复与发文及比对 Windows Core Audio APIs 的文件
得出来的结论,因为我有比对 WASAPI output support 两个模式的工作特性
个人是对这个结论满有信心的啦XD 虽然我很想说“相信我吧”但8成7吧XD

@Matthew van Eerde's web log
HD Audio buffer allocations must be a multiple of 256 bytes. For timer-driven
buffers, this applies to the whole buffer. For event-driven buffers, this
applies to the sum of the “ping” and “pong” buffers, so the individual “
ping” or “pong” buffer must be a multiple of 128 bytes.

foobar WASAPI output support 的模式也改过几次模式名称
可以去查其 version history,3.0 中有一条
Operates in two different modes, regular and event-driven - the latter seems
to be more compatible with USB devices, but not supported by some other
devices.
因为 foo_out_wasapi 的作者也是 foobar 的开发者 Peter 本来好像只实作了一个模
式也就是 WASAPI 默认的环形缓冲,需要 DMA 与一些其它的硬件功能支援
因为 WASAPI 是 Windows Vista 打掉旧的重写的新 Audio 核心中的低层 API
所以这也就是说硬件需要有 Windows Vista 相容,但一些旧硬件(大多是USB)...
因为有部分使用者回报错误无法顺利播放
所以作者就补了使用乒乓缓冲的 event-driven 模式
以 foo_out_wasapi 开发的角度来看,“event”是比较新加入的模式没错,但是为了
相容性所补上的较原始的技术
所以环形缓冲称为“regular”但后来改成“push”
这样解释可以看得懂吗,可能有点乱啦
补个 Peter 对 WASAPI 的发言
Event mode in fact provides worse protection against CPU usage spikes than
push mode (as seen in earlier versions of this plug-in) because we queue less
data with the driver at a time and must wake up and send more data at regular
intervals. However, event mode seems necessary to peacefully cooperate with
certain devices, USB ones in particular.
硬件没问题 push mode 可用没什么理由不用 push mode
且 push mode 会出问题的硬件主要是对 Windows Vista 的相容性有问题
现在都民国几年了,Vista 都要 two decades 了...
作者: yenchieh1102 (香蕉史塔克)   2020-03-17 22:19:00
专业推
作者: purplesky911   2020-03-17 22:20:00
感谢~
作者: djboy (雞尾酒)   2020-03-17 22:33:00
认真推
作者: asdfg0612 (青蛙)   2020-03-17 23:08:00
感谢分享
作者: goldie (阿良)   2020-03-17 23:10:00
专业推
作者: clioneurise (Romarin)   2020-03-18 02:15:00
作者: jan06010504 (3RD)   2020-03-18 02:18:00
想问一个似乎很基本的问题,在foobar output页面设定的buffer,跟在advance 页面下的wasapi选项设定的Hardware buffet in MS有什么差别呢?
作者: alanswill (小夫)   2020-03-18 04:19:00
感谢您的回复,认真推~
作者: jan06010504 (3RD)   2020-03-18 18:52:00
感谢解答,这样比较有概念了
作者: capri75 (capri)   2020-03-19 00:32:00
推专业分享
作者: lll156k1529 (吃鸡腿)   2020-03-20 00:08:00

Links booklink

Contact Us: admin [ a t ] ucptt.com