Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Oct 11, 2020
2 parents 39605d5 + c05afaa commit ff8fe7b
Show file tree
Hide file tree
Showing 34 changed files with 200 additions and 138 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ man/*.1
.stamp_*
.DS_Store
__pycache__
*.dll
*.pyc
*.pkg
android/.server/
Expand All @@ -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
53 changes: 28 additions & 25 deletions common/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -145,17 +146,23 @@ 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.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.install_path = '${LIBDIR}'
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.includes = includes
clientlib.name = 'clientlib'
clientlib.target = 'jack'+libsuffix
clientlib.source = [] + common_libsources
clientlib.source += [
'JackLibClient.cpp',
Expand Down Expand Up @@ -202,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
Expand All @@ -223,6 +221,7 @@ 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'
Expand All @@ -231,7 +230,8 @@ def build(bld):
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',
Expand Down Expand Up @@ -325,17 +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'
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',
Expand Down
2 changes: 1 addition & 1 deletion doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
83 changes: 15 additions & 68 deletions example-clients/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,30 @@
# 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 = {
'inprocess' : 'inprocess.c',
}

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']
Expand Down Expand Up @@ -78,24 +60,13 @@ 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']

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']
Expand All @@ -109,32 +80,10 @@ 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'

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']:
Expand All @@ -144,9 +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}/'

if not bld.env['IS_WINDOWS']:
bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)
25 changes: 13 additions & 12 deletions linux/alsa/JackAlsaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions linux/alsa/alsa_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion linux/alsa/alsa_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit ff8fe7b

Please sign in to comment.