From b19c12ba569628845b014953848c25a5498e4169 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 01:11:13 +0100 Subject: [PATCH 01/17] Split example-clients and tools, as done for jack1 Signed-off-by: falkTX --- example-clients/wscript | 77 +++--------------- {example-clients => tools}/alias.c | 0 {example-clients => tools}/alsa_in.c | 0 {example-clients => tools}/alsa_out.c | 0 {example-clients => tools}/bufsize.c | 0 {example-clients => tools}/connect.c | 0 {example-clients => tools}/evmon.c | 0 {example-clients => tools}/freewheel.c | 0 {example-clients => tools}/ipload.c | 0 {example-clients => tools}/ipunload.c | 0 {example-clients => tools}/jack_control | 0 {example-clients => tools}/lsp.c | 0 {example-clients => tools}/midi_dump.c | 0 {example-clients => tools}/monitor_client.c | 0 {example-clients => tools}/netsource.c | 0 {example-clients => tools}/property.c | 0 {example-clients => tools}/samplerate.c | 0 {example-clients => tools}/session_notify.c | 0 {example-clients => tools}/transport.c | 0 {example-clients => tools}/tw.c | 0 {example-clients => tools}/wait.c | 0 tools/wscript | 90 +++++++++++++++++++++ wscript | 3 + 23 files changed, 102 insertions(+), 68 deletions(-) rename {example-clients => tools}/alias.c (100%) rename {example-clients => tools}/alsa_in.c (100%) rename {example-clients => tools}/alsa_out.c (100%) rename {example-clients => tools}/bufsize.c (100%) rename {example-clients => tools}/connect.c (100%) rename {example-clients => tools}/evmon.c (100%) rename {example-clients => tools}/freewheel.c (100%) rename {example-clients => tools}/ipload.c (100%) rename {example-clients => tools}/ipunload.c (100%) rename {example-clients => tools}/jack_control (100%) rename {example-clients => tools}/lsp.c (100%) rename {example-clients => tools}/midi_dump.c (100%) rename {example-clients => tools}/monitor_client.c (100%) rename {example-clients => tools}/netsource.c (100%) rename {example-clients => tools}/property.c (100%) rename {example-clients => tools}/samplerate.c (100%) rename {example-clients => tools}/session_notify.c (100%) rename {example-clients => tools}/transport.c (100%) rename {example-clients => tools}/tw.c (100%) rename {example-clients => tools}/wait.c (100%) create mode 100644 tools/wscript diff --git a/example-clients/wscript b/example-clients/wscript index a8857aa79..0afc4ba26 100644 --- a/example-clients/wscript +++ b/example-clients/wscript @@ -2,35 +2,21 @@ # encoding: utf-8 example_programs = { - 'jack_freewheel' : 'freewheel.c', - 'jack_connect' : 'connect.c', - 'jack_lsp' : 'lsp.c', + 'jack_cpu_load' : 'cpu_load.c', + 'jack_latent_client' : 'latent_client.c', 'jack_metro' : 'metro.c', + 'jack_midi_latency_test' : 'midi_latency_test.c', 'jack_midiseq' : 'midiseq.c', 'jack_midisine' : 'midisine.c', + 'jack_net_master' : 'netmaster.c', + 'jack_net_slave' : 'netslave.c', + 'jack_server_control' : 'server_control.cpp', 'jack_showtime' : 'showtime.c', + 'jack_simdtests' : 'simdtests.cpp', 'jack_simple_client' : 'simple_client.c', - 'jack_zombie' : 'zombie.c', - 'jack_load' : 'ipload.c', - 'jack_unload' : 'ipunload.c', - 'jack_alias' : 'alias.c', - 'jack_bufsize' : 'bufsize.c', - 'jack_wait' : 'wait.c', - 'jack_samplerate' : 'samplerate.c', - 'jack_evmon' : 'evmon.c', - 'jack_monitor_client' : 'monitor_client.c', - 'jack_thru' : 'thru_client.c', - 'jack_cpu_load' : 'cpu_load.c', 'jack_simple_session_client' : 'simple_session_client.c', - 'jack_session_notify' : 'session_notify.c', - 'jack_server_control' : 'server_control.cpp', - 'jack_net_slave' : 'netslave.c', - 'jack_net_master' : 'netmaster.c', - 'jack_latent_client' : 'latent_client.c', - 'jack_midi_dump' : 'midi_dump.c', - 'jack_midi_latency_test' : 'midi_latency_test.c', - 'jack_simdtests' : 'simdtests.cpp', - 'jack_property' : 'property.c', + 'jack_thru' : 'thru_client.c', + 'jack_zombie' : 'zombie.c', } example_libs = { @@ -38,12 +24,8 @@ example_libs = { } def configure(conf): - conf.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] = conf.env['READLINE'] - conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.env['SNDFILE'] - conf.env['BUILD_EXAMPLE_ALSA_IO'] = conf.env['SAMPLERATE'] and conf.env['BUILD_DRIVER_ALSA'] - def build(bld): if bld.env['IS_LINUX']: os_incdir = ['../linux', '../posix'] @@ -83,19 +65,6 @@ def build(bld): prog.target = example_program - if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']: - prog = bld(features = 'c cprogram') - prog.includes = os_incdir + ['../common/jack', '../common'] - prog.source = 'transport.c' - prog.use = ['clientlib'] - if bld.env['IS_LINUX']: - prog.use += ['RT', 'READLINE'] - if bld.env['IS_MACOSX']: - prog.use += ['READLINE'] - if bld.env['IS_WINDOWS']: - prog.use += ['READLINE'] - prog.target = 'jack_transport' - if bld.env['BUILD_EXAMPLE_CLIENT_REC']: prog = bld(features = 'c cprogram') prog.includes = os_incdir + ['../common/jack', '../common'] @@ -111,30 +80,6 @@ def build(bld): prog.uselib = ['SNDFILE'] prog.target = 'jack_rec' - if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']: - prog = bld(features = 'c cprogram') - prog.includes = os_incdir + ['.', '..', '../common/jack', '../common'] - prog.source = ['netsource.c', '../common/netjack_packet.c'] - prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') - prog.use = ['CELT', 'SAMPLERATE', 'OPUS', 'M', 'clientlib'] - prog.target = 'jack_netsource' - prog.defines = ['HAVE_CONFIG_H'] - - if bld.env['IS_LINUX'] and bld.env['BUILD_EXAMPLE_ALSA_IO']: - prog = bld(features = 'c cprogram') - prog.includes = os_incdir + ['../common/jack', '../common'] - prog.source = ['alsa_in.c', '../common/memops.c'] - prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') - prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M'] - prog.target = 'alsa_in' - - prog = bld(features = 'c cprogram') - prog.includes = os_incdir + ['../common/jack', '../common'] - prog.source = ['alsa_out.c', '../common/memops.c'] - prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') - prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M'] - prog.target = 'alsa_out' - for example_lib, example_lib_source in list(example_libs.items()): lib = bld(features = 'c cshlib') if not bld.env['IS_WINDOWS']: @@ -146,7 +91,3 @@ def build(bld): lib.env.append_value('LINKFLAGS', '-lm') lib.use = 'serverlib' lib.install_path = '${ADDON_DIR}/' - - if not bld.env['IS_WINDOWS']: - bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect') - bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755) diff --git a/example-clients/alias.c b/tools/alias.c similarity index 100% rename from example-clients/alias.c rename to tools/alias.c diff --git a/example-clients/alsa_in.c b/tools/alsa_in.c similarity index 100% rename from example-clients/alsa_in.c rename to tools/alsa_in.c diff --git a/example-clients/alsa_out.c b/tools/alsa_out.c similarity index 100% rename from example-clients/alsa_out.c rename to tools/alsa_out.c diff --git a/example-clients/bufsize.c b/tools/bufsize.c similarity index 100% rename from example-clients/bufsize.c rename to tools/bufsize.c diff --git a/example-clients/connect.c b/tools/connect.c similarity index 100% rename from example-clients/connect.c rename to tools/connect.c diff --git a/example-clients/evmon.c b/tools/evmon.c similarity index 100% rename from example-clients/evmon.c rename to tools/evmon.c diff --git a/example-clients/freewheel.c b/tools/freewheel.c similarity index 100% rename from example-clients/freewheel.c rename to tools/freewheel.c diff --git a/example-clients/ipload.c b/tools/ipload.c similarity index 100% rename from example-clients/ipload.c rename to tools/ipload.c diff --git a/example-clients/ipunload.c b/tools/ipunload.c similarity index 100% rename from example-clients/ipunload.c rename to tools/ipunload.c diff --git a/example-clients/jack_control b/tools/jack_control similarity index 100% rename from example-clients/jack_control rename to tools/jack_control diff --git a/example-clients/lsp.c b/tools/lsp.c similarity index 100% rename from example-clients/lsp.c rename to tools/lsp.c diff --git a/example-clients/midi_dump.c b/tools/midi_dump.c similarity index 100% rename from example-clients/midi_dump.c rename to tools/midi_dump.c diff --git a/example-clients/monitor_client.c b/tools/monitor_client.c similarity index 100% rename from example-clients/monitor_client.c rename to tools/monitor_client.c diff --git a/example-clients/netsource.c b/tools/netsource.c similarity index 100% rename from example-clients/netsource.c rename to tools/netsource.c diff --git a/example-clients/property.c b/tools/property.c similarity index 100% rename from example-clients/property.c rename to tools/property.c diff --git a/example-clients/samplerate.c b/tools/samplerate.c similarity index 100% rename from example-clients/samplerate.c rename to tools/samplerate.c diff --git a/example-clients/session_notify.c b/tools/session_notify.c similarity index 100% rename from example-clients/session_notify.c rename to tools/session_notify.c diff --git a/example-clients/transport.c b/tools/transport.c similarity index 100% rename from example-clients/transport.c rename to tools/transport.c diff --git a/example-clients/tw.c b/tools/tw.c similarity index 100% rename from example-clients/tw.c rename to tools/tw.c diff --git a/example-clients/wait.c b/tools/wait.c similarity index 100% rename from example-clients/wait.c rename to tools/wait.c diff --git a/tools/wscript b/tools/wscript new file mode 100644 index 000000000..29e751ff6 --- /dev/null +++ b/tools/wscript @@ -0,0 +1,90 @@ +#! /usr/bin/python3 +# encoding: utf-8 + +example_tools = { + 'jack_alias' : 'alias.c', + 'jack_bufsize' : 'bufsize.c', + 'jack_connect' : 'connect.c', + 'jack_evmon' : 'evmon.c', + 'jack_freewheel' : 'freewheel.c', + 'jack_load' : 'ipload.c', + 'jack_lsp' : 'lsp.c', + 'jack_midi_dump' : 'midi_dump.c', + 'jack_monitor_client' : 'monitor_client.c', + 'jack_property' : 'property.c', + 'jack_samplerate' : 'samplerate.c', + 'jack_session_notify' : 'session_notify.c', + 'jack_unload' : 'ipunload.c', + 'jack_wait' : 'wait.c', + } + +def configure(conf): + conf.env['BUILD_EXAMPLE_ALSA_IO'] = conf.env['SAMPLERATE'] and conf.env['BUILD_DRIVER_ALSA'] + conf.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] = conf.env['READLINE'] + +def build(bld): + if bld.env['IS_LINUX']: + os_incdir = ['../linux', '../posix'] + if bld.env['IS_MACOSX']: + os_incdir = ['../macosx', '../posix'] + if bld.env['IS_SUN']: + os_incdir = ['../solaris', '../posix'] + if bld.env['IS_WINDOWS']: + os_incdir = ['../windows'] + for example_tool, example_tool_source in list(example_tools.items()): + if bld.env['IS_MACOSX']: + prog = bld(features='c cprogram', framework = ['Foundation']) + else: + prog = bld(features='c cprogram') + prog.includes = os_incdir + ['../common/jack', '../common'] + prog.source = example_tool_source + prog.use = ['clientlib'] + if bld.env['IS_LINUX']: + prog.use += ['RT', 'M'] + if bld.env['IS_SUN']: + prog.use += ['M'] + #prog.cflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] + #prog.cxxflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] + + prog.target = example_tool + + if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']: + prog = bld(features = 'c cprogram') + prog.includes = os_incdir + ['../common/jack', '../common'] + prog.source = 'transport.c' + prog.use = ['clientlib'] + if bld.env['IS_LINUX']: + prog.use += ['RT', 'READLINE'] + if bld.env['IS_MACOSX']: + prog.use += ['READLINE'] + if bld.env['IS_WINDOWS']: + prog.use += ['READLINE'] + prog.target = 'jack_transport' + + if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']: + prog = bld(features = 'c cprogram') + prog.includes = os_incdir + ['.', '..', '../common/jack', '../common'] + prog.source = ['netsource.c', '../common/netjack_packet.c'] + prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') + prog.use = ['CELT', 'SAMPLERATE', 'OPUS', 'M', 'clientlib'] + prog.target = 'jack_netsource' + prog.defines = ['HAVE_CONFIG_H'] + + if bld.env['IS_LINUX'] and bld.env['BUILD_EXAMPLE_ALSA_IO']: + prog = bld(features = 'c cprogram') + prog.includes = os_incdir + ['../common/jack', '../common'] + prog.source = ['alsa_in.c', '../common/memops.c'] + prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') + prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M'] + prog.target = 'alsa_in' + + prog = bld(features = 'c cprogram') + prog.includes = os_incdir + ['../common/jack', '../common'] + prog.source = ['alsa_out.c', '../common/memops.c'] + prog.env.append_value('CFLAGS', '-DNO_JACK_ERROR') + prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M'] + prog.target = 'alsa_out' + + if not bld.env['IS_WINDOWS']: + bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect') + bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755) diff --git a/wscript b/wscript index dce2c662a..9e16f1a64 100644 --- a/wscript +++ b/wscript @@ -289,6 +289,7 @@ def configure(conf): conf.recurse('example-clients') + conf.recurse('tools') # test for the availability of ucontext, and how it should be used for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']: @@ -804,6 +805,8 @@ def build(bld): build_drivers(bld) bld.recurse('example-clients') + bld.recurse('tools') + if bld.env['IS_LINUX']: bld.recurse('man') bld.recurse('systemd') From 34da6cce6e49fdfcfeab7c80b47c3527e06d7089 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 02:39:17 +0100 Subject: [PATCH 02/17] Special tricks for static win64 mixed build Signed-off-by: falkTX --- wscript | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wscript b/wscript index 9e16f1a64..d3a1d5cba 100644 --- a/wscript +++ b/wscript @@ -425,6 +425,14 @@ def configure(conf): conf.env['LIBDIR'] = Options.options.libdir32 else: conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib32' + + if conf.env['IS_WINDOWS'] and conf.env['BUILD_STATIC']: + def replaceFor32bit(env): + for e in env: yield e.replace('x86_64', 'i686', 1) + for env in ('AR', 'CC', 'CXX', 'LINK_CC', 'LINK_CXX'): + conf.all_envs[lib32][env] = list(replaceFor32bit(conf.all_envs[lib32][env])) + conf.all_envs[lib32]['LIB_REGEX'] = ['tre32'] + # libdb does not work in mixed mode conf.all_envs[lib32]['HAVE_DB'] = 0 conf.all_envs[lib32]['HAVE_DB_H'] = 0 From 99b7a20486a9de4ec905bcaf3aa31bce05c246e0 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 02:43:58 +0100 Subject: [PATCH 03/17] Install 32bit libjack.dll on 64bit windows installer Signed-off-by: falkTX --- windows/inno/win64.iss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/inno/win64.iss b/windows/inno/win64.iss index a89002052..82151c8bb 100644 --- a/windows/inno/win64.iss +++ b/windows/inno/win64.iss @@ -35,6 +35,7 @@ Source: "win64\lib\jack\*.dll"; DestDir: "{app}\jack"; Source: "win64\bin\jack_*.exe"; DestDir: "{app}\tools"; ; jack client lib (NOTE goes into windir) Source: "win64\lib\libjack64.dll"; DestDir: "{win}"; +Source: "win64\lib32\libjack.dll"; DestDir: "{win}"; ; qjackctl Source: "win64\bin\qjackctl.exe"; DestDir: "{app}\qjackctl"; Components: qjackctl; Source: "Qt5*.dll"; DestDir: "{app}\qjackctl"; Components: qjackctl; @@ -42,6 +43,7 @@ Source: "qwindows.dll"; DestDir: "{app}\qjackctl\platforms"; Components: qjackct ; dev Source: "win64\include\jack\*.h"; DestDir: "{app}\include"; Components: dev; Source: "win64\lib\*.a"; DestDir: "{app}\lib"; Components: dev; +Source: "win64\lib32\*.a"; DestDir: "{app}\lib32"; Components: dev; Source: "win64\lib\jack\*.a"; DestDir: "{app}\lib\jack"; Components: dev; [Icons] From 230cd6cc64089a415b5b833d6504fca6a162c8c7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 15:50:16 +0100 Subject: [PATCH 04/17] winmme: allow to activate without any ports, fix some warnings Signed-off-by: falkTX --- windows/winmme/JackWinMMEDriver.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/windows/winmme/JackWinMMEDriver.cpp b/windows/winmme/JackWinMMEDriver.cpp index e22098540..ab1bc9090 100644 --- a/windows/winmme/JackWinMMEDriver.cpp +++ b/windows/winmme/JackWinMMEDriver.cpp @@ -204,8 +204,8 @@ JackWinMMEDriver::Open(bool capturing, bool playing, int in_channels, new JackWinMMEOutputPort(fAliasName, client_name, playback_driver_name, i); } catch (std::exception& e) { - jack_error("JackWinMMEDriver::Open - while creating output " - "port: %s", e.what()); + jack_error("JackWinMMEDriver::Open - while creating output port: %s | %s, %s, %s", + e.what(), fAliasName, client_name, playback_driver_name); continue; } output_count++; @@ -215,10 +215,7 @@ JackWinMMEDriver::Open(bool capturing, bool playing, int in_channels, jack_log("JackWinMMEDriver::Open - input_count %d", input_count); jack_log("JackWinMMEDriver::Open - output_count %d", output_count); - if (! (input_count || output_count)) { - jack_error("JackWinMMEDriver::Open - no WinMME inputs or outputs " - "allocated."); - } else if (! JackMidiDriver::Open(capturing, playing, input_count, + if (! JackMidiDriver::Open(capturing, playing, input_count, output_count, monitor, capture_driver_name, playback_driver_name, capture_latency, @@ -286,7 +283,7 @@ JackWinMMEDriver::Start() jack_log("JackWinMMEDriver::Start - Enabling input ports."); for (; input_count < fCaptureChannels; input_count++) { - if (input_ports[input_count]->Start() < 0) { + if (! input_ports[input_count]->Start()) { jack_error("JackWinMMEDriver::Start - Failed to enable input " "port."); goto stop_input_ports; @@ -296,7 +293,7 @@ JackWinMMEDriver::Start() jack_log("JackWinMMEDriver::Start - Enabling output ports."); for (; output_count < fPlaybackChannels; output_count++) { - if (output_ports[output_count]->Start() < 0) { + if (! output_ports[output_count]->Start()) { jack_error("JackWinMMEDriver::Start - Failed to enable output " "port."); goto stop_output_ports; @@ -308,14 +305,14 @@ JackWinMMEDriver::Start() stop_output_ports: for (int i = 0; i < output_count; i++) { - if (output_ports[i]->Stop() < 0) { + if (! output_ports[i]->Stop()) { jack_error("JackWinMMEDriver::Start - Failed to disable output " "port."); } } stop_input_ports: for (int i = 0; i < input_count; i++) { - if (input_ports[i]->Stop() < 0) { + if (! input_ports[i]->Stop()) { jack_error("JackWinMMEDriver::Start - Failed to disable input " "port."); } @@ -334,7 +331,7 @@ JackWinMMEDriver::Stop() jack_log("JackWinMMEDriver::Stop - disabling input ports."); for (int i = 0; i < fCaptureChannels; i++) { - if (input_ports[i]->Stop() < 0) { + if (! input_ports[i]->Stop()) { jack_error("JackWinMMEDriver::Stop - Failed to disable input " "port."); result = -1; @@ -344,7 +341,7 @@ JackWinMMEDriver::Stop() jack_log("JackWinMMEDriver::Stop - disabling output ports."); for (int i = 0; i < fPlaybackChannels; i++) { - if (output_ports[i]->Stop() < 0) { + if (! output_ports[i]->Stop()) { jack_error("JackWinMMEDriver::Stop - Failed to disable output " "port."); result = -1; From 78c93766af1bc362a1a51643bb492cfaffce0ee1 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 16:50:09 +0100 Subject: [PATCH 05/17] Use static pthread for windows static builds Signed-off-by: falkTX --- example-clients/wscript | 6 ++++++ tools/wscript | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/example-clients/wscript b/example-clients/wscript index 0afc4ba26..7e0b9931b 100644 --- a/example-clients/wscript +++ b/example-clients/wscript @@ -60,6 +60,8 @@ def build(bld): prog.use += ['RT', 'M'] if bld.env['IS_SUN']: prog.use += ['M'] + if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']: + prog.env['LIB_PTHREAD'] = [':libwinpthread.a'] #prog.cflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] #prog.cxxflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] @@ -78,6 +80,8 @@ def build(bld): prog.use += ['RT', 'SNDFILE'] if bld.env['IS_WINDOWS']: prog.uselib = ['SNDFILE'] + if bld.env['BUILD_STATIC']: + prog.env['LIB_PTHREAD'] = [':libwinpthread.a'] prog.target = 'jack_rec' for example_lib, example_lib_source in list(example_libs.items()): @@ -89,5 +93,7 @@ def build(bld): lib.source = example_lib_source if bld.env['IS_SUN']: lib.env.append_value('LINKFLAGS', '-lm') + if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']: + prog.env['LIB_PTHREAD'] = [':libwinpthread.a'] lib.use = 'serverlib' lib.install_path = '${ADDON_DIR}/' diff --git a/tools/wscript b/tools/wscript index 29e751ff6..0fc90289d 100644 --- a/tools/wscript +++ b/tools/wscript @@ -43,6 +43,8 @@ def build(bld): prog.use += ['RT', 'M'] if bld.env['IS_SUN']: prog.use += ['M'] + if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']: + prog.env['LIB_PTHREAD'] = [':libwinpthread.a'] #prog.cflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] #prog.cxxflags = ['-Wno-deprecated-declarations', '-Wno-misleading-indentation'] @@ -59,6 +61,8 @@ def build(bld): prog.use += ['READLINE'] if bld.env['IS_WINDOWS']: prog.use += ['READLINE'] + if bld.env['BUILD_STATIC']: + prog.env['LIB_PTHREAD'] = [':libwinpthread.a'] prog.target = 'jack_transport' if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']: From d539727a2d14e2431ec9feb6d5806f0174d4e433 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 20 Sep 2020 16:56:37 +0100 Subject: [PATCH 06/17] Update default jack location on windows, per new installers Signed-off-by: falkTX --- windows/JackPlatformPlug_os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/JackPlatformPlug_os.h b/windows/JackPlatformPlug_os.h index 326b7e98d..a38816fd3 100644 --- a/windows/JackPlatformPlug_os.h +++ b/windows/JackPlatformPlug_os.h @@ -24,7 +24,7 @@ #define jack_server_dir "server" #define jack_client_dir "client" #define JACK_DEFAULT_DRIVER "portaudio" -#define JACK_LOCATION "C:/Program Files/Jack" +#define JACK_LOCATION "C:\\Program Files\\JACK2" #ifndef ADDON_DIR #define ADDON_DIR "jack" From ee7963e00f9e34d4f1ca053c87398768d9d5251c Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 24 Sep 2020 20:13:44 +0100 Subject: [PATCH 07/17] Update gitignore Signed-off-by: falkTX --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 8d51f0aa3..143396fe5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ man/*.1 .stamp_* .DS_Store __pycache__ +*.dll *.pyc *.pkg android/.server/ @@ -14,3 +15,7 @@ codeBlocks macos/package.xml macos/package-welcome.txt +# windows release files +windows/inno/version.iss +windows/inno/win32 +windows/inno/win64 From c48cb451910538e6c6831ce0b89e0b0608f1fb30 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 24 Sep 2020 20:15:44 +0100 Subject: [PATCH 08/17] Correct the include dir used in the windows installer Signed-off-by: falkTX --- windows/inno/win32.iss | 2 +- windows/inno/win64.iss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/inno/win32.iss b/windows/inno/win32.iss index 44753f0af..65f62933b 100644 --- a/windows/inno/win32.iss +++ b/windows/inno/win32.iss @@ -39,7 +39,7 @@ Source: "win32\bin\qjackctl.exe"; DestDir: "{app}\qjackctl"; Components: qjackct Source: "Qt5*.dll"; DestDir: "{app}\qjackctl"; Components: qjackctl; Source: "qwindows.dll"; DestDir: "{app}\qjackctl\platforms"; Components: qjackctl; ; dev -Source: "win32\include\jack\*.h"; DestDir: "{app}\include"; Components: dev; +Source: "win32\include\jack\*.h"; DestDir: "{app}\include\jack"; Components: dev; Source: "win32\lib\*.a"; DestDir: "{app}\lib"; Components: dev; Source: "win32\lib\jack\*.a"; DestDir: "{app}\lib\jack"; Components: dev; diff --git a/windows/inno/win64.iss b/windows/inno/win64.iss index 82151c8bb..d3e7b28bc 100644 --- a/windows/inno/win64.iss +++ b/windows/inno/win64.iss @@ -41,7 +41,7 @@ Source: "win64\bin\qjackctl.exe"; DestDir: "{app}\qjackctl"; Components: qjackct Source: "Qt5*.dll"; DestDir: "{app}\qjackctl"; Components: qjackctl; Source: "qwindows.dll"; DestDir: "{app}\qjackctl\platforms"; Components: qjackctl; ; dev -Source: "win64\include\jack\*.h"; DestDir: "{app}\include"; Components: dev; +Source: "win64\include\jack\*.h"; DestDir: "{app}\include\jack"; Components: dev; Source: "win64\lib\*.a"; DestDir: "{app}\lib"; Components: dev; Source: "win64\lib32\*.a"; DestDir: "{app}\lib32"; Components: dev; Source: "win64\lib\jack\*.a"; DestDir: "{app}\lib\jack"; Components: dev; From 2cfd3d008c5969bfd7529eac88d035cb80cf7b24 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 25 Sep 2020 19:19:49 +0100 Subject: [PATCH 09/17] Generate def files for Windows builds Signed-off-by: falkTX --- common/wscript | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/wscript b/common/wscript index 6520b044f..907693b72 100644 --- a/common/wscript +++ b/common/wscript @@ -145,17 +145,18 @@ def build(bld): if bld.env['IS_MACOSX']: clientlib.framework = ['CoreAudio', 'Accelerate'] clientlib.defines = 'HAVE_CONFIG_H' + clientlib.includes = includes + clientlib.name = 'clientlib' + clientlib.target = 'jack'+libsuffix clientlib.use = uselib if bld.env['IS_WINDOWS']: clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' clientlib.env['cxxstlib_PATTERN'] = 'lib%s.a' clientlib.env['implib_PATTERN'] = 'lib%s.dll.a' - clientlib.install_path = '${LIBDIR}' + clientlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % clientlib.target]) if bld.env['AUTOSTART_METHOD'] == 'dbus': clientlib.use.append('DBUS-1') - clientlib.includes = includes - clientlib.name = 'clientlib' - clientlib.target = 'jack'+libsuffix + clientlib.install_path = '${LIBDIR}' clientlib.source = [] + common_libsources clientlib.source += [ 'JackLibClient.cpp', @@ -228,6 +229,7 @@ def build(bld): serverlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' serverlib.env['cxxstlib_PATTERN'] = 'lib%s.a' serverlib.env['implib_PATTERN'] = 'lib%s.dll.a' + serverlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % serverlib.target]) if staticbuild: serverlib.env['SHLIB_MARKER'] = '' serverlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) @@ -330,6 +332,7 @@ def build(bld): netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' netlib.env['cxxstlib_PATTERN'] = 'lib%s.a' netlib.env['implib_PATTERN'] = 'lib%s.dll.a' + netlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % netlib.target]) if staticbuild: netlib.env['SHLIB_MARKER'] = '' netlib.use += ['WS2_32', 'WINMM'] From cc114987bb4479f23d16207160be427d91109358 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 25 Sep 2020 21:36:30 +0100 Subject: [PATCH 10/17] Generate and install Windows libraries def files Signed-off-by: falkTX --- common/wscript | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/common/wscript b/common/wscript index 907693b72..a9dde2718 100644 --- a/common/wscript +++ b/common/wscript @@ -132,6 +132,7 @@ def build(bld): ] includes = ['../windows' ] + includes libsuffix = "64" if (bld.env['DEST_CPU'] == "x86_64" and not bld.variant) else "" + buildbindir = os.path.join('..', bld.path.get_bld().srcpath().rstrip(bld.path.srcpath())) staticbuild = bool('BUILD_STATIC' in bld.env and bld.env['BUILD_STATIC']) uselib.append('REGEX') uselib.append('WS2_32') @@ -148,15 +149,20 @@ def build(bld): clientlib.includes = includes clientlib.name = 'clientlib' clientlib.target = 'jack'+libsuffix + clientlib.install_path = '${LIBDIR}' clientlib.use = uselib if bld.env['IS_WINDOWS']: - clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' - clientlib.env['cxxstlib_PATTERN'] = 'lib%s.a' - clientlib.env['implib_PATTERN'] = 'lib%s.dll.a' - clientlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % clientlib.target]) + clientlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' + clientlib.env['cxxstlib_PATTERN'] = 'lib%s.a' + clientlib.env['implib_PATTERN'] = 'lib%s.dll.a' + if staticbuild: + clientlib.env['SHLIB_MARKER'] = '' + clientlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) + clientlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % clientlib.target]) + bld.install_files(clientlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % clientlib.target)]) + if bld.env['AUTOSTART_METHOD'] == 'dbus': clientlib.use.append('DBUS-1') - clientlib.install_path = '${LIBDIR}' clientlib.source = [] + common_libsources clientlib.source += [ 'JackLibClient.cpp', @@ -203,15 +209,6 @@ def build(bld): if bld.env['IS_SUN']: clientlib.env.append_value('LINKFLAGS', '-lnsl -lsocket') - if bld.env['IS_WINDOWS']: - # remove switch to shared binaries if possible, as we most likely want static builds on Windows - if staticbuild: - clientlib.env['SHLIB_MARKER'] = '' - # statically link libjack to libstdc++, some client apps like ardour come - # with a different version of libstdc++.dll that takes precedence and results - # in missing symbols during runtime - clientlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) - if bld.variant: # if there is variant defined, we expect it to be the 32bit client lib one # we don't want to build other stuff in this variant @@ -224,16 +221,17 @@ def build(bld): serverlib.includes = includes serverlib.name = 'serverlib' serverlib.target = 'jackserver'+libsuffix + serverlib.install_path = '${LIBDIR}' serverlib.use = uselib if bld.env['IS_WINDOWS']: serverlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' serverlib.env['cxxstlib_PATTERN'] = 'lib%s.a' serverlib.env['implib_PATTERN'] = 'lib%s.dll.a' - serverlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % serverlib.target]) if staticbuild: serverlib.env['SHLIB_MARKER'] = '' serverlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) - serverlib.install_path = '${LIBDIR}' + serverlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % serverlib.target]) + bld.install_files(serverlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % serverlib.target)]) serverlib.source = [] + common_libsources serverlib.source += [ 'JackAudioDriver.cpp', @@ -327,18 +325,20 @@ def build(bld): netlib.includes = includes netlib.name = 'netlib' netlib.target = 'jacknet'+libsuffix + netlib.install_path = '${LIBDIR}' netlib.use = ['SAMPLERATE', 'CELT', 'OPUS', 'PTHREAD'] if bld.env['IS_WINDOWS']: - netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' - netlib.env['cxxstlib_PATTERN'] = 'lib%s.a' - netlib.env['implib_PATTERN'] = 'lib%s.dll.a' - netlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % netlib.target]) - if staticbuild: - netlib.env['SHLIB_MARKER'] = '' - netlib.use += ['WS2_32', 'WINMM'] + netlib.use += ['WS2_32', 'WINMM'] + netlib.env['cxxshlib_PATTERN'] = 'lib%s.dll' + netlib.env['cxxstlib_PATTERN'] = 'lib%s.a' + netlib.env['implib_PATTERN'] = 'lib%s.dll.a' + if staticbuild: + netlib.env['SHLIB_MARKER'] = '' + netlib.env.append_value('LINKFLAGS', ['-static-libstdc++', '--disable-auto-import']) + netlib.env.append_value('LINKFLAGS', ['-Wl,--output-def,lib%s.def' % netlib.target]) + bld.install_files(netlib.install_path, [os.path.join(buildbindir, 'lib%s.def' % netlib.target)]) elif not bld.env['IS_MACOSX']: - netlib.use += ['RT'] - netlib.install_path = '${LIBDIR}' + netlib.use += ['RT'] netlib.source = [ 'JackNetAPI.cpp', 'JackNetInterface.cpp', From b5ce525f2217038de3648f53422254309f20692d Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 25 Sep 2020 21:57:25 +0100 Subject: [PATCH 11/17] Install def and lib files in the Windows installer Signed-off-by: falkTX --- windows/inno/win32.iss | 2 ++ windows/inno/win64.iss | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/windows/inno/win32.iss b/windows/inno/win32.iss index 65f62933b..c4d58e103 100644 --- a/windows/inno/win32.iss +++ b/windows/inno/win32.iss @@ -41,6 +41,8 @@ Source: "qwindows.dll"; DestDir: "{app}\qjackctl\platforms"; Components: qjackct ; dev Source: "win32\include\jack\*.h"; DestDir: "{app}\include\jack"; Components: dev; Source: "win32\lib\*.a"; DestDir: "{app}\lib"; Components: dev; +Source: "win32\lib\*.def"; DestDir: "{app}\lib"; Components: dev; +Source: "win32\lib\*.lib"; DestDir: "{app}\lib"; Components: dev; Source: "win32\lib\jack\*.a"; DestDir: "{app}\lib\jack"; Components: dev; [Icons] diff --git a/windows/inno/win64.iss b/windows/inno/win64.iss index d3e7b28bc..e4e509a8f 100644 --- a/windows/inno/win64.iss +++ b/windows/inno/win64.iss @@ -43,7 +43,11 @@ Source: "qwindows.dll"; DestDir: "{app}\qjackctl\platforms"; Components: qjackct ; dev Source: "win64\include\jack\*.h"; DestDir: "{app}\include\jack"; Components: dev; Source: "win64\lib\*.a"; DestDir: "{app}\lib"; Components: dev; +Source: "win64\lib\*.def"; DestDir: "{app}\lib"; Components: dev; +Source: "win64\lib\*.lib"; DestDir: "{app}\lib"; Components: dev; Source: "win64\lib32\*.a"; DestDir: "{app}\lib32"; Components: dev; +Source: "win64\lib32\*.def"; DestDir: "{app}\lib32"; Components: dev; +Source: "win64\lib32\*.lib"; DestDir: "{app}\lib32"; Components: dev; Source: "win64\lib\jack\*.a"; DestDir: "{app}\lib\jack"; Components: dev; [Icons] From a9c362060ba4182e3ea61a8d142d45da9ef63762 Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Sat, 3 Oct 2020 11:37:40 +0200 Subject: [PATCH 12/17] Correct use of Start/Stop return type in JackCoreMidiDriver. --- macosx/coremidi/JackCoreMidiDriver.mm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/macosx/coremidi/JackCoreMidiDriver.mm b/macosx/coremidi/JackCoreMidiDriver.mm index 791c30c10..a39f9a5bf 100644 --- a/macosx/coremidi/JackCoreMidiDriver.mm +++ b/macosx/coremidi/JackCoreMidiDriver.mm @@ -633,7 +633,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Start - Enabling physical input ports."); for (; pi_count < num_physical_inputs; pi_count++) { - if (physical_input_ports[pi_count]->Start() < 0) { + if (!physical_input_ports[pi_count]->Start()) { jack_error("JackCoreMidiDriver::Start - Failed to enable physical " "input port."); goto stop_physical_input_ports; @@ -643,7 +643,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Start - Enabling physical output ports."); for (; po_count < num_physical_outputs; po_count++) { - if (physical_output_ports[po_count]->Start() < 0) { + if (!physical_output_ports[po_count]->Start()) { jack_error("JackCoreMidiDriver::Start - Failed to enable physical " "output port."); goto stop_physical_output_ports; @@ -653,7 +653,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Start - Enabling virtual input ports."); for (; vi_count < num_virtual_inputs; vi_count++) { - if (virtual_input_ports[vi_count]->Start() < 0) { + if (!virtual_input_ports[vi_count]->Start()) { jack_error("JackCoreMidiDriver::Start - Failed to enable virtual " "input port."); goto stop_virtual_input_ports; @@ -663,7 +663,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Start - Enabling virtual output ports."); for (; vo_count < num_virtual_outputs; vo_count++) { - if (virtual_output_ports[vo_count]->Start() < 0) { + if (!virtual_output_ports[vo_count]->Start()) { jack_error("JackCoreMidiDriver::Start - Failed to enable virtual " "output port."); goto stop_virtual_output_ports; @@ -676,28 +676,28 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, stop_virtual_output_ports: for (int i = 0; i < vo_count; i++) { - if (virtual_output_ports[i]->Stop() < 0) { + if (!virtual_output_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Start - Failed to disable virtual " "output port."); } } stop_virtual_input_ports: for (int i = 0; i < vi_count; i++) { - if (virtual_input_ports[i]->Stop() < 0) { + if (!virtual_input_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Start - Failed to disable virtual " "input port."); } } stop_physical_output_ports: for (int i = 0; i < po_count; i++) { - if (physical_output_ports[i]->Stop() < 0) { + if (!physical_output_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Start - Failed to disable " "physical output port."); } } stop_physical_input_ports: for (int i = 0; i < pi_count; i++) { - if (physical_input_ports[i]->Stop() < 0) { + if (!physical_input_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Start - Failed to disable " "physical input port."); } @@ -716,7 +716,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Stop - disabling physical input ports."); for (int i = 0; i < num_physical_inputs; i++) { - if (physical_input_ports[i]->Stop() < 0) { + if (!physical_input_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Stop - Failed to disable physical " "input port."); result = -1; @@ -726,7 +726,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Stop - disabling physical output ports."); for (int i = 0; i < num_physical_outputs; i++) { - if (physical_output_ports[i]->Stop() < 0) { + if (!physical_output_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Stop - Failed to disable physical " "output port."); result = -1; @@ -736,7 +736,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Stop - disabling virtual input ports."); for (int i = 0; i < num_virtual_inputs; i++) { - if (virtual_input_ports[i]->Stop() < 0) { + if (!virtual_input_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Stop - Failed to disable virtual " "input port."); result = -1; @@ -746,7 +746,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, jack_info("JackCoreMidiDriver::Stop - disabling virtual output ports."); for (int i = 0; i < num_virtual_outputs; i++) { - if (virtual_output_ports[i]->Stop() < 0) { + if (!virtual_output_ports[i]->Stop()) { jack_error("JackCoreMidiDriver::Stop - Failed to disable virtual " "output port."); result = -1; @@ -825,7 +825,7 @@ new JackCoreMidiVirtualOutputPort(fAliasName, client_name, desc = jack_driver_descriptor_construct("coremidi", JackDriverSlave, "Apple CoreMIDI API based MIDI backend", &filler); - value.ui = 0; + value.ui = 0; jack_driver_descriptor_add_parameter(desc, &filler, "inchannels", 'i', JackDriverParamUInt, &value, NULL, "CoreMIDI virtual bus", NULL); jack_driver_descriptor_add_parameter(desc, &filler, "outchannels", 'o', JackDriverParamUInt, &value, NULL, "CoreMIDI virtual bus", NULL); From 4f8849bdc6ac897a9cf7cf3e23827da6d4c1d663 Mon Sep 17 00:00:00 2001 From: Adam Miartus Date: Fri, 27 Sep 2019 16:59:51 +0200 Subject: [PATCH 13/17] alsa_driver: remove unused variable Change-Id: I98fc02a877a830d375b458f0346fc9a43993e72c Signed-off-by: Adam Miartus --- linux/alsa/alsa_driver.c | 3 --- linux/alsa/alsa_driver.h | 1 - 2 files changed, 4 deletions(-) diff --git a/linux/alsa/alsa_driver.c b/linux/alsa/alsa_driver.c index e6d111bed..43ad5d7fa 100644 --- a/linux/alsa/alsa_driver.c +++ b/linux/alsa/alsa_driver.c @@ -837,10 +837,8 @@ alsa_driver_set_parameters (alsa_driver_t *driver, if (driver->playback_nchannels > driver->capture_nchannels) { driver->max_nchannels = driver->playback_nchannels; - driver->user_nchannels = driver->capture_nchannels; } else { driver->max_nchannels = driver->capture_nchannels; - driver->user_nchannels = driver->playback_nchannels; } alsa_driver_setup_io_function_pointers (driver); @@ -2040,7 +2038,6 @@ alsa_driver_new (char *name, char *playback_alsa_device, driver->hw = 0; driver->capture_and_playback_not_synced = FALSE; driver->max_nchannels = 0; - driver->user_nchannels = 0; driver->playback_nchannels = user_playback_nchnls; driver->capture_nchannels = user_capture_nchnls; driver->playback_sample_bytes = (shorts_first ? 2:4); diff --git a/linux/alsa/alsa_driver.h b/linux/alsa/alsa_driver.h index efe93de5d..6045d5b12 100644 --- a/linux/alsa/alsa_driver.h +++ b/linux/alsa/alsa_driver.h @@ -72,7 +72,6 @@ typedef struct _alsa_driver { unsigned long *capture_interleave_skip; unsigned long *playback_interleave_skip; channel_t max_nchannels; - channel_t user_nchannels; channel_t playback_nchannels; channel_t capture_nchannels; unsigned long playback_sample_bytes; From 87da6c7d3866db889cda57f2b8926dc010ee9e1b Mon Sep 17 00:00:00 2001 From: Adam Miartus Date: Mon, 30 Sep 2019 14:57:52 +0200 Subject: [PATCH 14/17] jack alsa: reoganize code for readability Change-Id: I3d79e5f2516d8709b70dc700e5c9a04534619661 Signed-off-by: Adam Miartus (cherry picked from commit 7a7d3b3524877533c0d5a9d3490d862d4323d280) Signed-off-by: Timo Wischer --- linux/alsa/JackAlsaDriver.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/linux/alsa/JackAlsaDriver.cpp b/linux/alsa/JackAlsaDriver.cpp index 0bd904d5c..0ac291989 100644 --- a/linux/alsa/JackAlsaDriver.cpp +++ b/linux/alsa/JackAlsaDriver.cpp @@ -352,21 +352,22 @@ int JackAlsaDriver::Open(jack_nframes_t nframes, capture_latency, playback_latency, midi); - if (fDriver) { - // ALSA driver may have changed the in/out values - fCaptureChannels = ((alsa_driver_t *)fDriver)->capture_nchannels; - fPlaybackChannels = ((alsa_driver_t *)fDriver)->playback_nchannels; - if (JackServerGlobals::on_device_reservation_loop != NULL) { - device_reservation_loop_running = true; - if (JackPosixThread::StartImp(&fReservationLoopThread, 0, 0, on_device_reservation_loop, NULL) != 0) { - device_reservation_loop_running = false; - } - } - return 0; - } else { + if (!fDriver) { Close(); return -1; } + + // ALSA driver may have changed the in/out values + fCaptureChannels = ((alsa_driver_t *)fDriver)->capture_nchannels; + fPlaybackChannels = ((alsa_driver_t *)fDriver)->playback_nchannels; + if (JackServerGlobals::on_device_reservation_loop != NULL) { + device_reservation_loop_running = true; + if (JackPosixThread::StartImp(&fReservationLoopThread, 0, 0, on_device_reservation_loop, NULL) != 0) { + device_reservation_loop_running = false; + } + } + + return 0; } int JackAlsaDriver::Close() From 023d0a579b9ae752e9e6bd6a9d5dc7c54419c7cc Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 28 Oct 2019 11:35:38 +0100 Subject: [PATCH 15/17] Adjust doxygen config (import patch from Fedora) --- doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doxyfile.in b/doxyfile.in index 2335adab7..f92e264ad 100644 --- a/doxyfile.in +++ b/doxyfile.in @@ -792,7 +792,7 @@ HTML_HEADER = # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = @SRCDIR@/no_date_footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to From eaf8b75301b59b859cb8231685b92b0d77d95b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Blizi=C5=84ski?= Date: Wed, 7 Oct 2020 18:55:31 +0100 Subject: [PATCH 16/17] Clarification about jack_port_get_latency_range(). jack_port_get_latency_range only returns meaningful values after ports get connected, and that is signalled via the latency callback. Saying that it's normally used in callbacks is too soft, the docs should make it clear that the function is not very useful outside of the callback, because you don't know whether the port is connected / whether the latency values changed. --- common/jack/jack.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/jack/jack.h b/common/jack/jack.h index e982b6dff..cd7e2e956 100644 --- a/common/jack/jack.h +++ b/common/jack/jack.h @@ -605,6 +605,10 @@ int jack_set_xrun_callback (jack_client_t *client, * Clients that do not meet any of those conditions SHOULD * register a latency callback. * + * Another case is when a client wants to use + * @ref jack_port_get_latency_range(), which only returns meaninful + * values when ports get connected and latency values change. + * * See the documentation for @ref jack_port_set_latency_range() * on how the callback should operate. Remember that the @a mode * argument given to the latency callback will need to be @@ -1119,8 +1123,11 @@ void jack_port_set_latency (jack_port_t *port, jack_nframes_t) JACK_OPTIONAL_WEA * * See @ref LatencyFunctions for the definition of each latency value. * - * This is normally used in the LatencyCallback. - * and therefor safe to execute from callbacks. + * This function is best used from callbacks, specifically the latency callback. + * Before a port is connected, this returns the default latency: zero. + * Therefore it only makes sense to call jack_port_get_latency_range() when + * the port is connected, and that gets signalled by the latency callback. + * See @ref jack_set_latency_callback() for details. */ void jack_port_get_latency_range (jack_port_t *port, jack_latency_callback_mode_t mode, jack_latency_range_t *range) JACK_WEAK_EXPORT; From c05afaa72d62b6874da6c77f097cfea8f2f35a6f Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Thu, 22 Aug 2019 17:55:04 -0400 Subject: [PATCH 17/17] README: Add repology repository badge This badge links to a chart that shows where jack2 is the package ecosystem. Apologies, I was unsuccessful formatting the .rst so the badges could be side-by-side. --- README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index cc401a6b6..1751b4cac 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,10 @@ ################################ .. image:: https://travis-ci.org/jackaudio/jack2.svg?branch=master - :target: https://travis-ci.org/jackaudio/jack2 - + :target: https://travis-ci.org/jackaudio/jack2 +.. image:: https://repology.org/badge/tiny-repos/jack-audio-connection-kit.svg + :target: https://repology.org/metapackage/jack-audio-connection-kit/versions + JACK2 aka jackdmp is a C++ version of the JACK low-latency audio server for multi-processor machines. It is a new implementation of the JACK server core features that aims at removing some limitations of the JACK1 design. The