看板 Headphone 關於我們 聯絡資訊
: → 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 了... -- 人間五十年、化天のうちを比ぶれば、夢幻の如くなり ^,,,^ 一度生を享け、滅せぬもののあるべきか (ω)\m/ NOBUMETAL DEATH!!('ω') -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.24.173.235 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Headphone/M.1584452346.A.DA6.html 再補些 Matthew van Eerde 幫人除錯與 WASAPI 有點相關的回復 3.6 milliseconds is quite small. Even a high-priority thread can be held off by a long-running ISR/DPC; the Windows Assessment Toolkit contains some tools you can use to take traces and see why your thread is getting held off.
yenchieh1102: 專業推 03/17 22:19
purplesky911: 感謝~ 03/17 22:20
djboy: 認真推 03/17 22:33
asdfg0612: 感謝分享 03/17 23:08
goldie: 專業推 03/17 23:10
clioneurise: 推 03/18 02:15
jan06010504: 想問一個似乎很基本的問題,在foobar output頁面設定 03/18 02:18
jan06010504: 的buffer,跟在advance 頁面下的wasapi選項設定的Har 03/18 02:18
jan06010504: dware buffet in MS有什麼差別呢? 03/18 02:18
foobar output 的 buffer 可視為 foobar 自己的 buffer WASAPI 的 buffer 是 WASAPI 的 buffer(被打 很多 buffer、萬物皆有 buffer 程式也有自己的 buffer 當然硬體也有 之間還有 Endpoint buffer foo_out_wasapi 的 buffer 就是 Endpoint 間的 buffer,是程式跟 Driver 間的橋樑 foobar Output 的 buffer 是 foobar 拿來放 audio data 用的 讀檔(Advanced\Playback\Buffing)>解碼(decoder 會自己開 party)>PCM AUDIO 這 PCM AUDIO 應是 32-bit 浮點、會先受 foobar Playback 頁的 ReplayGain/Preamp 的影響(如果有啟用的話) 然後進到 foobar DSP chain、Active DSPs 會照順序上工(如有) 處理完的資料就是放到 foobar output 的 buffer 然後等著 Output Device 來推或拉貨、在這就是 foo_out_wasapi / ASIO / DS
alanswill: 感謝您的回覆,認真推~ 03/18 04:19
stue1202: 專業人士 03/18 08:06
jan06010504: 感謝解答,這樣比較有概念了 03/18 18:52
然後據說 ASIO 的實作多半是環形緩衝(笑 還有一點是 WASAPI 並不是驅動程式、它只是一個 API 這個 API interface 對接過去的才是 Windows audio driver 實際上工作的是 driver 在這裏的環形緩衝就是 WaveRT Miniport Driver 然後這個 driver 再接到 Audio Device 的 driver 才連到 H/W 所以這只是許多關卡中的一關 Audio H/W 實際上傳遞資料並不由這裏的 buffer 大小設定直接左右 以 USB Audio 來說、USB Audio Class 有自己的 Protocol、Packet size End-User 沒法直接干涉這塊 這就像你只是個搬菜的小學徒 但在備料區沒缺料的狀況下、小學徒怎麼搬會影響到大廚的出菜品質嗎? ※ 編輯: Oswyn (220.129.177.54 臺灣), 03/18/2020 20:05:45
capri75: 推專業分享 03/19 00:32
lll156k1529: 推 03/20 00:08