Commit 3f9a3d85 authored by sletz's avatar sletz
Browse files

ALSA driver still in progress.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4206 0c269be4-1314-0410-8aa9-9f06e86f4224
parent ee393311
......@@ -55,9 +55,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
#define jack_get_microseconds GetMicroSeconds
int JackAlsaDriver::SetBufferSize(jack_nframes_t buffer_size)
{
jack_log("JackAlsaDriver::SetBufferSize %ld", buffer_size);
......@@ -449,42 +446,6 @@ void JackAlsaDriver::WriteOutputAux(jack_nframes_t orig_nframes, snd_pcm_sframes
}
}
void
JackAlsaDriver::jack_driver_init (jack_driver_t *driver)
{
memset (driver, 0, sizeof (*driver));
driver->attach = 0;
driver->detach = 0;
driver->write = 0;
driver->read = 0;
driver->null_cycle = 0;
driver->bufsize = 0;
driver->start = 0;
driver->stop = 0;
}
void
JackAlsaDriver::jack_driver_nt_init (jack_driver_nt_t * driver)
{
memset (driver, 0, sizeof (*driver));
jack_driver_init ((jack_driver_t *) driver);
driver->attach = 0;
driver->detach = 0;
driver->bufsize = 0;
driver->stop = 0;
driver->start = 0;
driver->nt_bufsize = 0;
driver->nt_start = 0;
driver->nt_stop = 0;
driver->nt_attach = 0;
driver->nt_detach = 0;
driver->nt_run_cycle = 0;
}
int JackAlsaDriver::is_realtime() const
{
return fEngineControl->fRealTime;
......@@ -752,7 +713,6 @@ dither_opt (char c, DitherAlgorithm* dither)
return 0;
}
/*
SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor ()
{
jack_driver_desc_t * desc;
......@@ -931,7 +891,7 @@ SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor ()
desc->params = params;
return desc;
}
*/
static Jack::JackAlsaDriver* g_alsa_driver;
......@@ -1092,7 +1052,7 @@ void WriteOutput(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_
{
g_alsa_driver->WriteOutputAux(orig_nframes, contiguous, nwritten);
}
void SetTimet(jack_time_t time)
void SetTime(jack_time_t time)
{
g_alsa_driver->SetTimetAux(time);
}
......
......@@ -42,9 +42,6 @@ class JackAlsaDriver : public JackAudioDriver
int fReservedCaptureDevice;
int fReservedPlaybackDevice;
void jack_driver_init(jack_driver_t *driver);
void jack_driver_nt_init(jack_driver_nt_t * driver);
public:
JackAlsaDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
......
......@@ -18,6 +18,7 @@
*/
#define __STDC_FORMAT_MACROS // For inttypes.h to work in C++
#include <math.h>
......@@ -81,6 +82,43 @@ extern void show_work_times ();
/* Delay (in process calls) before jackd will report an xrun */
#define XRUN_REPORT_DELAY 0
void
jack_driver_init (jack_driver_t *driver)
{
memset (driver, 0, sizeof (*driver));
driver->attach = 0;
driver->detach = 0;
driver->write = 0;
driver->read = 0;
driver->null_cycle = 0;
driver->bufsize = 0;
driver->start = 0;
driver->stop = 0;
}
void
jack_driver_nt_init (jack_driver_nt_t * driver)
{
memset (driver, 0, sizeof (*driver));
jack_driver_init ((jack_driver_t *) driver);
driver->attach = 0;
driver->detach = 0;
driver->bufsize = 0;
driver->stop = 0;
driver->start = 0;
driver->nt_bufsize = 0;
driver->nt_start = 0;
driver->nt_stop = 0;
driver->nt_attach = 0;
driver->nt_detach = 0;
driver->nt_run_cycle = 0;
}
static void
alsa_driver_release_channel_dependent_memory (alsa_driver_t *driver)
{
......@@ -1187,7 +1225,7 @@ alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed_usecs)
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_SUSPENDED)
{
MESSAGE("\n\n**** alsa_pcm: pcm in suspended state, resuming it \n\n" );
jack_log("**** alsa_pcm: pcm in suspended state, resuming it" );
if (driver->capture_handle) {
if ((res = snd_pcm_prepare(driver->capture_handle))
< 0) {
......@@ -1209,9 +1247,7 @@ alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed_usecs)
snd_pcm_status_get_trigger_tstamp(status, &tstamp);
timersub(&now, &tstamp, &diff);
*delayed_usecs = diff.tv_sec * 1000000.0 + diff.tv_usec;
MESSAGE("\n\n**** alsa_pcm: xrun of at least %.3f "
"msecs\n\n",
*delayed_usecs / 1000.0);
jack_log("**** alsa_pcm: xrun of at least %.3f msecs",*delayed_usecs / 1000.0);
}
if (alsa_driver_restart (driver)) {
......@@ -2475,6 +2511,7 @@ dither_opt (char c, DitherAlgorithm* dither)
const char driver_client_name[] = "alsa_pcm";
/*
const jack_driver_desc_t *
driver_get_descriptor ()
{
......@@ -2652,7 +2689,7 @@ driver_get_descriptor ()
return desc;
}
*/
/*
jack_driver_t *
driver_initialize (jack_client_t *client, const JSList * params)
......
......@@ -41,6 +41,11 @@
#include "memops.h"
#include "alsa_midi.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef void (*ReadCopyFunction) (jack_default_audio_sample_t *dst, char *src,
unsigned long src_bytes,
unsigned long src_skip_bytes);
......@@ -264,10 +269,7 @@ alsa_driver_read (alsa_driver_t *driver, jack_nframes_t nframes);
int
alsa_driver_write (alsa_driver_t* driver, jack_nframes_t nframes);
#ifdef __cplusplus
extern "C"
{
#endif
jack_time_t jack_get_microseconds(void);
// Code implemented in JackAlsaDriver.cpp
......@@ -275,7 +277,7 @@ void ReadInput(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pc
void MonitorInput();
void ClearOutput();
void WriteOutput(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pcm_sframes_t nwritten);
void SetTimet(jack_time_t time);
void SetTime(jack_time_t time);
#ifdef __cplusplus
}
......
......@@ -54,8 +54,6 @@ extern "C"
#define jack_frame_time JACK_frame_time
#define jack_last_frame_time JACK_last_frame_time
#define jack_get_microseconds GetMicroSecond
#ifdef __cplusplus
} // extern "C"
#endif
......
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