最終更新:2021-01-09 (土) 13:59:34 (1196d)
ALSA/バッファ
リングバッファ
- 再生位置
- 転送位置
用語
avail
- 空いたバッファ全体
delay
- まだ再生していない音声データの長さ
メモ
- avail+delay=バッファ
バッファ
- リングバッファ全体のこと
- snd_pcm_hw_params_get_buffer_size: 1048576 frames (1024*1024)
ピリオド
- 一度に書込み可能な区間の長さ
- periodsize * period = buffer size
- snd_pcm_hw_params_get_periods: 1024 frames
- snd_pcm_hw_params_get_period_size: 1024 frames
- レイテンシ:latency = periodsize * periods / (rate * bytes_per_frame)
- There should be at least two periods per buffer
フレーム (4バイト)
- 2サンプル (L+R)
サンプル (2バイト)
- MSB,LSB