andrewrk / andrewrk/libsoundio

Libsoundio : Software Latency

Ouverte
#153 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
2.1k
Forks
254
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.