Commit e66e2165 authored by jcacerec's avatar jcacerec
Browse files

1.0.1 alpha release tag added

parent f1ee406e
JackTrip: A Multimachine System for High-Quality Audio
Network Performance over the Internet
Copyright (c) 2008 Chris Chafe, Juan-Pablo Caceres,
SoundWIRE group at CCRMA.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Jacktrip : Build Instructions for Fedora Linux (and possible other Linux Distros)
---
Dependencies:
You need to have installed the libraries in your system:
qt4-devel
jack-audio-connection-kit-devel
If you are using yum (in Fedora 7 or later) you can just install them (as root) with:
yum install qt4-devel jack-audio-connection-kit-devel
---
Build:
to build on Linux, just go to the /src directory and type the following two commands:
./m
make
---
Post Configuration
Detailed instructions at
http://ccrma.stanford.edu/groups/soundwire/software/jacktrip/
---
Using JackTrip
Detailed instructions at
http://ccrma.stanford.edu/groups/soundwire/software/jacktrip/
- add the option for 24 bit audio
- remove comments and cleanup code
- add a verbose mode, with more diagnostics (silent by default)
Check how to do this with a flag in cerr
- check if multithread is working correctly
- sourceforge
- Distribute without the FAUST dependency
- Always remove the debug mode for release
- remove at some point the qt3support
- remove the lasound dependency
- Replace all types by qt types, to make it more robost to multiprocessors.
-Check That the Ethernet is running in full duplex
/sbin/ethtool gives that info, but you have to be root for that
looking for other options...
dmesg |grep eth0
gives the info
-Check the FIFO Prioriy, now it is at 51, was at 99
- Check why -q1 -b1 settings cause a buzz in the beginings, seems that the buffer doesn't get erased
-remove class THREADCOM EVENT, not used and last one using qt3
-Merge rcvz1 with normal rcv method: rcvz one does the buffering mechanism
-Get a better command line parser
-Check that header files are modern, e.g., <iostram> instead of <iostream.h> --DONE
-Update interface to JackClient to make it compatible with the new API and also make it work with jackmp
\ No newline at end of file
[check]
QMAKE_CACHE_VERSION = 1.02a
QMAKE_ABSOLUTE_SOURCE_PATH =
MOC_DIR = moc/
UI_DIR =
UI_HEADERS_DIR =
UI_SOURCES_DIR =
[depend]
appwidget.cpp = ../include/appwidget.h ../include/snd.h ../include/ccconfig.h ../include/co2.h ../include/playerwidget.h ../include/flwidget.h ../include/thruwidget.h ../include/sliderx3.h ../include/shape2d.h ../include/thru.h ../include/ofsig.h
../include/appwidget.h = ../include/ccconfig.h ../include/playerwidget.h ../include/flwidget.h ../include/thruwidget.h ../include/sliderx3.h ../include/shape2d.h ../include/thru.h
../include/args.h =
../include/ccconfig.h =
co2.cpp = ../include/co2.h ../include/appwidget.h ../include/snd.h ../include/ccconfig.h ../include/playerwidget.h ../include/flwidget.h ../include/thruwidget.h ../include/sliderx3.h ../include/shape2d.h ../include/thru.h ../include/ofsig.h
../include/co2.h = ../include/ccconfig.h
dcblock.cpp = ../include/dcblock.h
../include/dcblock.h =
fl.cpp = ../include/fl.h ../include/flwidget.h ../include/dcblock.h ../include/vortexjettabl.h ../include/playerwidget.h ../include/sliderx3.h ../include/ccconfig.h
../include/fl.h = ../include/flwidget.h ../include/dcblock.h ../include/vortexjettabl.h ../include/playerwidget.h ../include/sliderx3.h ../include/ccconfig.h
flutehole.cpp = ../include/flutehole.h ../include/appwidget.h ../include/snd.h ../include/dcblock.h ../include/flwidget.h ../include/jettablsigm.h ../include/vortexjettabl.h ../include/tonehole.h ../include/ccconfig.h ../include/playerwidget.h ../include/sliderx3.h ../include/thruwidget.h ../include/shape2d.h ../include/thru.h ../include/ofsig.h
../include/flutehole.h = ../include/flwidget.h ../include/jettablsigm.h ../include/vortexjettabl.h ../include/tonehole.h ../include/ccconfig.h ../include/playerwidget.h ../include/sliderx3.h
flwidget.cpp = ../include/snd.h ../include/fl.h ../include/flutehole.h ../include/ccconfig.h ../include/harmonics.h ../include/flwidget.h ../include/history.h ../include/appwidget.h ../include/co2.h ../include/jettablsigm.h ../include/playerwidget.h ../include/ofsig.h ../include/sliderx3.h ../include/dcblock.h ../include/vortexjettabl.h ../include/tonehole.h ../include/thruwidget.h ../include/shape2d.h ../include/thru.h
../include/flwidget.h = ../include/playerwidget.h ../include/sliderx3.h ../include/ccconfig.h
harmonics.cpp = ../include/harmonics.h
../include/harmonics.h =
history.cpp = ../include/history.h ../include/ccconfig.h ../include/flwidget.h ../include/appwidget.h ../include/co2.h ../include/playerwidget.h ../include/sliderx3.h ../include/thruwidget.h ../include/shape2d.h ../include/thru.h
../include/history.h = ../include/ccconfig.h
jettablsigm.cpp = ../include/jettablsigm.h
../include/jettablsigm.h =
main.cpp = ../include/ccconfig.h ../include/appwidget.h ../include/args.h ../include/playerwidget.h ../include/flwidget.h ../include/thruwidget.h ../include/sliderx3.h ../include/shape2d.h ../include/thru.h
../include/matlabmodel.h =
../include/mlthread.h = ../include/matlabmodel.h
ofsig.cpp = ../include/ofsig.h ../include/flutehole.h ../include/ccconfig.h ../include/flwidget.h ../include/jettablsigm.h ../include/vortexjettabl.h ../include/tonehole.h ../include/playerwidget.h ../include/sliderx3.h
../include/ofsig.h = ../include/ccconfig.h
playerwidget.cpp = ../include/snd.h ../include/ccconfig.h ../include/playerwidget.h ../include/ofsig.h ../include/sliderx3.h
../include/playerwidget.h = ../include/sliderx3.h ../include/ccconfig.h
rms.cpp = ../include/rms.h ../include/ccconfig.h
../include/rms.h =
shape2d.cpp = ../include/shape2d.h ../include/showimg.h ../include/thruwidget.h ../include/ccconfig.h ../include/playerwidget.h ../include/sliderx3.h ../include/thru.h
../include/shape2d.h = ../include/ccconfig.h
showimg.cpp = ../include/showimg.h ../include/shape2d.h ../include/ccconfig.h
../include/showimg.h = ../include/shape2d.h ../include/ccconfig.h
sliderx3.cpp = ../include/sliderx3.h
../include/sliderx3.h =
snd.cpp = ../include/snd.h ../include/thru.h ../include/rms.h ../include/ccconfig.h ../include/playerwidget.h ../include/ofsig.h ../include/sliderx3.h
../include/snd.h = ../include/ccconfig.h ../include/playerwidget.h ../include/ofsig.h ../include/sliderx3.h
thru.cpp = ../include/thru.h ../include/thruwidget.h ../include/ccconfig.h ../include/playerwidget.h ../include/sliderx3.h ../include/shape2d.h
../include/thru.h = ../include/ccconfig.h
thruwidget.cpp = ../include/snd.h ../include/thru.h ../include/appwidget.h ../include/thruwidget.h ../include/ccconfig.h ../include/playerwidget.h ../include/ofsig.h ../include/sliderx3.h ../include/flwidget.h ../include/shape2d.h
../include/thruwidget.h = ../include/playerwidget.h ../include/sliderx3.h ../include/shape2d.h ../include/thru.h ../include/ccconfig.h
tonehole.cpp = ../include/tonehole.h ../include/ccconfig.h
../include/tonehole.h = ../include/ccconfig.h
vortexjettabl.cpp = ../include/vortexjettabl.h ../include/ccconfig.h ../include/sliderx3.h
../include/vortexjettabl.h = ../include/ccconfig.h ../include/sliderx3.h
[mocable]
../include/appwidget.h = moc/moc_appwidget.cpp
../include/args.h = *qmake_ignore*
../include/ccconfig.h = *qmake_ignore*
../include/co2.h = *qmake_ignore*
../include/dcblock.h = *qmake_ignore*
../include/fl.h = *qmake_ignore*
../include/flutehole.h = *qmake_ignore*
../include/flwidget.h = moc/moc_flwidget.cpp
../include/harmonics.h = *qmake_ignore*
../include/history.h = *qmake_ignore*
../include/jettablsigm.h = *qmake_ignore*
../include/matlabmodel.h = *qmake_ignore*
../include/mlthread.h = *qmake_ignore*
../include/ofsig.h = *qmake_ignore*
../include/playerwidget.h = *qmake_ignore*
../include/rms.h = *qmake_ignore*
../include/shape2d.h = moc/moc_shape2d.cpp
../include/showimg.h = moc/moc_showimg.cpp
../include/sliderx3.h = *qmake_ignore*
../include/snd.h = *qmake_ignore*
../include/thru.h = *qmake_ignore*
../include/thruwidget.h = moc/moc_thruwidget.cpp
../include/tonehole.h = *qmake_ignore*
../include/vortexjettabl.h = *qmake_ignore*
appwidget.cpp = *qmake_ignore*
co2.cpp = *qmake_ignore*
dcblock.cpp = *qmake_ignore*
fl.cpp = *qmake_ignore*
flutehole.cpp = *qmake_ignore*
flwidget.cpp = *qmake_ignore*
harmonics.cpp = *qmake_ignore*
history.cpp = *qmake_ignore*
jettablsigm.cpp = *qmake_ignore*
main.cpp = *qmake_ignore*
ofsig.cpp = *qmake_ignore*
playerwidget.cpp = *qmake_ignore*
rms.cpp = *qmake_ignore*
shape2d.cpp = *qmake_ignore*
showimg.cpp = *qmake_ignore*
sliderx3.cpp = *qmake_ignore*
snd.cpp = *qmake_ignore*
thru.cpp = *qmake_ignore*
thruwidget.cpp = *qmake_ignore*
tonehole.cpp = *qmake_ignore*
vortexjettabl.cpp = *qmake_ignore*
/*
JackTrip: A Multimachine System for High-Quality Audio
Network Performance over the Internet
Copyright (c) 2008 Chris Chafe, Juan-Pablo Caceres,
SoundWIRE group at CCRMA.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* audioDevice.cpp
*/
#include "AudioDevice.h"
#include <ctime>
using namespace std;
AudioDevice::AudioDevice (bool testMode)
{
if (testMode == false)
{
cerr << "You shouldn't ever call new AudioDevice( false );" <<
endl;
exit (1);
}
}
AudioDevice::AudioDevice (int ID, int numBuffers, audioDeviceModeT mode,
AudioInfoT audioInfo):
audioDeviceID (ID),
audioInfo (audioInfo),
numBuffers (numBuffers),
mode (mode)
{
streamID = 0;
//int tmpBufferSize = audioInfo->getFramesPerBuffer ();
jack = audioInfo->isJack ();
if (audioInfo->getNumNetHarpStrings () > 0)
{
harp = true;
}
else
{
harp = false;
}
if (jack) {
cout << "Creating Jack audio Device.........";
}
switch (mode)
{
case RECORD:
if (jack)
jdevice =
new JackClient (//"jacktrip",//APP_NAME, //*JPC Hack, need to fix later
audioInfo->
getNumChans (),
audioInfo->
getFramesPerBuffer (),
false, true, this,
audioInfo->getJack_alsa_readable_offset ());
break;
case PLAYBACK:
if (jack)
jdevice =
new JackClient (//"jacktrip",//APP_NAME, //*JPC Hack, need to fix later
audioInfo->
getNumChans (),
audioInfo->
getFramesPerBuffer (),
true, false, this,
audioInfo->getJack_alsa_readable_offset ());
break;
case DUPLEX:
if (jack)
jdevice =
new JackClient (//"jacktrip",//APP_NAME, //*JPC Hack, need to fix later
audioInfo->
getNumChans (),
audioInfo->
getFramesPerBuffer (),
true, true, this,
audioInfo->getJack_alsa_readable_offset ());
break;
}
cout << "SUCCESS!" << endl;
bytesPerBuffer = audioInfo->getBytesPerBuffer ();
if (harp == true)
{
generateHarpMixMap ();
}
else
{
readLock = new QSemaphore (1);
writeLock = new QSemaphore (1);
//(*writeLock)++; // lock out write, to start with read
(*writeLock).acquire(); //****JPC qt4 porting******
}
if (jack)
{
}
}
AudioDevice::~AudioDevice ()
{
}
void
AudioDevice::jackStart ()
{
cout << "jack start" << endl;
jdevice->start ();
}
void
AudioDevice::jackStop ()
{
cout << "jack stop" << endl;
jdevice->stop ();
}
void
AudioDevice::unlockRead ()
{
//(*readLock)--; // so audio input thread will unblock when stopped
(*readLock).release();//****JPC qt4 porting******
}
void
AudioDevice::readBuffer (void *to)
{
if (mode == PLAYBACK)
{
cerr << "ERROR: AudioDevice::readBuffer called on device in PLAYBACK mode!" << endl;
}
//(*readLock)++;
(*readLock).acquire();//****JPC qt4 porting******
memcpy (to, buffer, bytesPerBuffer);
//(*writeLock)--;
(*writeLock).release();//****JPC qt4 porting******
}
void
AudioDevice::writeBuffer (void *from)
{
if (mode == RECORD)
{
cerr << "ERROR: AudioDevice::writeBuffer called on device in RECORD mode!" << endl;
}
if (harp == false)
{
//(*writeLock)++;
(*writeLock).acquire();//****JPC qt4 porting******
memcpy (buffer, from, bytesPerBuffer);
//tick (); // calls tickstream, blocks
//(*readLock)--;
(*readLock).release();//****JPC qt4 porting******
}
}
/**
* @brief Distribute the NetHarp channels across the audio channels.
*/
void
AudioDevice::generateHarpMixMap ()
{
cerr << "Generating Mixmap for " << audioInfo->getNumNetHarpStrings ()
<< " NetHarp strings to " << audioInfo->getNumAudioChans ()
<< " audio channels." << endl;
stringsPerChan = new int[audioInfo->getNumAudioChans ()];
// Set all to 0 initially
for (int i = 0; i < audioInfo->getNumAudioChans (); i++)
{
stringsPerChan[i] = 0;
}
// Distribute strings among audio channels
int stringsAllocated (0);
int i (0);
while (stringsAllocated != audioInfo->getNumNetHarpStrings ())
{
stringsPerChan[i++]++;
stringsAllocated++;
if (i == audioInfo->getNumAudioChans ())
i = 0;
}
}
void
AudioDevice::setThreads (streamThreads t)
{
inThread = t.audioin;
outThread = t.audioout;
}
/*
JackTrip: A Multimachine System for High-Quality Audio
Network Performance over the Internet
Copyright (c) 2008 Chris Chafe, Juan-Pablo Caceres,
SoundWIRE group at CCRMA.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* audioDevice.h
*/
#ifndef _AUDIO_DEVICE_H
#define _AUDIO_DEVICE_H
#include <iostream>
#include <cstdlib>
#include <cmath>
#include "audioInfo.h"
#include "JackClient.h"
#include <QThread>
#include "JackTrip.h"
#include <QWaitCondition>
#include <QSemaphore>
/**
* @brief Interfaces with an RtAudio sound device.
*/
class AudioDevice
{
public:
/** @brief Modes the audio device can be opened in:
*
* RECORD - The device can only be used for audio input.
* PLAYBACK - The device can only be used for audio output.
* DUPLEX - The device can be used for both input and output.
*/
enum audioDeviceModeT
{ RECORD, PLAYBACK, DUPLEX };
AudioInput *inThread;
AudioOutput *outThread;
void setThreads(streamThreads t);
/**
* @brief Constructor.
*
* @param audioDeviceID - The device ID of the sound device to use (-1 for default).
* @param numBuffers - The length of the queue of audio buffers maintained on the audio device.
* @param audioInfo - Relevant audio information.
*/
AudioDevice (int audioDeviceID, int numBuffers,
audioDeviceModeT mode,
AudioInfoT audioInfo);
AudioDevice (bool test);
~AudioDevice ();
/**
* @brief read a buffer of audio samples from the device into the <b>to</b> buffer. (blocks).
*/
void readBuffer (void *to);
/**
* @brief write a buffer of audio samples from the <b>from</b> buffer to the audio device buffer. (blocks).
*/
void writeBuffer (void *from);
QWaitCondition jackWait;
void bufferPtrs (void * jib, void * job);
void jackStart ();
void jackStop ();
void unlockRead ();
bool jack;
private:
JackClient *jdevice;
char *buffer; //!< Pointer to the RtAudio audio buffer.
void *jibuffer;
void *jobuffer;
int streamID; //!< RtAudio Stream ID
int audioDeviceID; //!< Audio device ID.
AudioInfoT audioInfo; //!< Relevant audio information.
int numBuffers; //!< Length of the device buffer (in buffers
//!< of size AudioInfoT->framesPerBuffer).
int bytesPerBuffer; //!< Total number of bytes per audio buffer.
int *stringsPerChan; //!< Array of number of NetHarp strings per audio output channel for audio monitoring.
bool harp; //!< Harp mode?
QSemaphore *readLock; //!< Thread protection.
QSemaphore *writeLock; //!< Thread protection.
audioDeviceModeT mode; //!< Device mode.
void generateHarpMixMap (); //!< Generates mix map for mixing X NetHarp strings to Y audio channels
};
#endif
/*
JackTrip: A Multimachine System for High-Quality Audio
Network Performance over the Internet
Copyright (c) 2008 Chris Chafe, Juan-Pablo Caceres,
SoundWIRE group at CCRMA.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* audio_input.cpp
*
* Audio input class. Takes rtBuffers from the sound device and
* puts them into the Stream.
*
*/
#include "AudioInput.h"
#include "Stream.h"
#include <iostream>
using namespace std;
AudioInput::AudioInput (AudioDevice * audioDevice, AudioInfoT audioInfo):
InputStreamPlugin ("Audio Input StreamPlugin"),
audioDevice (audioDevice), audioInfo (audioInfo)
{
dontRun = audioInfo->jack;
}
AudioInput::~AudioInput ()
{
}
int
AudioInput::rcv (char *buf)
{
audioDevice->readBuffer (buf);
return 0;
}
void
AudioInput::stop ()
{
_running = false;
audioDevice->unlockRead ();
}
void
AudioInput::run ()
{
_running = true;