diff options
Diffstat (limited to 'drivers/alsa/alsa_driver.c')
-rw-r--r-- | drivers/alsa/alsa_driver.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/alsa/alsa_driver.c b/drivers/alsa/alsa_driver.c index f190cbd..ca501e3 100644 --- a/drivers/alsa/alsa_driver.c +++ b/drivers/alsa/alsa_driver.c @@ -1782,9 +1782,15 @@ alsa_driver_latency_callback (jack_latency_callback_mode_t mode, void* arg) if (mode == JackPlaybackLatency) { + /* Playback latency is defined as the maximum time between the data being delivered to the device buffer and it + emerging from the interface, which is dependent on the number of periods and the period size. + */ range.min = range.max = ((driver->playback_nperiods - 1) * driver->frames_per_cycle) + driver->playback_frame_latency; } else { - range.min = range.max = ((driver->capture_nperiods - 1) * driver->frames_per_cycle) + driver->capture_frame_latency; + /* Input latency is defined as the maximum time between the data arriving at the interface and it becoming available to + the CPU, which is always 1 period + */ + range.min = range.max = driver->frames_per_cycle + driver->capture_frame_latency; } for (node = client->ports; node; node = jack_slist_next (node)) |