update to 1.9.9.5

epel8
Orcan Ogetbil 12 years ago
parent 021228c411
commit b10034aa26

1
.gitignore vendored

@ -2,3 +2,4 @@ jack-1.9.5.tar.bz2
/jack-1.9.6.tar.bz2
/jack-1.9.7.tar.bz2
/jack-1.9.8.tgz
/jack-1.9.9.5.tar.bz2

@ -1,28 +0,0 @@
diff -Nurp jack-1.9.8.orig/dbus/sigsegv.c jack-1.9.8/dbus/sigsegv.c
--- jack-1.9.8.orig/dbus/sigsegv.c 2011-12-19 12:54:24.000000000 +0100
+++ jack-1.9.8/dbus/sigsegv.c 2012-06-03 15:56:31.306697873 +0200
@@ -60,6 +60,7 @@ static void signal_segv(int signum, sigi
static const char *si_codes[3] = {"", "SEGV_MAPERR", "SEGV_ACCERR"};
size_t i;
+ const char *si_code_str;
ucontext_t *ucontext = (ucontext_t*)ptr;
#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
@@ -94,10 +95,14 @@ static void signal_segv(int signum, sigi
jack_error("Unknown bad signal catched!");
}
- jack_error("info.si_signo = %d", signum);
+ if (info->si_code >= 0 && info->si_code < 3)
+ si_code_str = si_codes[info->si_code];
+ else
+ si_code_str = "unknown"; jack_error("info.si_signo = %d", signum);
+
jack_error("info.si_errno = %d", info->si_errno);
jack_error("info.si_code = %d (%s)", info->si_code, si_codes[info->si_code]);
- jack_error("info.si_addr = %p", info->si_addr);
+ jack_error("info.si_code = %d (%s)", info->si_code, si_code_str);
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__)
for(i = 0; i < NGREG; i++)
jack_error("reg[%02d] = 0x" REGFORMAT, i,

@ -1,15 +0,0 @@
diff -up jack-1.9.6/dbus/sigsegv.c.uc_regs jack-1.9.6/dbus/sigsegv.c
--- jack-1.9.6/dbus/sigsegv.c.uc_regs 2010-08-30 10:24:16.000000000 +0000
+++ jack-1.9.6/dbus/sigsegv.c 2011-03-11 20:40:46.000000000 +0000
@@ -101,8 +101,10 @@ static void signal_segv(int signum, sigi
#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__)
for(i = 0; i < NGREG; i++)
jack_error("reg[%02d] = 0x" REGFORMAT, i,
-#if defined(__powerpc__)
+#if defined(__powerpc__) && !defined(__powerpc64__)
ucontext->uc_mcontext.uc_regs[i]
+#elif defined(__powerpc__) && defined(__powerpc64__)
+ ucontext->uc_mcontext.gp_regs[i]
#elif defined(__sparc__) && defined(__arch64__)
ucontext->uc_mcontext.mc_gregs[i]
#else

@ -3,13 +3,13 @@
Summary: The Jack Audio Connection Kit
Name: jack-audio-connection-kit
Version: 1.9.8
Release: 14%{?dist}
Version: 1.9.9.5
Release: 1%{?dist}
# The entire source (~500 files) is a mixture of these three licenses
License: GPLv2 and GPLv2+ and LGPLv2+
Group: System Environment/Daemons
URL: http://www.jackaudio.org
Source0: http://www.grame.fr/~letz/jack-%{version}.tgz
Source0: https://dl.dropbox.com/u/28869550/jack-%{version}.tar.bz2
Source1: %{name}-README.Fedora
Source2: %{name}-script.pa
Source3: %{name}-limits.conf
@ -19,20 +19,14 @@ Patch0: jack-audio-connection-kit-no_date_footer.patch
Patch1: jack-doxygen-output-dir-fix.patch
# We don't want the internal API documentation
Patch2: jack-apidoc-only.patch
# Enable ffado buffersize change at runtime. From upstream trunk
# https://github.com/jackaudio/jack2/commit/96e025123
Patch3: jack-ffado-buffersize.patch
# Fix doxygen doc build regression. From upstream trunk 95a1162d6aecc91
Patch3: jack-doxygen-buildfix.patch
# Adjust default priority. RHBZ#795094
Patch4: jack-realtime-compat.patch
# Fix jack-connect segfault when invoked with no arguments. From upstream trunk
# https://github.com/jackaudio/jack2/commit/00280570a
Patch5: jack-fix-connect-segfault.patch
# Enable renaming and reordering the jack ports RHBZ#887408
Patch5: jack-portnames.patch
# Fix ppc64 mpd startup issue RHBZ#799552
Patch6: jack-ppc64-long.patch
# uc_regs no longer available on ppc64
Patch7: jack-audio-connection-kit-ppc-uc_regs.patch
# correct sigsegv handling
Patch8: jack-audio-connection-kit-1.9.8-sigsegv-handling.patch
BuildRequires: alsa-lib-devel
BuildRequires: dbus-devel
@ -45,6 +39,8 @@ BuildRequires: libffado-devel
BuildRequires: libsamplerate-devel
BuildRequires: libsndfile-devel
BuildRequires: ncurses-devel
# We are waiting for RHBZ#887530 to enable opus support
#BuildRequires: opus-devel
BuildRequires: pkgconfig
BuildRequires: python2
BuildRequires: readline-devel
@ -77,7 +73,6 @@ Launcher to start Jack through D-Bus.
Summary: Header files for Jack
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
%description devel
Header files for the Jack Audio Connection Kit.
@ -93,16 +88,13 @@ Small example clients that use the Jack Audio Connection Kit.
%prep
%setup -q -n jack-%{version}
pushd jack-%{version}
%patch0 -p1 -b .nodate
%patch1 -p1 -b .outdir
%patch2 -p1 -b .nointernalapi
%patch3 -p1 -b .ffadobuffer
%patch3 -p1 -b .doxyfix
%patch4 -p1 -b .priority
%patch5 -p1 -b .connectcrash
%patch5 -p1 -b .portnames
%patch6 -p1 -b .mpd
%patch7 -p1 -b .uc_regs
%patch8 -p1 -b .sigsegvfault
# Fix encoding issues
for file in ChangeLog README TODO; do
@ -111,18 +103,15 @@ for file in ChangeLog README TODO; do
touch -r $file $file.tmp2
mv -f $file.tmp2 $file
done
popd
%build
pushd jack-%{version}
export CPPFLAGS="$RPM_OPT_FLAGS -DJACK_32_64 -O0"
export CPPFLAGS="$RPM_OPT_FLAGS -O0"
export PREFIX=%{_prefix}
# Parallel build disabled as it fails sometimes
./waf configure \
-j1 \
--mandir=/share/man/man1 \
--libdir=/%{_lib} \
%{?_smp_mflags} \
--mandir=%{_mandir}/man1 \
--libdir=%{_libdir} \
--doxygen \
--dbus \
--classic \
@ -135,10 +124,8 @@ export PREFIX=%{_prefix}
./waf build %{?_smp_mflags} -v
popd
%install
pushd jack-%{version}
./waf --destdir=$RPM_BUILD_ROOT install
# move doxygen documentation to the right place
@ -161,7 +148,6 @@ mv $RPM_BUILD_ROOT%{_bindir}/jack_rec $RPM_BUILD_ROOT%{_bindir}/jackrec
# Fix permissions of the modules
chmod 755 $RPM_BUILD_ROOT%{_libdir}/jack/*.so $RPM_BUILD_ROOT%{_libdir}/libjack*.so.*.*.*
popd
%pre
getent group %groupname > /dev/null || groupadd -r %groupname
@ -172,9 +158,9 @@ exit 0
%postun -p /sbin/ldconfig
%files
%doc jack-%{version}/ChangeLog jack-%{version}/README jack-%{version}/README_NETJACK2 jack-%{version}/TODO
%doc jack-%{version}/README.Fedora
%doc jack-%{version}/jack.pa
%doc ChangeLog README README_NETJACK2 TODO
%doc README.Fedora
%doc jack.pa
%{_bindir}/jackd
%{_bindir}/jackrec
%{_libdir}/jack/
@ -192,7 +178,7 @@ exit 0
%{_bindir}/jack_control
%files devel
%doc jack-%{version}/reference/*
%doc reference/html/
%{_includedir}/jack/
%{_libdir}/libjack.so
%{_libdir}/libjacknet.so
@ -263,6 +249,9 @@ exit 0
%changelog
* Tue Dec 25 2012 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 1.9.9.5-1
- update to 1.9.9.5
* Tue Nov 20 2012 Brendan Jones <brendan.jones.it@gmail.com> 1.9.8-14
- Correct build flags

@ -0,0 +1,39 @@
diff -rupN jack-1.9.9.5.old/wscript jack-1.9.9.5/wscript
--- jack-1.9.9.5.old/wscript 2012-12-10 04:26:57.000000000 -0500
+++ jack-1.9.9.5/wscript 2012-12-16 23:29:44.629292671 -0500
@@ -356,10 +356,11 @@ def build(bld):
bld.add_subdirs('dbus')
if bld.env['BUILD_DOXYGEN_DOCS'] == True:
- share_dir = bld.env.get_destdir() + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
html_docs_source_dir = "build/default/html"
- html_docs_install_dir = share_dir + '/reference/html/'
- if Options.commands['install']:
+ if bld.cmd == 'install':
+ share_dir = bld.options.destdir + bld.env['PREFIX'] + '/share/jack-audio-connection-kit'
+ html_docs_install_dir = share_dir + '/reference/html/'
+
if os.path.isdir(html_docs_install_dir):
Logs.pprint('CYAN', "Removing old doxygen documentation installation...")
shutil.rmtree(html_docs_install_dir)
@@ -367,17 +368,17 @@ def build(bld):
Logs.pprint('CYAN', "Installing doxygen documentation...")
shutil.copytree(html_docs_source_dir, html_docs_install_dir)
Logs.pprint('CYAN', "Installing doxygen documentation done.")
- elif Options.commands['uninstall']:
+ elif bld.cmd =='uninstall':
Logs.pprint('CYAN', "Uninstalling doxygen documentation...")
if os.path.isdir(share_dir):
shutil.rmtree(share_dir)
Logs.pprint('CYAN', "Uninstalling doxygen documentation done.")
- elif Options.commands['clean']:
+ elif bld.cmd =='clean':
if os.access(html_docs_source_dir, os.R_OK):
Logs.pprint('CYAN', "Removing doxygen generated documentation...")
shutil.rmtree(html_docs_source_dir)
Logs.pprint('CYAN', "Removing doxygen generated documentation done.")
- elif Options.commands['build']:
+ elif bld.cmd =='build':
if not os.access(html_docs_source_dir, os.R_OK):
os.popen("doxygen").read()
else:

@ -1,230 +0,0 @@
diff -rupN jack-1.9.8.old/linux/firewire/JackFFADODriver.cpp jack-1.9.8/linux/firewire/JackFFADODriver.cpp
--- jack-1.9.8.old/linux/firewire/JackFFADODriver.cpp 2011-12-19 06:54:27.000000000 -0500
+++ jack-1.9.8/linux/firewire/JackFFADODriver.cpp 2012-03-25 01:38:58.246513167 -0400
@@ -3,6 +3,7 @@ Copyright (C) 2001 Paul Davis
Copyright (C) 2004 Grame
Copyright (C) 2007 Pieter Palmers
Copyright (C) 2009 Devin Anderson
+Copyright (C) 2012 Jonathan Woithe, Adrian Knoth
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
@@ -45,10 +46,20 @@ Foundation, Inc., 675 Mass Ave, Cambridg
#include "JackCompilerDeps.h"
#include "JackLockedEngine.h"
+// FFADO_API_VERSION was first defined with API_VERSION 9, so all previous
+// headers do not provide this define.
+#ifndef FFADO_API_VERSION
+extern "C" int ffado_streaming_set_period_size(ffado_device_t *dev,
+ unsigned int period) __attribute__((__weak__));
+#endif
+
namespace Jack
{
+// Basic functionality requires API version 8. If version 9 or later
+// is present the buffers can be resized at runtime.
#define FIREWIRE_REQUIRED_FFADO_API_VERSION 8
+#define FIREWIRE_REQUIRED_FFADO_API_VERSION_FOR_SETBUFSIZE 9
#define jack_get_microseconds GetMicroSeconds
@@ -253,22 +264,96 @@ JackFFADODriver::ffado_driver_restart (f
return Start();
}
+void
+JackFFADODriver::UpdateLatencies(void)
+{
+ jack_latency_range_t range;
+ ffado_driver_t* driver = (ffado_driver_t*)fDriver;
+
+ for (int i = 0; i < fCaptureChannels; i++) {
+ range.min = range.max = driver->period_size + driver->capture_frame_latency;
+ fGraphManager->GetPort(fCapturePortList[i])->SetLatencyRange(JackCaptureLatency, &range);
+ }
+
+ for (int i = 0; i < fPlaybackChannels; i++) {
+ // Add one buffer more latency if "async" mode is used...
+ range.min = range.max = (driver->period_size *
+ (driver->device_options.nb_buffers - 1)) +
+ ((fEngineControl->fSyncMode) ? 0 : fEngineControl->fBufferSize) + driver->playback_frame_latency;
+ fGraphManager->GetPort(fPlaybackPortList[i])->SetLatencyRange(JackPlaybackLatency, &range);
+ // Monitor port
+ if (fWithMonitorPorts) {
+ range.min = range.max =driver->period_size;
+ fGraphManager->GetPort(fMonitorPortList[i])->SetLatencyRange(JackCaptureLatency, &range);
+ }
+ }
+}
+
int
JackFFADODriver::SetBufferSize (jack_nframes_t nframes)
{
- printError("Buffer size change requested but not supported!!!");
+ ffado_driver_t* driver = (ffado_driver_t*)fDriver;
+ signed int chn;
+
+ // The speed of this function isn't critical; we can afford the
+ // time to check the FFADO API version.
+ if (ffado_get_api_version() < FIREWIRE_REQUIRED_FFADO_API_VERSION_FOR_SETBUFSIZE ||
+ ffado_streaming_set_period_size == NULL) {
+ printError("unsupported on current version of FFADO; please upgrade FFADO");
+ return -1;
+ }
- /*
driver->period_size = nframes;
driver->period_usecs =
(jack_time_t) floor ((((float) nframes) / driver->sample_rate)
* 1000000.0f);
- */
+
+
+ // Reallocate the null and scratch buffers.
+ driver->nullbuffer = (ffado_sample_t*) calloc(driver->period_size, sizeof(ffado_sample_t));
+ if(driver->nullbuffer == NULL) {
+ printError("could not allocate memory for null buffer");
+ return -1;
+ }
+ driver->scratchbuffer = (ffado_sample_t*) calloc(driver->period_size, sizeof(ffado_sample_t));
+ if(driver->scratchbuffer == NULL) {
+ printError("could not allocate memory for scratch buffer");
+ return -1;
+ }
+
+ // MIDI buffers need reallocating
+ for (chn = 0; chn < driver->capture_nchannels; chn++) {
+ if(driver->capture_channels[chn].stream_type == ffado_stream_type_midi) {
+ // setup the midi buffer
+ if (driver->capture_channels[chn].midi_buffer != NULL)
+ free(driver->capture_channels[chn].midi_buffer);
+ driver->capture_channels[chn].midi_buffer = (ffado_sample_t*) calloc(driver->period_size, sizeof(uint32_t));
+ }
+ }
+ for (chn = 0; chn < driver->playback_nchannels; chn++) {
+ if(driver->playback_channels[chn].stream_type == ffado_stream_type_midi) {
+ if (driver->playback_channels[chn].midi_buffer != NULL)
+ free(driver->playback_channels[chn].midi_buffer);
+ driver->playback_channels[chn].midi_buffer = (ffado_sample_t*) calloc(driver->period_size, sizeof(uint32_t));
+ }
+ }
+
+ // Notify FFADO of the period size change
+ if (ffado_streaming_set_period_size(driver->dev, nframes) != 0) {
+ printError("could not alter FFADO device period size");
+ return -1;
+ }
+
+ // This is needed to give the shadow variables a chance to
+ // properly update to the changes.
+ sleep(1);
/* tell the engine to change its buffer size */
- //driver->engine->set_buffer_size (driver->engine, nframes);
+ JackAudioDriver::SetBufferSize(nframes); // Generic change, never fails
+
+ UpdateLatencies();
- return -1; // unsupported
+ return 0;
}
typedef void (*JackDriverFinishFunction) (jack_driver_t *);
@@ -281,7 +366,7 @@ JackFFADODriver::ffado_driver_new (const
assert(params);
- if (ffado_get_api_version() != FIREWIRE_REQUIRED_FFADO_API_VERSION) {
+ if (ffado_get_api_version() < FIREWIRE_REQUIRED_FFADO_API_VERSION) {
printError("Incompatible libffado version! (%s)", ffado_get_version());
return NULL;
}
@@ -349,7 +434,6 @@ int JackFFADODriver::Attach()
jack_port_id_t port_index;
char buf[REAL_JACK_PORT_NAME_SIZE];
char portname[REAL_JACK_PORT_NAME_SIZE];
- jack_latency_range_t range;
ffado_driver_t* driver = (ffado_driver_t*)fDriver;
@@ -435,8 +519,6 @@ int JackFFADODriver::Attach()
ffado_streaming_capture_stream_onoff(driver->dev, chn, 0);
port = fGraphManager->GetPort(port_index);
- range.min = range.max = driver->period_size + driver->capture_frame_latency;
- port->SetLatencyRange(JackCaptureLatency, &range);
// capture port aliases (jackd1 style port names)
snprintf(buf, sizeof(buf), "%s:capture_%i", fClientControl.fName, (int) chn + 1);
port->SetAlias(buf);
@@ -466,9 +548,6 @@ int JackFFADODriver::Attach()
// setup the midi buffer
driver->capture_channels[chn].midi_buffer = (uint32_t *)calloc(driver->period_size, sizeof(uint32_t));
- port = fGraphManager->GetPort(port_index);
- range.min = range.max = driver->period_size + driver->capture_frame_latency;
- port->SetLatencyRange(JackCaptureLatency, &range);
fCapturePortList[chn] = port_index;
jack_log("JackFFADODriver::Attach fCapturePortList[i] %ld ", port_index);
fCaptureChannels++;
@@ -512,8 +591,6 @@ int JackFFADODriver::Attach()
port = fGraphManager->GetPort(port_index);
// Add one buffer more latency if "async" mode is used...
- range.min = range.max = (driver->period_size * (driver->device_options.nb_buffers - 1)) + ((fEngineControl->fSyncMode) ? 0 : fEngineControl->fBufferSize) + driver->playback_frame_latency;
- port->SetLatencyRange(JackPlaybackLatency, &range);
// playback port aliases (jackd1 style port names)
snprintf(buf, sizeof(buf), "%s:playback_%i", fClientControl.fName, (int) chn + 1);
port->SetAlias(buf);
@@ -548,9 +625,6 @@ int JackFFADODriver::Attach()
driver->playback_channels[chn].midi_buffer = (uint32_t *)calloc(driver->period_size, sizeof(uint32_t));
- port = fGraphManager->GetPort(port_index);
- range.min = range.max = (driver->period_size * (driver->device_options.nb_buffers - 1)) + ((fEngineControl->fSyncMode) ? 0 : fEngineControl->fBufferSize) + driver->playback_frame_latency;
- port->SetLatencyRange(JackPlaybackLatency, &range);
fPlaybackPortList[chn] = port_index;
jack_log("JackFFADODriver::Attach fPlaybackPortList[i] %ld ", port_index);
fPlaybackChannels++;
@@ -559,6 +633,8 @@ int JackFFADODriver::Attach()
}
}
+ UpdateLatencies();
+
assert(fCaptureChannels < DRIVER_PORT_NUM);
assert(fPlaybackChannels < DRIVER_PORT_NUM);
diff -rupN jack-1.9.8.old/linux/firewire/JackFFADODriver.h jack-1.9.8/linux/firewire/JackFFADODriver.h
--- jack-1.9.8.old/linux/firewire/JackFFADODriver.h 2011-12-19 06:54:27.000000000 -0500
+++ jack-1.9.8/linux/firewire/JackFFADODriver.h 2012-03-25 01:38:05.708754669 -0400
@@ -2,6 +2,7 @@
Copyright (C) 2001 Paul Davis
Copyright (C) 2004 Grame
Copyright (C) 2007 Pieter Palmers
+Copyright (C) 2012 Adrian Knoth
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
@@ -59,6 +60,7 @@ class JackFFADODriver : public JackAudio
void jack_driver_init (jack_driver_t *driver);
void jack_driver_nt_init (jack_driver_nt_t * driver);
+ void UpdateLatencies();
public:
@@ -80,6 +82,12 @@ class JackFFADODriver : public JackAudio
int Read();
int Write();
+ // BufferSize can be changed
+ bool IsFixedBufferSize()
+ {
+ return false;
+ }
+
int SetBufferSize(jack_nframes_t nframes);
};

@ -1,35 +0,0 @@
From 00280570af529e4a54009bd5c6aeeab05286efcf Mon Sep 17 00:00:00 2001
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Date: Thu, 8 Mar 2012 21:54:22 +0100
Subject: [PATCH] Fix segfault in jack_connect
When jack_connect is called without any argument, it causes a segfault
in
snprintf( portA, sizeof(portA), "%s", argv[argc-1] );
snprintf( portB, sizeof(portB), "%s", argv[argc-2] );
Reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662199
---
example-clients/connect.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/example-clients/connect.c b/example-clients/connect.c
index 5ed112b..0f4f8be 100644
--- a/example-clients/connect.c
+++ b/example-clients/connect.c
@@ -128,7 +128,10 @@ void port_connect_callback(jack_port_id_t a, jack_port_id_t b, int connect, void
return 1;
}
- if (argc < 3) show_usage(my_name);
+ if (argc < 3) {
+ show_usage(my_name);
+ return 1;
+ }
/* try to become a client of the JACK server */
--
1.7.5.4

@ -0,0 +1,447 @@
1.) Human-readable portnames on larger cards where "playback_56" is
simply to cumbersome to figure out what's actually connected
2.) People who travel with ADAT-ADCs/DACs, but connect them via
different interfaces in different locations, e.g. a Multiface
when on the road and a RayDat when in the studio. Despite the
different cards, the port names and hence any ardour session
would remain intact.
http://adi.loris.tv/jackd2-portnames.png
alsa_pcm:hw:1,0:out1
system:capture_1
alsa_pcm:hw:1,0:out2
system:capture_2
--- /dev/null
+++ b/linux/alsa/port_names.c
@@ -0,0 +1,179 @@
+/* -*- mode: c; c-file-style: "linux"; -*- */
+/*
+ Copyright (C) 2010 Florian Faber, faber@faberman.de
+
+ 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.
+
+*/
+
+
+#include <math.h>
+#include <stdio.h>
+#include <memory.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <regex.h>
+#include <string.h>
+
+#include "alsa_driver.h"
+
+
+static int port_names_load_portfile(alsa_driver_t *driver, const char *filename, char **buf, const unsigned int offset, const unsigned int num) {
+ int fh, i, ret, lineno, id, res=0;
+ char line[256];
+
+ printf("Trying to load portnames from %s\n", filename);
+ fh = open(filename, O_RDONLY);
+ if (-1!=fh) {
+ res = 1;
+ i = 0;
+ lineno = 1;
+ for (;;) {
+ ret = read(fh, &line[i], 1);
+ if (0==ret) {
+ break;
+ } else if (-1==ret) {
+ sprintf(stderr, "Error while reading \"%s\": %s", filename, strerror(errno));
+ break;
+ }
+ if (0x0A==line[i]) {
+ /* new line, parse input */
+ line[i] = 0;
+
+ if ('#' != line[0]) {
+ i=0;
+ while ((i<255) && (line[i]!='=')) i++;
+ if (255==i) {
+ sprintf(stderr, "Error while reading \"%s\": Line %d has no key=value syntax!", filename, lineno);
+ } else {
+ line[i] = 0;
+ id = atoi(line);
+ if ((id>=1) && (id<=num)) {
+ if (NULL==buf[id-1+offset]) {
+ /* don't overwrite existing names */
+ buf[id-1+offset] = strdup(&line[i+1]);
+ }
+ } else {
+ sprintf(stderr, "Error while reading \"%s\": Key %d out of range in line %d (1..%d)", filename, id, lineno, num);
+ }
+ }
+ }
+
+ i = 0;
+ lineno++;
+ } else {
+ i++;
+ if (i==255) {
+ sprintf(stderr, "Error while reading \"%s\": Line %d is too long", filename, lineno);
+ break;
+ }
+ }
+ }
+
+ (void) close(fh);
+ }
+
+ return res;
+}
+
+
+static void port_names_default_portnames(char **buf, const unsigned int offset, const unsigned int num, const char *defaultname) {
+ unsigned int i;
+ char line[256];
+
+ /* Fill in default names */
+ for (i=0; i<num; i++) {
+ if (NULL==buf[i+offset]) {
+ snprintf(line, 255, defaultname, i+1);
+ buf[i+offset] = strdup(line);
+ }
+ }
+}
+
+
+char** port_names_get_portnames(alsa_driver_t *driver) {
+ snd_ctl_card_info_t *card_info;
+ int err;
+ const char *card_name = NULL;
+ char filename[256], *speed;
+ char **buf;
+
+ printf("Using port names patch v0.1 (07.04.2010)\n");
+
+ if (driver->frame_rate > 96000) {
+ speed="qs";
+ } else if (driver->frame_rate > 48000) {
+ speed="ds";
+ } else {
+ speed="ss";
+ }
+
+ snd_ctl_card_info_alloca(&card_info);
+ err = snd_ctl_card_info(driver->ctl_handle, card_info);
+ if (err >= 0) {
+ card_name = snd_ctl_card_info_get_name(card_info);
+ } else {
+ card_name = "noname";
+ }
+
+ buf = malloc(sizeof(char *)*(driver->capture_nchannels + driver->playback_nchannels));
+ if (NULL==buf) {
+ sprintf(stderr, "ALSA: Not enough memory for %d port names", driver->capture_nchannels + driver->playback_nchannels);
+ return NULL;
+ }
+ bzero(buf, sizeof(char *)*(driver->capture_nchannels + driver->playback_nchannels));
+
+ /* Read port names from special to general:
+ * Begin with user and speed specific port names */
+ snprintf(filename, 255, "%s/.config/jack/cards/%s.%s.ports.in", getenv("HOME"), card_name, speed);
+ (void) port_names_load_portfile(driver, filename, buf, 0, driver->capture_nchannels);
+
+ /* Now user general */
+ snprintf(filename, 255, "%s/.config/jack/cards/%s.ports.in", getenv("HOME"), card_name);
+ (void) port_names_load_portfile(driver, filename, buf, 0, driver->capture_nchannels);
+
+ /* System speed specific */
+ snprintf(filename, 255, "/etc/jack/cards/%s.%s.ports.in", card_name, speed);
+ (void) port_names_load_portfile(driver, filename, buf, 0, driver->capture_nchannels);
+
+ /* System general */
+ snprintf(filename, 255, "/etc/jack/cards/%s.ports.in", card_name);
+ (void) port_names_load_portfile(driver, filename, buf, 0, driver->capture_nchannels);
+
+ /* Fill all still unnamed ports with default names */
+ port_names_default_portnames(buf, 0, driver->capture_nchannels, "capture_%lu");
+
+
+ /* Same procedure for the playback channels */
+ snprintf(filename, 255, "%s/.config/jack/cards/%s.%s.ports.out", getenv("HOME"), card_name, speed);
+ (void) port_names_load_portfile(driver, filename, buf, driver->capture_nchannels, driver->playback_nchannels);
+
+ snprintf(filename, 255, "%s/.config/jack/cards/%s.ports.out", getenv("HOME"), card_name);
+ (void) port_names_load_portfile(driver, filename, buf, driver->capture_nchannels, driver->playback_nchannels);
+
+ snprintf(filename, 255, "/etc/jack/cards/%s.%s.ports.out", card_name, speed);
+ (void) port_names_load_portfile(driver, filename, buf, driver->capture_nchannels, driver->playback_nchannels);
+
+ snprintf(filename, 255, "/etc/jack/cards/%s.ports.out", card_name);
+ (void) port_names_load_portfile(driver, filename, buf, driver->capture_nchannels, driver->playback_nchannels);
+
+ port_names_default_portnames(buf, driver->capture_nchannels, driver->playback_nchannels, "playback_%lu");
+
+ return buf;
+}
--- /dev/null
+++ b/linux/alsa/port_names.h
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2010 Florian Faber, faber@faberman.de
+
+ 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 __jack_port_names_h__
+#define __jack_port_names_h__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+char** port_names_get_portnames(alsa_driver_t *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __jack_port_names_h__ */
--- a/linux/alsa/JackAlsaDriver.cpp
+++ b/linux/alsa/JackAlsaDriver.cpp
@@ -42,6 +42,7 @@
#include "JackPosixThread.h"
#include "JackCompilerDeps.h"
#include "JackServerGlobals.h"
+#include "port_names.h"
namespace Jack
{
@@ -97,6 +98,8 @@
unsigned long port_flags = (unsigned long)CaptureDriverFlags;
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
+ char old_name[REAL_JACK_PORT_NAME_SIZE];
+ char **portnames;
assert(fCaptureChannels < DRIVER_PORT_NUM);
assert(fPlaybackChannels < DRIVER_PORT_NUM);
@@ -112,13 +115,17 @@
jack_log("JackAlsaDriver::Attach fBufferSize %ld fSampleRate %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
+ portnames = port_names_get_portnames(alsa_driver);
+
for (int i = 0; i < fCaptureChannels; i++) {
snprintf(alias, sizeof(alias), "%s:%s:out%d", fAliasName, fCaptureDriverName, i + 1);
- snprintf(name, sizeof(name), "%s:capture_%d", fClientControl.fName, i + 1);
+ snprintf(old_name, sizeof(old_name), "%s:capture_%d", fClientControl.fName, i + 1);
+ snprintf(name, sizeof(name), "%s:%s", fClientControl.fName, portnames[i]);
if (fEngine->PortRegister(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize, &port_index) < 0) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
+ free(portnames[i]);
port = fGraphManager->GetPort(port_index);
port->SetAlias(alias);
fCapturePortList[i] = port_index;
@@ -129,11 +136,13 @@
for (int i = 0; i < fPlaybackChannels; i++) {
snprintf(alias, sizeof(alias), "%s:%s:in%d", fAliasName, fPlaybackDriverName, i + 1);
- snprintf(name, sizeof(name), "%s:playback_%d", fClientControl.fName, i + 1);
+ snprintf(old_name, sizeof(old_name), "%s:playback_%d", fClientControl.fName, i + 1);
+ snprintf(name, sizeof(name), "%s:%s", fClientControl.fName, portnames[i+fCaptureChannels]);
if (fEngine->PortRegister(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize, &port_index) < 0) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
+ free(portnames[i+fCaptureChannels]);
port = fGraphManager->GetPort(port_index);
port->SetAlias(alias);
fPlaybackPortList[i] = port_index;
@@ -151,6 +160,8 @@
}
}
+ free(portnames);
+
UpdateLatencies();
if (alsa_driver->midi) {
--- a/linux/wscript
+++ b/linux/wscript
@@ -55,6 +55,7 @@
'alsa/hdsp.c',
'alsa/alsa_driver.c',
'alsa/hammerfall.c',
+ 'alsa/port_names.c',
'alsa/ice1712.c'
]
alsa_pcm:hw:1,0:out1
system:capture_1
alsa_pcm:hw:1,0:out2
system:capture_2
alsa_pcm:hw:1,0:out3
system:capture_3
alsa_pcm:hw:1,0:out4
system:capture_4
alsa_pcm:hw:1,0:out5
system:capture_5
alsa_pcm:hw:1,0:out6
system:capture_6
alsa_pcm:hw:1,0:out7
system:capture_7
alsa_pcm:hw:1,0:out8
system:capture_8
alsa_pcm:hw:1,0:out9
system:capture_9
alsa_pcm:hw:1,0:out10
system:capture_10
alsa_pcm:hw:1,0:out11
system:capture_11
alsa_pcm:hw:1,0:out12
system:capture_12
alsa_pcm:hw:1,0:out13
system:capture_13
alsa_pcm:hw:1,0:out14
system:capture_14
alsa_pcm:hw:1,0:out15
system:capture_15
alsa_pcm:hw:1,0:out16
system:capture_16
alsa_pcm:hw:1,0:out17
system:capture_17
alsa_pcm:hw:1,0:out18
system:capture_18
alsa_pcm:hw:1,0:out19
system:capture_19
alsa_pcm:hw:1,0:out20
system:capture_20
alsa_pcm:hw:1,0:out21
system:capture_21
alsa_pcm:hw:1,0:out22
system:capture_22
alsa_pcm:hw:1,0:out23
system:capture_23
alsa_pcm:hw:1,0:out24
system:capture_24
alsa_pcm:hw:1,0:out25
system:capture_25
alsa_pcm:hw:1,0:out26
system:capture_26
alsa_pcm:hw:1,0:out27
system:capture_27
alsa_pcm:hw:1,0:out28
system:capture_28
alsa_pcm:hw:1,0:out29
system:capture_29
alsa_pcm:hw:1,0:out30
system:capture_30
alsa_pcm:hw:1,0:out31
system:capture_31
alsa_pcm:hw:1,0:out32
system:capture_32
alsa_pcm:hw:1,0:out33
system:capture_33
alsa_pcm:hw:1,0:out34
system:capture_34
alsa_pcm:hw:1,0:out35
system:capture_35
alsa_pcm:hw:1,0:out36
system:capture_36
alsa_pcm:hw:1,0:in1
system:playback_1
alsa_pcm:hw:1,0:in2
system:playback_2
alsa_pcm:hw:1,0:in3
system:playback_3
alsa_pcm:hw:1,0:in4
system:playback_4
alsa_pcm:hw:1,0:in5
system:playback_5
alsa_pcm:hw:1,0:in6
system:playback_6
alsa_pcm:hw:1,0:in7
system:playback_7
alsa_pcm:hw:1,0:in8
system:playback_8
alsa_pcm:hw:1,0:in9
system:playback_9
alsa_pcm:hw:1,0:in10
system:playback_10
alsa_pcm:hw:1,0:in11
system:playback_11
alsa_pcm:hw:1,0:in12
system:playback_12
alsa_pcm:hw:1,0:in13
system:playback_13
alsa_pcm:hw:1,0:in14
system:playback_14
alsa_pcm:hw:1,0:in15
system:playback_15
alsa_pcm:hw:1,0:in16
system:playback_16
alsa_pcm:hw:1,0:in17
system:playback_17
alsa_pcm:hw:1,0:in18
system:playback_18
alsa_pcm:hw:1,0:in19
system:playback_19
alsa_pcm:hw:1,0:in20
system:playback_20
alsa_pcm:hw:1,0:in21
system:playback_21
alsa_pcm:hw:1,0:in22
system:playback_22
alsa_pcm:hw:1,0:in23
system:playback_23
alsa_pcm:hw:1,0:in24
system:playback_24
alsa_pcm:hw:1,0:in25
system:playback_25
alsa_pcm:hw:1,0:in26
system:playback_26
alsa_pcm:hw:1,0:in27
system:playback_27
alsa_pcm:hw:1,0:in28
system:playback_28
alsa_pcm:hw:1,0:in29
system:playback_29
alsa_pcm:hw:1,0:in30
system:playback_30
alsa_pcm:hw:1,0:in31
system:playback_31
alsa_pcm:hw:1,0:in32
system:playback_32
alsa_pcm:hw:1,0:in33
system:playback_33
alsa_pcm:hw:1,0:in34
system:playback_34
alsa_pcm:hw:1,0:in35
system:playback_35
alsa_pcm:hw:1,0:in36
system:playback_36

@ -1,24 +1,58 @@
diff -rupN jack-1.9.8.old/common/JackControlAPI.cpp jack-1.9.8/common/JackControlAPI.cpp
--- jack-1.9.8.old/common/JackControlAPI.cpp 2011-12-19 06:54:02.000000000 -0500
+++ jack-1.9.8/common/JackControlAPI.cpp 2012-04-07 15:04:06.882823048 -0400
@@ -678,7 +678,7 @@ SERVER_EXPORT jackctl_server_t * jackctl
diff -rupN jack-1.9.9.5.old/common/JackControlAPI.cpp jack-1.9.9.5/common/JackControlAPI.cpp
--- jack-1.9.9.5.old/common/JackControlAPI.cpp 2012-12-10 04:26:56.000000000 -0500
+++ jack-1.9.9.5/common/JackControlAPI.cpp 2012-12-15 21:40:01.639927082 -0500
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <assert.h>
#include <signal.h>
+#include <sys/utsname.h>
#include "jslist.h"
#include "driver_interface.h"
@@ -756,7 +757,14 @@ SERVER_EXPORT jackctl_server_t * jackctl
goto fail_free_parameters;
}
- value.i = 10;
+ value.i = 60;
+ struct utsname utsname;
+ int success;
+ success = uname( &utsname );
+ if( success == 0 && strstr( utsname.version, "PREEMPT RT" ) )
+ value.i = 60;
+ else
+ value.i = 20;
+
if (jackctl_add_parameter(
&server_ptr->parameters,
"realtime-priority",
diff -rupN jack-1.9.8.old/common/JackServerGlobals.cpp jack-1.9.8/common/JackServerGlobals.cpp
--- jack-1.9.8.old/common/JackServerGlobals.cpp 2011-12-19 06:54:02.000000000 -0500
+++ jack-1.9.8/common/JackServerGlobals.cpp 2012-04-07 15:05:11.841498738 -0400
@@ -98,7 +98,7 @@ bool JackServerGlobals::Init()
diff -rupN jack-1.9.9.5.old/common/JackServerGlobals.cpp jack-1.9.9.5/common/JackServerGlobals.cpp
--- jack-1.9.9.5.old/common/JackServerGlobals.cpp 2012-12-10 04:26:56.000000000 -0500
+++ jack-1.9.9.5/common/JackServerGlobals.cpp 2012-12-15 21:45:43.793194190 -0500
@@ -23,6 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
#include "shm.h"
#include <getopt.h>
#include <errno.h>
+#include <sys/utsname.h>
static char* server_name = NULL;
@@ -96,9 +97,18 @@ void JackServerGlobals::Delete()
bool JackServerGlobals::Init()
{
+ struct utsname utsname;
+ int success;
+ success = uname( &utsname );
+
int realtime = 0;
int client_timeout = 0; /* msecs; if zero, use period size. */
- int realtime_priority = 10;
+ int realtime_priority = 60;
+ int realtime_priority;
+ if( success == 0 && strstr( utsname.version, "PREEMPT RT" ) )
+ realtime_priority = 60;
+ else
+ realtime_priority = 20;
+
int verbose_aux = 0;
int do_mlock = 1;
unsigned int port_max = 128;
int temporary = 0;

@ -1 +1 @@
1dd2ff054cab79dfc11d134756f27165 jack-1.9.8.tgz
6c9de6b89db9d7076fa2ce222816cf4c jack-1.9.9.5.tar.bz2

Loading…
Cancel
Save