Commit 719b244d authored by sletz's avatar sletz
Browse files

New JackBoomerDriver class for Boomer driver on Solaris.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3460 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 9bdf037e
......@@ -24,6 +24,10 @@ Torben Hohn
Jackdmp changes log
---------------------------
2009-03-24 Stephane Letz <letz@grame.fr>
* New JackBoomerDriver class for Boomer driver on Solaris.
2009-03-23 Stephane Letz <letz@grame.fr>
* Version 1.9.3 started.
......
......@@ -334,7 +334,9 @@ namespace Jack
if ( jack_transport_reposition ( fJackClient, &fReturnTransportData.fPosition ) == EINVAL )
jack_error ( "Can't set new position." );
jack_transport_start ( fJackClient );
jack_info ( "'%s' starts transport frame = %d", fParams.fName, fReturnTransportData.fPosition.frame);
jack_position_t pos;
jack_transport_query ( fJackClient, &pos );
jack_info ( "'%s' starts transport frame = %d frame = %d", fParams.fName, fReturnTransportData.fPosition.frame, pos.frame);
break;
case JackTransportNetStarting :
jack_info ( "'%s' is ready to roll..", fParams.fName );
......@@ -376,6 +378,8 @@ namespace Jack
return static_cast<JackNetMaster*> ( arg )->Process();
}
static int cycle = 0;
int JackNetMaster::Process()
{
if ( !fRunning )
......@@ -384,6 +388,8 @@ namespace Jack
uint port_index;
int res = 0;
//jack_info("cycle = %d", cycle++);
#ifdef JACK_MONITOR
jack_time_t begin_time = GetMicroSeconds();
fNetTimeMon->New();
......
......@@ -174,29 +174,29 @@ void JackTransportEngine::CycleEnd(JackClientInterface** table, jack_nframes_t f
case JackTransportStopped:
// Set a JackTransportStarting for the current cycle, if all clients are ready (no slow_sync) ==> JackTransportRolling next state
if (cmd == TransportCommandStart) {
jack_log("transport stopped ==> starting");
jack_log("transport stopped ==> starting frame = %d", ReadCurrentState()->frame);
fTransportState = JackTransportStarting;
MakeAllStartingLocating(table);
SyncTimeout(frame_rate, buffer_size);
} else if (fPendingPos) {
jack_log("transport stopped ==> stopped (locating)");
jack_log("transport stopped ==> stopped (locating) frame = %d", ReadCurrentState()->frame);
MakeAllLocating(table);
}
break;
case JackTransportStarting:
if (cmd == TransportCommandStop) {
jack_log("transport starting ==> stopped");
jack_log("transport starting ==> stopped frame = %d", ReadCurrentState()->frame);
fTransportState = JackTransportStopped;
MakeAllStopping(table);
} else if (fPendingPos) {
jack_log("transport starting ==> starting");
jack_log("transport starting ==> starting frame = %d"), ReadCurrentState()->frame;
fTransportState = JackTransportStarting;
MakeAllStartingLocating(table);
SyncTimeout(frame_rate, buffer_size);
} else if (--fSyncTimeLeft == 0 || CheckAllRolling(table)) { // Slow clients may still catch up
if (fNetworkSync) {
jack_log("transport starting ==> netstarting");
jack_log("transport starting ==> netstarting frame = %d");
fTransportState = JackTransportNetStarting;
} else {
jack_log("transport starting ==> rolling fSyncTimeLeft = %ld", fSyncTimeLeft);
......
This diff is collapsed.
/*
Copyright (C) 2009 Grame
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __JackBoomerDriver__
#define __JackBoomerDriver__
#include "JackAudioDriver.h"
namespace Jack
{
typedef jack_default_audio_sample_t jack_sample_t;
#define OSS_DRIVER_N_PARAMS 13
#define OSS_DRIVER_DEF_DEV "/dev/dsp"
#define OSS_DRIVER_DEF_FS 48000
#define OSS_DRIVER_DEF_BLKSIZE 1024
#define OSS_DRIVER_DEF_NPERIODS 1
#define OSS_DRIVER_DEF_BITS 16
#define OSS_DRIVER_DEF_INS 2
#define OSS_DRIVER_DEF_OUTS 2
/*!
\brief The OSS driver.
*/
class JackBoomerDriver : public JackAudioDriver
{
enum { kRead = 1, kWrite = 2, kReadWrite = 3 };
private:
int fInFD;
int fOutFD;
int fBits;
int fSampleFormat;
int fNperiods;
unsigned int fSampleSize;
int fRWMode;
bool fExcl;
bool fIgnoreHW;
unsigned int fInputBufferSize;
unsigned int fOutputBufferSize;
void* fInputBuffer;
void* fOutputBuffer;
bool fFirstCycle;
int OpenInput();
int OpenOutput();
int OpenAux();
void CloseAux();
void SetSampleFormat();
void DisplayDeviceInfo();
// Redefining since timing for CPU load is specific
int ProcessSync();
public:
JackBoomerDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
: JackAudioDriver(name, alias, engine, table),
fInFD(-1), fOutFD(-1), fBits(0),
fSampleFormat(0), fNperiods(0), fRWMode(0), fExcl(false), fIgnoreHW(true),
fInputBufferSize(0), fOutputBufferSize(0),
fInputBuffer(NULL), fOutputBuffer(NULL), fFirstCycle(true)
{}
virtual ~JackBoomerDriver()
{}
int Open(jack_nframes_t frames_per_cycle,
int user_nperiods,
jack_nframes_t rate,
bool capturing,
bool playing,
int chan_in,
int chan_out,
bool vmix,
bool monitor,
const char* capture_driver_name,
const char* playback_driver_name,
jack_nframes_t capture_latency,
jack_nframes_t playback_latency,
int bits,
bool ignorehwbuf);
int Close();
int Read();
int Write();
// BufferSize can be changed
bool IsFixedBufferSize()
{
return false;
}
int SetBufferSize(jack_nframes_t buffer_size);
};
} // end of namespace
#endif
......@@ -28,6 +28,8 @@ def build(bld):
create_jack_driver_obj(bld, 'oss', ['oss/JackOSSDriver.cpp', '../common/memops.c'])
create_jack_driver_obj(bld, 'boomer', ['oss/JackBoomerDriver.cpp', '../common/memops.c'])
create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp')
......
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