Browse Source

Takashi's fixes

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@312 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
trutkin 23 years ago
parent
commit
ee6c9cb173
22 changed files with 109 additions and 75 deletions
  1. +4
    -0
      .cvsignore
  2. +2
    -0
      Makefile.am
  3. +1
    -1
      configure.in
  4. +3
    -3
      doc/Makefile.am
  5. +1
    -1
      drivers/alsa/Makefile.am
  6. +22
    -22
      drivers/alsa/alsa_driver.c
  7. +1
    -0
      drivers/alsa/ice1712.c
  8. +11
    -11
      drivers/solaris/solaris_driver.c
  9. +2
    -2
      example-clients/capture_client.c
  10. +2
    -1
      example-clients/connect.c
  11. +5
    -5
      example-clients/metro.c
  12. +1
    -0
      example-clients/monitor_client.c
  13. +1
    -0
      example-clients/showtime.c
  14. +1
    -0
      example-clients/simple_client.c
  15. +5
    -5
      jack/alsa_driver.h
  16. +28
    -6
      jack/cycles.h
  17. +1
    -1
      jack/engine.h
  18. +1
    -1
      jack/internal.h
  19. +1
    -1
      jack/types.h
  20. +14
    -14
      jackd/engine.c
  21. +1
    -1
      libjack/client.c
  22. +1
    -0
      libjack/timestamps.c

+ 4
- 0
.cvsignore View File

@@ -1,3 +1,7 @@
autom4te.cache
config.h
config.h.in
stamp-h1
config.log
aclocal.m4
config.status


+ 2
- 0
Makefile.am View File

@@ -29,3 +29,5 @@ rpm: dist
dist-hook: dist-check-doxygen

EXTRA_DIST = depcomp COPYING COPYING.GPL COPYING.LGPL

AUTOMAKE_OPTIONS = foreign

+ 1
- 1
configure.in View File

@@ -14,7 +14,7 @@ dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=44
JACK_MICRO_VERSION=2
JACK_MICRO_VERSION=3

dnl ---
dnl HOWTO: updating the libjack interface version


+ 3
- 3
doc/Makefile.am View File

@@ -24,14 +24,14 @@ distclean-local: clean
if test -d reference; then rm -rf reference; fi

install-data-local:
$(mkinstalldirs) $(DOC_DIR)/reference/html
$(mkinstalldirs) $(DESTDIR)$(DOC_DIR)/reference/html
(installfiles=`echo reference/html/*.html`; \
if test "$$installfiles" = 'reference/html/*.html'; \
then echo '-- Nothing to install' ; \
else \
for i in $$installfiles reference/html/doxygen.png reference/html/doxygen.css; do \
echo '-- Installing '$$i ; \
$(INSTALL_DATA) $$i $(DOC_DIR)/reference/html; \
$(INSTALL_DATA) $$i $(DESTDIR)$(DOC_DIR)/reference/html; \
done; \
fi)

@@ -43,7 +43,7 @@ uninstall-local: doxygen-build.stamp
else \
for i in $$installfiles reference/html/doxygen.png reference/html/doxygen.css; do \
echo '-- Unstalling '$$i ; \
rm $(DOC_DIR)/$$i; \
rm $(DESTDIR)$(DOC_DIR)/$$i; \
done; \
fi)



+ 1
- 1
drivers/alsa/Makefile.am View File

@@ -6,7 +6,7 @@ plugindir = $(ADDON_DIR)

plugin_LTLIBRARIES = jack_alsa.la

jack_alsa_la_LDFLAGS = -module
jack_alsa_la_LDFLAGS = -module -avoid-version
jack_alsa_la_SOURCES = alsa_driver.c generic_hw.c memops.c \
hammerfall.c hdsp.c ice1712.c
jack_alsa_la_LIBADD = $(ALSA_LIBS)

+ 22
- 22
drivers/alsa/alsa_driver.c View File

@@ -554,8 +554,8 @@ alsa_driver_set_parameters (alsa_driver_t *driver, jack_nframes_t frames_per_cyc
}

driver->clock_sync_data = (ClockSyncStatus *) malloc (sizeof (ClockSyncStatus) *
driver->capture_nchannels > driver->playback_nchannels ?
driver->capture_nchannels : driver->playback_nchannels);
(driver->capture_nchannels > driver->playback_nchannels ?
driver->capture_nchannels : driver->playback_nchannels));

driver->period_usecs = (((float) driver->frames_per_cycle) / driver->frame_rate) * 1000000.0f;

@@ -811,7 +811,7 @@ alsa_driver_wait (alsa_driver_t *driver, int extra_fd, int *status, float *delay
int xrun_detected = FALSE;
int need_capture;
int need_playback;
int i;
unsigned int i;
unsigned long long poll_enter, poll_ret;

*status = -1;
@@ -829,9 +829,9 @@ alsa_driver_wait (alsa_driver_t *driver, int extra_fd, int *status, float *delay
while (need_playback || need_capture) {

int p_timed_out, c_timed_out;
int ci = 0;
int nfds;
unsigned int p_timed_out, c_timed_out;
unsigned int ci = 0;
unsigned int nfds;

nfds = 0;

@@ -1107,7 +1107,7 @@ alsa_driver_process (alsa_driver_t *driver, jack_nframes_t nframes)
snd_pcm_mmap_commit (driver->capture_handle, capture_offset, contiguous);
}

if (contiguous != driver->frames_per_cycle) {
if (contiguous != (snd_pcm_sframes_t) driver->frames_per_cycle) {
jack_error ("wierd contiguous size %lu", contiguous);
}

@@ -1554,7 +1554,7 @@ alsa_driver_listen_for_clock_sync_status (alsa_driver_t *driver,
}

int
alsa_driver_stop_listening_to_clock_sync_status (alsa_driver_t *driver, int which)
alsa_driver_stop_listening_to_clock_sync_status (alsa_driver_t *driver, unsigned int which)

{
JSList *node;
@@ -1592,20 +1592,20 @@ alsa_driver_clock_sync_notify (alsa_driver_t *driver, channel_t chn, ClockSyncSt
static void
alsa_usage ()
{
fprintf (stderr, "\
alsa PCM driver args:
-d alsa-pcm-name (default: default)
-r sample-rate (default: 48kHz)
-p frames-per-period (default: 1024)
-n periods-per-hardware-buffer (default: 2)
-H (use hardware monitoring if available, default: no)
-D (duplex, default: yes)
-C (capture, default: duplex)
-P (playback, default: duplex)
-z[r|t|s|-] (dither, rect|tri|shaped|off, default: off)
-s soft-mode, no xrun handling (default: off)
");
fprintf (stderr,
"alsa PCM driver args:\n"
" -d alsa-pcm-name (default: default)\n"
" -r sample-rate (default: 48kHz)\n"
" -p frames-per-period (default: 1024)\n"
" -n periods-per-hardware-buffer (default: 2)\n"
" -H (use hardware monitoring if available, default: no)\n"
" -D (duplex, default: yes)\n"
" -C (capture, default: duplex)\n"
" -P (playback, default: duplex)\n"
" -z[r|t|s|-] (dither, rect|tri|shaped|off, default: off)\n"
" -s soft-mode, no xrun handling (default: off)\n"
);
}

jack_driver_t *


+ 1
- 0
drivers/alsa/ice1712.c View File

@@ -25,6 +25,7 @@
#include <jack/alsa_driver.h>
#include <jack/ice1712.h>
#include <jack/error.h>
#include <jack/internal.h>

static int
ice1712_hw_monitor_toggle(jack_hardware_t *hw, int idx, int onoff)


+ 11
- 11
drivers/solaris/solaris_driver.c View File

@@ -117,17 +117,17 @@ solaris_driver_delete (solaris_driver_t *driver)
static void
solaris_usage ()
{
fprintf (stderr, "\
solaris PCM driver args:
-r sample-rate (default: 48kHz)
-p frames-per-period (default: 1024)
-n periods-per-hardware-buffer (default: 2)
-D (duplex, default: yes)
-C (capture, default: duplex)
-P (playback, default: duplex)
-z[r|t|s|-] (dither, rect|tri|shaped|off, default: off)
");
fprintf (stderr,
"solaris PCM driver args:\n"
" -r sample-rate (default: 48kHz)\n"
" -p frames-per-period (default: 1024)\n"
" -n periods-per-hardware-buffer (default: 2)\n"
" -D (duplex, default: yes)\n"
" -C (capture, default: duplex)\n"
" -P (playback, default: duplex)\n"
" -z[r|t|s|-] (dither, rect|tri|shaped|off, default: off)\n"
);
}

jack_driver_t *


+ 2
- 2
example-clients/capture_client.c View File

@@ -123,7 +123,7 @@ disk_thread (void *arg)
{
sample_buffer_t *buf;
thread_info_t *info = (thread_info_t *) arg;
int i;
unsigned int i;
unsigned int chn;
jack_nframes_t total_captured = 0;
int done = 0;
@@ -281,7 +281,7 @@ run_disk_thread (thread_info_t *info)
void
setup_ports (int sources, char *source_names[], thread_info_t *info)
{
int i;
unsigned int i;

nports = sources;



+ 2
- 1
example-clients/connect.c View File

@@ -1,4 +1,3 @@
#include <stdio.h>
/*
Copyright (C) 2002 Jeremy Hall
@@ -19,9 +18,11 @@
$Id$
*/

#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

#include <jack/jack.h>



+ 5
- 5
example-clients/metro.c View File

@@ -237,7 +237,7 @@ main (int argc, char *argv[])
fprintf (stderr, "invalid duration (tone length = %lu, wave length = %lu\n", tone_length, wave_length);
return -1;
}
if (attack_length + decay_length > tone_length) {
if (attack_length + decay_length > (int)tone_length) {
fprintf (stderr, "invalid attack/decay\n");
return -1;
}
@@ -249,16 +249,16 @@ main (int argc, char *argv[])
for (i = 0; i < attack_length; i++) {
amp[i] = max_amp * i / ((double) attack_length);
}
for (i = attack_length; i < tone_length - decay_length; i++) {
for (i = attack_length; i < (int)tone_length - decay_length; i++) {
amp[i] = max_amp;
}
for (i = tone_length - decay_length; i < tone_length; i++) {
for (i = (int)tone_length - decay_length; i < (int)tone_length; i++) {
amp[i] = - max_amp * (i - (double) tone_length) / ((double) decay_length);
}
for (i = 0; i < tone_length; i++) {
for (i = 0; i < (int)tone_length; i++) {
wave[i] = amp[i] * sin (scale * i);
}
for (i = tone_length; i < wave_length; i++) {
for (i = tone_length; i < (int)wave_length; i++) {
wave[i] = 0;
}



+ 1
- 0
example-clients/monitor_client.c View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

#include <jack/jack.h>



+ 1
- 0
example-clients/showtime.c View File

@@ -2,6 +2,7 @@
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>

#include <jack/jack.h>
#include <jack/transport.h>


+ 1
- 0
example-clients/simple_client.c View File

@@ -2,6 +2,7 @@
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#include <jack/jack.h>



+ 5
- 5
jack/alsa_driver.h View File

@@ -57,10 +57,10 @@ typedef struct {
unsigned long interleave_unit;
unsigned long capture_interleave_skip;
unsigned long playback_interleave_skip;
unsigned long max_nchannels;
unsigned long user_nchannels;
unsigned long playback_nchannels;
unsigned long capture_nchannels;
channel_t max_nchannels;
channel_t user_nchannels;
channel_t playback_nchannels;
channel_t capture_nchannels;
unsigned long sample_bytes;

jack_nframes_t frame_rate;
@@ -186,7 +186,7 @@ static __inline__ void alsa_driver_copy_channel (alsa_driver_t *driver,

void alsa_driver_set_clock_sync_status (alsa_driver_t *driver, channel_t chn, ClockSyncStatus status);
int alsa_driver_listen_for_clock_sync_status (alsa_driver_t *, ClockSyncListenerFunction, void *arg);
int alsa_driver_stop_listen_for_clock_sync_status (alsa_driver_t *, int);
int alsa_driver_stop_listen_for_clock_sync_status (alsa_driver_t *, unsigned int);
void alsa_driver_clock_sync_notify (alsa_driver_t *, channel_t chn, ClockSyncStatus);




+ 28
- 6
jack/cycles.h View File

@@ -22,7 +22,7 @@
#ifndef __jack_cycles_h__
#define __jack_cycles_h__

#ifdef __i386__
#if defined(__i386__) || defined(__x86_64__)

/*
* Standard way to access the cycle counter on i586+ CPUs.
@@ -53,9 +53,8 @@ static inline cycles_t get_cycles (void)
return ret;
}

#else /* !i386 */
#elif defined(__powerpc__)

#ifdef __powerpc__
#define CPU_FTR_601 0x00000100

typedef unsigned long cycles_t;
@@ -83,9 +82,32 @@ static inline cycles_t get_cycles(void)
: "=r" (ret) : "i" (CPU_FTR_601));
return ret;
}
#else /* PPC */

#elif defined(__ia64__)
/* ia64 */

typedef unsigned long cycles_t;
static inline cycles_t
get_cycles (void)
{
cycles_t ret;
__asm__ __volatile__ ("mov %0=ar.itc" : "=r"(ret));
return ret;
}

#elif defined(__alpha__)
/* alpha */

typedef unsigned int cycles_t;
static inline cycles_t get_cycles (void)
{
cycles_t ret;
__asm__ __volatile__ ("rpcc %0" : "=r"(ret));
return ret;
}

#else
#error You are compiling JACK on a platform for which jack/cycles.h needs work
#endif /* PPC */
#endif /* i386 */
#endif

#endif /* __jack_cycles_h__ */

+ 1
- 1
jack/engine.h View File

@@ -49,7 +49,7 @@ struct _jack_engine {
pthread_mutex_t port_lock;
int process_errors;
int period_msecs;
int port_max;
unsigned int port_max;
int control_shm_id;
key_t control_key;
key_t port_segment_key; /* XXX fix me */


+ 1
- 1
jack/internal.h View File

@@ -156,7 +156,7 @@ typedef enum {

typedef volatile struct {

volatile int id; /* w: engine r: engine and client */
volatile jack_client_id_t id; /* w: engine r: engine and client */
volatile jack_nframes_t nframes; /* w: engine r: client */
volatile jack_client_state_t state; /* w: engine and client r: engine */
volatile char name[JACK_CLIENT_NAME_SIZE+1];


+ 1
- 1
jack/types.h View File

@@ -47,7 +47,7 @@ typedef struct _jack_client jack_client_t;
* Ports have unique ids. You will very rarely need to know them, however,
* except in the case of the port registration callback.
*/
typedef long jack_port_id_t;
typedef unsigned long jack_port_id_t;

/**
* Prototype for the client supplied function that is called


+ 14
- 14
jackd/engine.c View File

@@ -53,7 +53,7 @@

#define MAX_SHM_ID 256 /* likely use is more like 16 */

#define NoPort -1
#define NoPort (jack_port_id_t)-1

/**
* Time to wait for clients in msecs. Used when jackd is
@@ -98,7 +98,7 @@ static jack_client_internal_t *jack_client_internal_by_id (jack_engine_t *engine

static void jack_sort_graph (jack_engine_t *engine);
static int jack_rechain_graph (jack_engine_t *engine);
static int jack_get_fifo_fd (jack_engine_t *engine, int which_fifo);
static int jack_get_fifo_fd (jack_engine_t *engine, unsigned int which_fifo);
static void jack_clear_fifos (jack_engine_t *engine);

static int jack_port_do_connect (jack_engine_t *engine, const char *source_port, const char *destination_port);
@@ -336,7 +336,7 @@ jack_add_port_segment (jack_engine_t *engine, unsigned long nports)
key_t key;
int id;
char *addr;
int offset;
size_t offset;
size_t size;
size_t step;

@@ -757,7 +757,7 @@ handle_new_client (jack_engine_t *engine, int client_fd)
}

if (engine->verbose) {
fprintf (stderr, "new client: %s, id = %d type %d @ %p fd = %d\n",
fprintf (stderr, "new client: %s, id = %ld type %d @ %p fd = %d\n",
client->control->name, client->control->id,
req.type, client->control, client_fd);
}
@@ -1152,7 +1152,7 @@ handle_client_request (jack_engine_t *engine, int fd)
return -1;
}

if (read (client->request_fd, &req, sizeof (req)) < sizeof (req)) {
if (read (client->request_fd, &req, sizeof (req)) < (ssize_t) sizeof (req)) {
jack_error ("cannot read request from client");
client->error++;
return -1;
@@ -1231,7 +1231,7 @@ handle_client_request (jack_engine_t *engine, int fd)

if (reply_fd >= 0) {
DEBUG ("replying to client");
if (write (reply_fd, &req, sizeof (req)) < sizeof (req)) {
if (write (reply_fd, &req, sizeof (req)) < (ssize_t) sizeof (req)) {
jack_error ("cannot write request result to client");
return -1;
}
@@ -1360,7 +1360,7 @@ jack_engine_new (int realtime, int rtpriority, int verbose)
jack_engine_t *engine;
size_t control_size;
void *addr;
int i;
unsigned int i;
#ifdef USE_CAPABILITIES
uid_t uid = getuid ();
uid_t euid = geteuid ();
@@ -1930,7 +1930,7 @@ static void
jack_remove_client (jack_engine_t *engine, jack_client_internal_t *client)
{
JSList *node;
int i;
unsigned int i;

if (engine->verbose) {
fprintf (stderr, "adios senor %s\n", client->control->name);
@@ -2446,7 +2446,7 @@ static void
jack_compute_all_port_total_latencies (jack_engine_t *engine)
{
jack_port_shared_t *shared = engine->control->ports;
int i;
unsigned int i;
int toward_port;

for (i = 0; i < engine->control->port_max; i++) {
@@ -2774,7 +2774,7 @@ jack_port_do_disconnect (jack_engine_t *engine,
}

static int
jack_get_fifo_fd (jack_engine_t *engine, int which_fifo)
jack_get_fifo_fd (jack_engine_t *engine, unsigned int which_fifo)

{
/* caller must hold client_lock */
@@ -2804,7 +2804,7 @@ jack_get_fifo_fd (jack_engine_t *engine, int which_fifo)
}

if (which_fifo >= engine->fifo_size) {
int i;
unsigned int i;

engine->fifo = (int *) realloc (engine->fifo, sizeof (int) * engine->fifo_size + 16);
for (i = engine->fifo_size; i < engine->fifo_size + 16; i++) {
@@ -2829,7 +2829,7 @@ jack_clear_fifos (jack_engine_t *engine)
{
/* caller must hold client_lock */

int i;
unsigned int i;
char buf[16];

/* this just drains the existing FIFO's of any data left in them
@@ -3043,7 +3043,7 @@ jack_do_get_port_connections (jack_engine_t *engine, jack_request_t *req, int re

req->x.nports = jack_slist_length (port->connections);

if (write (reply_fd, req, sizeof (*req)) < sizeof (req)) {
if (write (reply_fd, req, sizeof (*req)) < (ssize_t) sizeof (req)) {
jack_error ("cannot write GetPortConnections result to client");
goto out;
}
@@ -3062,7 +3062,7 @@ jack_do_get_port_connections (jack_engine_t *engine, jack_request_t *req, int re
port_id = ((jack_connection_internal_t *) node->data)->source->shared->id;
}
if (write (reply_fd, &port_id, sizeof (port_id)) < sizeof (port_id)) {
if (write (reply_fd, &port_id, sizeof (port_id)) < (ssize_t) sizeof (port_id)) {
jack_error ("cannot write port id to client");
goto out;
}


+ 1
- 1
libjack/client.c View File

@@ -1974,7 +1974,7 @@ jack_port_get_all_connections (const jack_client_t *client, const jack_port_t *p
{
const char **ret;
jack_request_t req;
int i;
unsigned int i;

req.type = GetPortConnections;



+ 1
- 0
libjack/timestamps.c View File

@@ -19,6 +19,7 @@
*/

#include <stdlib.h>
#include <string.h>
#include <jack/timestamps.h>
#include <jack/internal.h>
#include <jack/cycles.h>


Loading…
Cancel
Save