Commit 17a6c17c authored by sletz's avatar sletz
Browse files

Fix FFADO and Freebob drivers

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2296 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 4d326e4f
......@@ -2268,8 +2268,9 @@ int JackAlsaDriver::Stop()
int JackAlsaDriver::Read()
{
/* Taken from alsa_driver_run_cycle */
int wait_status;
int wait_status;
jack_nframes_t nframes;
fDelayedUsecs = 0.f;
nframes = alsa_driver_wait((alsa_driver_t *)fDriver, -1, &wait_status, &fDelayedUsecs);
......
......@@ -40,8 +40,7 @@ class JackAlsaDriver : public JackAudioDriver
private:
jack_driver_t* fDriver;
jack_time_t fDelayedUst;
void alsa_driver_release_channel_dependent_memory(alsa_driver_t *driver);
int alsa_driver_check_capabilities(alsa_driver_t *driver);
int alsa_driver_check_card_type(alsa_driver_t *driver);
......@@ -153,9 +152,7 @@ class JackAlsaDriver : public JackAudioDriver
int SetBufferSize(jack_nframes_t nframes);
// jack api emulation for the midi driver
int is_realtime() const;
int create_thread(pthread_t *thread, int prio, int rt, void *(*start_func)(void*), void *arg);
......
......@@ -724,10 +724,10 @@ int JackFFADODriver::Read()
/* Taken from ffado_driver_run_cycle */
ffado_driver_t* driver = (ffado_driver_t*)fDriver;
int wait_status = 0;
float delayed_usecs = 0.0;
fDelayedUsecs = 0.f;
jack_nframes_t nframes = ffado_driver_wait(driver, -1, &wait_status,
&delayed_usecs);
&fDelayedUsecs);
if ((wait_status < 0)) {
printError( "wait status < 0! (= %d)", wait_status);
......@@ -735,24 +735,17 @@ int JackFFADODriver::Read()
}
if (nframes == 0) {
/* we detected an xrun and restarted: notify
* clients about the delay.
*/
//engine->delay (engine, delayed_usecs);
jack_log("FFADO XRun ");
//NotifyXRun(jack_get_microseconds());
NotifyXRun(fLastWaitUst);
//return 0;
jack_log("FFADO XRun");
NotifyXRun(fLastWaitUst, fDelayedUsecs);
return -1;
}
//fLastWaitUst = GetMicroSeconds(); // Take callback date here
if (nframes != fEngineControl->fBufferSize)
jack_log("JackFFADODriver::Read nframes = %ld", nframes);
//return engine->run_cycle (engine, nframes, delayed_usecs);
fDelayedUst = (jack_time_t)delayed_usecs;
printExit();
return ffado_driver_read((ffado_driver_t *)fDriver, fEngineControl->fBufferSize);
}
......
......@@ -44,7 +44,6 @@ class JackFFADODriver : public JackAudioDriver
int g_verbose;
jack_driver_t* fDriver;
jack_time_t fDelayedUst;
int ffado_driver_attach (ffado_driver_t *driver);
int ffado_driver_detach (ffado_driver_t *driver);
int ffado_driver_read (ffado_driver_t * driver, jack_nframes_t nframes);
......
......@@ -856,10 +856,10 @@ int JackFreebobDriver::Read()
/* Taken from freebob_driver_run_cycle */
freebob_driver_t* driver = (freebob_driver_t*)fDriver;
int wait_status = 0;
float delayed_usecs = 0.0;
fDelayedUsecs = 0.f;
jack_nframes_t nframes = freebob_driver_wait (driver, -1, &wait_status,
&delayed_usecs);
&fDelayedUsecs);
if ((wait_status < 0)) {
printError( "wait status < 0! (= %d)", wait_status);
......@@ -867,24 +867,18 @@ int JackFreebobDriver::Read()
}
if (nframes == 0) {
/* we detected an xrun and restarted: notify
* clients about the delay.
*/
//engine->delay (engine, delayed_usecs);
jack_log("FreeBoB XRun ");
//NotifyXRun(jack_get_microseconds());
NotifyXRun(fLastWaitUst);
//return 0;
NotifyXRun(fLastWaitUst, fDelayedUsecs);
return -1;
}
//fLastWaitUst = GetMicroSeconds(); // Take callback date here
if (nframes != fEngineControl->fBufferSize)
jack_log("JackFreebobDriver::Read nframes = %ld", nframes);
//return engine->run_cycle (engine, nframes, delayed_usecs);
fDelayedUst = (jack_time_t)delayed_usecs;
printExit();
return freebob_driver_read((freebob_driver_t *)fDriver, fEngineControl->fBufferSize);
}
......
......@@ -44,7 +44,6 @@ class JackFreebobDriver : public JackAudioDriver
int g_verbose;
jack_driver_t* fDriver;
jack_time_t fDelayedUst;
int freebob_driver_attach (freebob_driver_t *driver);
int freebob_driver_detach (freebob_driver_t *driver);
int freebob_driver_read (freebob_driver_t * driver, jack_nframes_t nframes);
......
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