andrewrk / andrewrk/libsoundio

Libsoundio : Software Latency

未关闭
#153 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
2.1k
派生
254
PR 合并指标
30 天内没有已合并 PR

描述

I did tests with the sio_record program, to which I added the value of the software latency as argument of the main function.
This value is assigned to "instream-> software_latency" before we call ":: soundio_instream_open".
Then I added code to calculate the real latency, inside the function "read_callback (...)", as follows:

Static void read_callback (struct SoundIoInStream * instream, int frame_count_min, int frame_count_max) {
...
static double dLatency = 0.0;
dLatency = (double) (frame_count_max * instream-> layout.channel_count) / instream-> sample_rate;
static double dMaxLatency = 0.0;
static double dMinLatency = 10.0;
dMaxLatency = (dMaxLatency dLatency)? dLatency : dMinLatency;
fprintf (stderr, "Real Latency Max:% f \ nReal Latency Min:% f \ n \ n", dMaxLatency, dMinLatency);
...
}
So I did 5min tests of recording for different values of latency and for two architectures "Linux-armv7l" and "Linux-x86_64". The results of the tests are shown in the following screenshot:
![libsoundio_reallatency_vs_inputlatency](https://cloud.githubusercontent.com/assets/16650002/24718747/1ce5c45e-1a05-11e7-8b07-d3890039096d.JPG)
There is a large variation in latency due to the large difference between the min and max latency for each test.

My questions are :
1) Is this variation in latency normal and if so, what would you expect it to be? Should we not have an approximate value of the desired latency for the min and max latency?
2) Is there a way to control latency?

Thank you for your reply.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。