andrewrk / andrewrk/libsoundio
Libsoundio : Software Latency
- 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:

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.