From f31ca67009984f2ada8f481e9557dc1fd8e81430 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 29 Aug 2006 15:21:17 +0000 Subject: [PATCH] name fix for hw monitoring function plus fix for RME "mixer" control (from nick mainsbridge git-svn-id: svn+ssh://jackaudio.org/trunk/jack@985 0c269be4-1314-0410-8aa9-9f06e86f4224 --- configure.ac | 4 ++-- drivers/alsa/hammerfall.c | 2 +- drivers/dummy/dummy_driver.c | 36 ++++++++++++++++++++++++++++++++++++ jackd/clientengine.c | 2 +- libjack/port.c | 2 +- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 9f3b5a5..42a278e 100644 --- a/configure.ac +++ b/configure.ac @@ -80,8 +80,8 @@ AM_PROG_LIBTOOL AC_PROG_LN_S AC_C_BIGENDIAN -# Required due to initialization bug in PKG_CHECK_MODULES() -PKG_PROG_PKG_CONFIG([0.0.1]) +dnl Required due to initialization bug in PKG_CHECK_MODULES() +dnl PKG_PROG_PKG_CONFIG([0.0.1]) AC_MSG_CHECKING([platform dependencies]) diff --git a/drivers/alsa/hammerfall.c b/drivers/alsa/hammerfall.c index f8d3e0f..fbb57bc 100644 --- a/drivers/alsa/hammerfall.c +++ b/drivers/alsa/hammerfall.c @@ -32,7 +32,7 @@ set_control_id (snd_ctl_elem_id_t *ctl, const char *name) { snd_ctl_elem_id_set_name (ctl, name); snd_ctl_elem_id_set_numid (ctl, 0); - snd_ctl_elem_id_set_interface (ctl, SND_CTL_ELEM_IFACE_PCM); + snd_ctl_elem_id_set_interface (ctl, SND_CTL_ELEM_IFACE_MIXER); snd_ctl_elem_id_set_device (ctl, 0); snd_ctl_elem_id_set_subdevice (ctl, 0); snd_ctl_elem_id_set_index (ctl, 0); diff --git a/drivers/dummy/dummy_driver.c b/drivers/dummy/dummy_driver.c index 897735a..922b50e 100644 --- a/drivers/dummy/dummy_driver.c +++ b/drivers/dummy/dummy_driver.c @@ -41,6 +41,39 @@ /* this is used for calculate what counts as an xrun */ #define PRETEND_BUFFER_SIZE 4096 +void +FakeVideoSync( dummy_driver_t *driver ) +{ + static const int VIDEO_SYNC_PERIOD = 48000 / 30; + static int vidCounter = VIDEO_SYNC_PERIOD; + + int period = driver->period_size; + jack_position_t *position = &driver->engine->control->current_time; + + if ( period >= VIDEO_SYNC_PERIOD ) { + printf("JACK driver period size too large for simple video sync emulation. Halting.\n"); + exit(0); + } + + //enable video sync, whether it occurs in this period or not + position->audio_frames_per_video_frame = VIDEO_SYNC_PERIOD; + position->valid = (jack_position_bits_t) (position->valid | JackAudioVideoRatio); + + //no video pulse found in this period, just decrement the counter + if ( vidCounter > period ) { + vidCounter -= period; + } + + //video pulse occurs in this period + if ( vidCounter <= period ) { + int remainder = period - vidCounter; + vidCounter = VIDEO_SYNC_PERIOD - remainder; + + position->video_offset = vidCounter; + position->valid = (jack_position_bits_t) (position->valid | JackVideoFrameOffset); + } +} + static jack_nframes_t dummy_driver_wait (dummy_driver_t *driver, int extra_fd, int *status, float *delayed_usecs) @@ -97,6 +130,8 @@ dummy_driver_run_cycle (dummy_driver_t *driver) return 0; } + // FakeVideoSync (driver); + if (wait_status == 0) return engine->run_cycle (engine, nframes, delayed_usecs); @@ -386,3 +421,4 @@ driver_finish (jack_driver_t *driver) { dummy_driver_delete ((dummy_driver_t *) driver); } + diff --git a/jackd/clientengine.c b/jackd/clientengine.c index ab43651..916ec76 100644 --- a/jackd/clientengine.c +++ b/jackd/clientengine.c @@ -660,7 +660,7 @@ jack_client_create (jack_engine_t *engine, int client_fd) /* JACK protocol incompatibility */ res.status |= (JackFailure|JackVersionError); - jack_error ("JACK protocol mismatch"); + jack_error ("JACK protocol mismatch (%d vs %d)", req.protocol_v, jack_protocol_version); if (write (client_fd, &res, sizeof (res)) != sizeof (res)) { jack_error ("cannot write client connection response"); } diff --git a/libjack/port.c b/libjack/port.c index 38f0122..455f4aa 100644 --- a/libjack/port.c +++ b/libjack/port.c @@ -848,7 +848,7 @@ jack_port_request_monitor_by_name (jack_client_t *client, } int -jack_ensure_port_monitor_input (jack_port_t *port, int yn) +jack_port_ensure_monitor (jack_port_t *port, int yn) { if (yn) { if (port->shared->monitor_requests == 0) {