andrewrk / andrewrk/libsoundio

Libsoundio : Software Latency

オープン
#153 コメント 2 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。