Commit 1a8d715c authored by Adrian Knoth's avatar Adrian Knoth
Browse files

[firewire] Introduce UpdateLatencies() in FFADO backend

In preparation for the upcoming FFADO buffersize functionality,
add code that updates the latency afterwards.
parent 00280570
......@@ -253,6 +253,31 @@ JackFFADODriver::ffado_driver_restart (ffado_driver_t *driver)
return Start();
}
void
JackFFADODriver::UpdateLatencies(void)
{
jack_latency_range_t range;
ffado_driver_t* driver = (ffado_driver_t*)fDriver;
for (int i = 0; i < fCaptureChannels; i++) {
range.min = range.max = driver->period_size + driver->capture_frame_latency;
fGraphManager->GetPort(fCapturePortList[i])->SetLatencyRange(JackCaptureLatency, &range);
}
for (int i = 0; i < fPlaybackChannels; i++) {
// Add one buffer more latency if "async" mode is used...
range.min = range.max = (driver->period_size *
(driver->device_options.nb_buffers - 1)) +
((fEngineControl->fSyncMode) ? 0 : fEngineControl->fBufferSize) + driver->playback_frame_latency;
fGraphManager->GetPort(fPlaybackPortList[i])->SetLatencyRange(JackPlaybackLatency, &range);
// Monitor port
if (fWithMonitorPorts) {
range.min = range.max =driver->period_size;
fGraphManager->GetPort(fMonitorPortList[i])->SetLatencyRange(JackCaptureLatency, &range);
}
}
}
int
JackFFADODriver::SetBufferSize (jack_nframes_t nframes)
{
......
......@@ -2,6 +2,7 @@
Copyright (C) 2001 Paul Davis
Copyright (C) 2004 Grame
Copyright (C) 2007 Pieter Palmers
Copyright (C) 2012 Adrian Knoth
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -59,6 +60,7 @@ class JackFFADODriver : public JackAudioDriver
void jack_driver_init (jack_driver_t *driver);
void jack_driver_nt_init (jack_driver_nt_t * driver);
void UpdateLatencies();
public:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment