View on GitHub JACK Logo - Home

JACK2 v1.9.19 release

Posted on by falkTX

A new version of JACK2 has just been released.
You can grab the latest release source code at https://github.com/jackaudio/jack2/releases and macOS/Windows installers at https://github.com/jackaudio/jack2-releases/releases.

This release focuses on 2 main things: jack_position_t::tick_double addition and forced alignment of a few internal data structures. A few other fixes were made as contributed by developers.

This release adds tick_double to the jack_position_t struct and JackTickDouble as a validation flag for it. Since older versions of JACK do not expose this variable, the macro JACK_TICK_DOUBLE is provided, which can be used as build-time detection.

The alignment change is because the packed structure layouts as used in JACK2 need to be naturally aligned in order to be accessed atomically in some systems. A non-aligned read or write can result in a “Bus error”, which brings down jackd. This seems to only be relevant on certain ARM systems, as JACK2 was obviously working before this change for most people.
As a consequence of this change, the internal protocol version was bumped to 9, which requires the restart of the JACK server after the update.

The official changelog is:

  • Add jack_position_t::tick_double, and flags around it
  • Add zalsa “-w” argument to wait for soundcard to be available
  • Bump internal protocol version to 9 (due to struct alignment)
  • Fix alignment of fields for atomic accesses
  • Fix build for platforms needing __STDC_FORMAT_MACROS
  • Fix compilation of documentation

External changes, related to macOS/Windows installer:

  • Fix macOS microphone permissions on qjackctl macOS app bundle
  • Update qjackctl to 0.9.4

Now, for the rationale behind the transport tick_double API update:

When using JACK transport to sync between clients with precise timing requirements (such as MIDI sequencers) rounding errors would accumulate and eventually make the separate clients out of sync.
This was observed in Carla and mod-host, which use audio plugins as JACK clients. Some MIDI plugins could miss notes due to rounding errors. This change has been deployed in MOD Devices for a couple of releases already and it is known to work (that is, it corrects the situation).

There were discussions on IRC about this potentially be unnecessary, that clients can just use bar_start_tick to store the non-integer part of the tick.
While the idea could work in theory, supporting it turns out to be non-trivial and from all applications that I have tested none implemented this part correctly.
Some applications do not set bar_start_tick at all, even though they can be run as transport master.

So since the transport API has padding members available for use and it has been unchanged for several years (so there won’t be a need to add more fields in the short or middle term), well let’s just go for it.

Here is example code for transport-listening clients:

double tick;
#ifdef JACK_TICK_DOUBLE
if (pos.valid & JackTickDouble)
    tick = pos.tick_double;
else
#endif
    tick = pos.tick;