Browse Source

Cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4207 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.7
sletz 14 years ago
parent
commit
2869ca7014
2 changed files with 19 additions and 82 deletions
  1. +14
    -8
      linux/JackLinuxTime.c
  2. +5
    -74
      linux/alsa/alsa_driver.c

+ 14
- 8
linux/JackLinuxTime.c View File

@@ -14,7 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.


You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -82,7 +82,7 @@ static int jack_hpet_init ()
} }


/* this assumes period to be constant. if needed, /* this assumes period to be constant. if needed,
it can be moved to the clock access function
it can be moved to the clock access function
*/ */
hpet_period = *((uint32_t *) (hpet_ptr + HPET_PERIOD)); hpet_period = *((uint32_t *) (hpet_ptr + HPET_PERIOD));
hpet_caps = *((uint32_t *) (hpet_ptr + HPET_CAPS)); hpet_caps = *((uint32_t *) (hpet_ptr + HPET_CAPS));
@@ -93,7 +93,7 @@ static int jack_hpet_init ()
return 0; return 0;
} }


static jack_time_t jack_get_microseconds_from_hpet (void)
static jack_time_t jack_get_microseconds_from_hpet (void)
{ {
hpet_counter_t hpet_counter; hpet_counter_t hpet_counter;
long double hpet_time; long double hpet_time;
@@ -116,7 +116,7 @@ static int jack_hpet_init ()
return -1; return -1;
} }


static jack_time_t jack_get_microseconds_from_hpet (void)
static jack_time_t jack_get_microseconds_from_hpet (void)
{ {
/* never called */ /* never called */
return 0; return 0;
@@ -168,7 +168,7 @@ static jack_time_t jack_get_mhz (void)
ret = sscanf(buf, "bogomips per cpu: %" SCNu64, &mhz); ret = sscanf(buf, "bogomips per cpu: %" SCNu64, &mhz);
#else /* MIPS, ARM, alpha */ #else /* MIPS, ARM, alpha */
ret = sscanf(buf, "BogoMIPS : %" SCNu64, &mhz); ret = sscanf(buf, "BogoMIPS : %" SCNu64, &mhz);
#endif
#endif


if (ret == 1) if (ret == 1)
{ {
@@ -182,7 +182,7 @@ static jack_time_t jack_get_mhz (void)


#ifndef HAVE_CLOCK_GETTIME #ifndef HAVE_CLOCK_GETTIME


static jack_time_t jack_get_microseconds_from_system (void)
static jack_time_t jack_get_microseconds_from_system (void)
{ {
jack_time_t jackTime; jack_time_t jackTime;
struct timeval tv; struct timeval tv;
@@ -194,7 +194,7 @@ static jack_time_t jack_get_microseconds_from_system (void)


#else #else


static jack_time_t jack_get_microseconds_from_system (void)
static jack_time_t jack_get_microseconds_from_system (void)
{ {
jack_time_t jackTime; jack_time_t jackTime;
struct timespec time; struct timespec time;
@@ -208,7 +208,7 @@ static jack_time_t jack_get_microseconds_from_system (void)
#endif /* HAVE_CLOCK_GETTIME */ #endif /* HAVE_CLOCK_GETTIME */




SERVER_EXPORT void JackSleep(long usec)
SERVER_EXPORT void JackSleep(long usec)
{ {
usleep(usec); usleep(usec);
} }
@@ -266,3 +266,9 @@ SERVER_EXPORT jack_time_t GetMicroSeconds()
{ {
return _jack_get_microseconds(); return _jack_get_microseconds();
} }

SERVER_EXPORT jack_time_t jack_get_microseconds()
{
return _jack_get_microseconds();
}


+ 5
- 74
linux/alsa/alsa_driver.c View File

@@ -34,31 +34,6 @@
#include <regex.h> #include <regex.h>
#include <string.h> #include <string.h>


/*
#include <jack/internal.h>
#include <jack/engine.h>
#include <jack/messagebuffer.h>

#include <sysdeps/time.h>

#include "alsa_driver.h"
#include "hammerfall.h"
#include "hdsp.h"
#include "ice1712.h"
#include "usx2y.h"
#include "generic.h"
*/
/*
#include "JackAlsaDriver.h"
#include "JackEngineControl.h"
#include "JackClientControl.h"
#include "JackPort.h"
#include "JackGraphManager.h"
#include "JackLockedEngine.h"
#include "JackPosixThread.h"
#include "JackCompilerDeps.h"
*/

#include "alsa_driver.h" #include "alsa_driver.h"
#include "hammerfall.h" #include "hammerfall.h"
#include "hdsp.h" #include "hdsp.h"
@@ -70,8 +45,6 @@


#include "alsa_midi_impl.h" #include "alsa_midi_impl.h"


//#include "JackServerGlobals.h"

extern void store_work_time (int); extern void store_work_time (int);
extern void store_wait_time (int); extern void store_wait_time (int);
extern void show_wait_times (); extern void show_wait_times ();
@@ -118,7 +91,6 @@ jack_driver_nt_init (jack_driver_nt_t * driver)
driver->nt_run_cycle = 0; driver->nt_run_cycle = 0;
} }



static void static void
alsa_driver_release_channel_dependent_memory (alsa_driver_t *driver) alsa_driver_release_channel_dependent_memory (alsa_driver_t *driver)
{ {
@@ -1147,14 +1119,6 @@ alsa_driver_stop (alsa_driver_t *driver)
*/ */


// Steph // Steph
/*
int chn;
for (chn = 0; i < fPlaybackChannels; chn++) {
jack_default_audio_sample_t* buf =
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(fPlaybackPortList[chn], fEngineControl->fBufferSize);
memset (buf, 0, sizeof (jack_default_audio_sample_t) * fEngineControl->fBufferSize);
}
*/
ClearOutput(); ClearOutput();


if (driver->playback_handle) { if (driver->playback_handle) {
@@ -1385,7 +1349,6 @@ alsa_driver_wait (alsa_driver_t *driver, int extra_fd, int *status, float
poll_ret = jack_get_microseconds (); poll_ret = jack_get_microseconds ();


// Steph // Steph
//fBeginDateUst = poll_ret;
SetTime(poll_ret); SetTime(poll_ret);


if (extra_fd < 0) { if (extra_fd < 0) {
@@ -1666,15 +1629,6 @@ alsa_driver_read (alsa_driver_t *driver, jack_nframes_t nframes)
buf + nread, contiguous); buf + nread, contiguous);
} }
*/ */
/*
int chn;
for (chn = 0; chn < fCaptureChannels; chn++) {
if (fGraphManager->GetConnectionsNum(fCapturePortList[chn]) > 0) {
buf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fCapturePortList[chn], orig_nframes);
alsa_driver_read_from_channel (driver, chn, buf + nread, contiguous);
}
}
*/
ReadInput(orig_nframes, contiguous, nread); ReadInput(orig_nframes, contiguous, nread);


if ((err = snd_pcm_mmap_commit (driver->capture_handle, if ((err = snd_pcm_mmap_commit (driver->capture_handle,
@@ -1742,15 +1696,6 @@ alsa_driver_write (alsa_driver_t* driver, jack_nframes_t nframes)
} }
} }
*/ */
/*
int chn;
for (chn = 0; chn < fCaptureChannels; chn++) {
port = fGraphManager->GetPort(fCapturePortList[chn]);
if (port->MonitoringInput()) {
driver->input_monitor_mask |= (1 << chn);
}
}
*/
MonitorInput(); MonitorInput();


if (driver->hw_monitoring) { if (driver->hw_monitoring) {
@@ -1802,23 +1747,7 @@ alsa_driver_write (alsa_driver_t* driver, jack_nframes_t nframes)
*/ */


// Steph // Steph
/*
int chn;
for (chn = 0; chn < fPlaybackChannels; chn++) {
// Ouput ports
if (fGraphManager->GetConnectionsNum(fPlaybackPortList[chn]) > 0) {
buf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fPlaybackPortList[chn], orig_nframes);
alsa_driver_write_to_channel (driver, chn, buf + nwritten, contiguous);
// Monitor ports
if (fWithMonitorPorts && fGraphManager->GetConnectionsNum(fMonitorPortList[chn]) > 0) {
monbuf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fMonitorPortList[chn], orig_nframes);
memcpy(monbuf + nwritten, buf + nwritten, contiguous * sizeof(jack_default_audio_sample_t));
}
}
}
*/

WriteOutput(orig_nframes, contiguous, nwritten);
WriteOutput(orig_nframes, contiguous, nwritten);


if (!bitset_empty (driver->channels_not_done)) { if (!bitset_empty (driver->channels_not_done)) {
alsa_driver_silence_untouched_channels (driver, alsa_driver_silence_untouched_channels (driver,
@@ -1888,6 +1817,8 @@ alsa_driver_detach (alsa_driver_t *driver)
{ {
return 0; return 0;
} }

//Steph
/* /*
static int static int
alsa_driver_attach (alsa_driver_t *driver) alsa_driver_attach (alsa_driver_t *driver)
@@ -2768,7 +2699,7 @@ driver_initialize (jack_client_t *client, const JSList * params)


case 'n': case 'n':
user_nperiods = param->value.ui; user_nperiods = param->value.ui;
if (user_nperiods < 2) // enforce minimum value
if (user_nperiods < 2) // enforce minimum value
user_nperiods = 2; user_nperiods = 2;
break; break;


@@ -2808,7 +2739,7 @@ driver_initialize (jack_client_t *client, const JSList * params)
} }
} }


// duplex is the default
// duplex is the default
if (!capture && !playback) { if (!capture && !playback) {
capture = TRUE; capture = TRUE;
playback = TRUE; playback = TRUE;


Loading…
Cancel
Save