Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package jack for openSUSE:Factory checked in 
at 2021-10-20 20:23:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jack (Old)
 and      /work/SRC/openSUSE:Factory/.jack.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jack"

Wed Oct 20 20:23:39 2021 rev:70 rq:925806 version:1.9.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/jack/jack.changes        2021-04-22 
18:03:50.978495930 +0200
+++ /work/SRC/openSUSE:Factory/.jack.new.1890/jack.changes      2021-10-20 
20:24:26.333383801 +0200
@@ -1,0 +2,12 @@
+Sat Oct 16 17:45:53 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- drop 0001-Fix-compilation-of-documentation.patch (upstream).
+- update to 1.9.19:
+  * 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
+
+-------------------------------------------------------------------

Old:
----
  0001-Fix-compilation-of-documentation.patch
  jack-1.9.18.tar.gz

New:
----
  jack-1.9.19.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jack.spec ++++++
--- /var/tmp/diff_new_pack.UOdF2K/_old  2021-10-20 20:24:26.821384102 +0200
+++ /var/tmp/diff_new_pack.UOdF2K/_new  2021-10-20 20:24:26.821384102 +0200
@@ -22,7 +22,7 @@
 %define wdbus 1
 %define sonum 0
 Name:           jack
-Version:        1.9.18
+Version:        1.9.19
 Release:        0
 #to_be_filled_by_service
 Summary:        Jack-Audio Connection Kit
@@ -31,8 +31,6 @@
 URL:            https://jackaudio.org/
 Source0:        
https://github.com/jackaudio/jack2/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        baselibs.conf
-# PATCH-FIX-UPSTREAM -- 
https://github.com/jackaudio/jack2/commit/af6c00ab09428e79.patch
-Patch0:         0001-Fix-compilation-of-documentation.patch
 BuildRequires:  doxygen
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++

++++++ jack-1.9.18.tar.gz -> jack-1.9.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/ChangeLog.rst 
new/jack2-1.9.19/ChangeLog.rst
--- old/jack2-1.9.18/ChangeLog.rst      2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/ChangeLog.rst      2021-07-15 08:18:26.000000000 +0200
@@ -1,6 +1,15 @@
 ChangeLog
 #########
 
+* 1.9.19 (2021-07-15)
+
+  * 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
+
 * 1.9.18 (2021-04-15)
 
   * Add zalsa_in/out as internal client (based on zita-a2j/j2a and jack1 code)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/android/JackSapaProxy.cpp 
new/jack2-1.9.19/android/JackSapaProxy.cpp
--- old/jack2-1.9.18/android/JackSapaProxy.cpp  2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/android/JackSapaProxy.cpp  2021-07-15 08:18:26.000000000 
+0200
@@ -113,7 +113,7 @@
         jack_set_process_callback(client, Process, this);
         jack_activate(client);
 
-        //conenct between sapaproxy and system ports
+        //connect between sapaproxy and system ports
         for (unsigned int i = 0; i < ports_system_capture_cnt; i++) {
             sprintf(port_name, "system:capture_%d", i + 1);
             jack_connect(client, port_name, jack_port_name(fInputPorts[i]));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackAPI.cpp 
new/jack2-1.9.19/common/JackAPI.cpp
--- old/jack2-1.9.18/common/JackAPI.cpp 2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackAPI.cpp 2021-07-15 08:18:26.000000000 +0200
@@ -18,6 +18,8 @@
 
 */
 
+#define __STDC_FORMAT_MACROS 1
+#include <inttypes.h>
 #include "JackClient.h"
 #include "JackError.h"
 #include "JackGraphManager.h"
@@ -27,8 +29,6 @@
 #include "JackTime.h"
 #include "JackPortType.h"
 #include <math.h>
-#define __STDC_FORMAT_MACROS 1
-#include <inttypes.h>
 
 using namespace Jack;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackActivationCount.h 
new/jack2-1.9.19/common/JackActivationCount.h
--- old/jack2-1.9.18/common/JackActivationCount.h       2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackActivationCount.h       2021-07-15 
08:18:26.000000000 +0200
@@ -39,13 +39,16 @@
 
     private:
 
-        SInt32 fValue;
+        alignas(SInt32) SInt32 fValue;
         SInt32 fCount;
 
     public:
 
         JackActivationCount(): fValue(0), fCount(0)
-        {}
+        {
+            static_assert(offsetof(JackActivationCount, fValue) % 
sizeof(fValue) == 0,
+                          "fValue must be aligned within JackActivationCount");
+        }
 
         bool Signal(JackSynchro* synchro, JackClientControl* control);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackAtomicArrayState.h 
new/jack2-1.9.19/common/JackAtomicArrayState.h
--- old/jack2-1.9.18/common/JackAtomicArrayState.h      2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackAtomicArrayState.h      2021-07-15 
08:18:26.000000000 +0200
@@ -23,6 +23,7 @@
 #include "JackAtomic.h"
 #include "JackCompilerDeps.h"
 #include <string.h> // for memcpy
+#include <cstddef>
 
 namespace Jack
 {
@@ -121,7 +122,7 @@
         // fState[2] ==> request
 
         T fState[3];
-        volatile AtomicArrayCounter fCounter;
+        alignas(UInt32) volatile AtomicArrayCounter fCounter;
 
         UInt32 WriteNextStateStartAux(int state, bool* result)
         {
@@ -159,6 +160,8 @@
 
         JackAtomicArrayState()
         {
+            static_assert(offsetof(JackAtomicArrayState, fCounter) % 
sizeof(fCounter) == 0,
+                          "fCounter must be aligned within 
JackAtomicArrayState");
             Counter1(fCounter) = 0;
         }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackAtomicState.h 
new/jack2-1.9.19/common/JackAtomicState.h
--- old/jack2-1.9.18/common/JackAtomicState.h   2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/common/JackAtomicState.h   2021-07-15 08:18:26.000000000 
+0200
@@ -23,6 +23,7 @@
 #include "JackAtomic.h"
 #include "JackCompilerDeps.h"
 #include <string.h> // for memcpy
+#include <cstddef>
 
 namespace Jack
 {
@@ -93,7 +94,7 @@
     protected:
 
         T fState[2];
-        volatile AtomicCounter fCounter;
+        alignas(UInt32) volatile AtomicCounter fCounter;
         SInt32 fCallWriteCounter;
 
         UInt32 WriteNextStateStartAux()
@@ -131,6 +132,8 @@
 
         JackAtomicState()
         {
+            static_assert(offsetof(JackAtomicState, fCounter) % 
sizeof(fCounter) == 0,
+                          "fCounter must be aligned within JackAtomicState");
             Counter(fCounter) = 0;
             fCallWriteCounter = 0;
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackConnectionManager.cpp 
new/jack2-1.9.19/common/JackConnectionManager.cpp
--- old/jack2-1.9.18/common/JackConnectionManager.cpp   2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackConnectionManager.cpp   2021-07-15 
08:18:26.000000000 +0200
@@ -32,6 +32,9 @@
 JackConnectionManager::JackConnectionManager()
 {
     int i;
+    static_assert(offsetof(JackConnectionManager, fInputCounter) % 
sizeof(UInt32) == 0,
+                  "fInputCounter must be aligned within 
JackConnectionManager");
+
     jack_log("JackConnectionManager::InitConnections size = %ld ", 
sizeof(JackConnectionManager));
 
     for (i = 0; i < PORT_NUM_MAX; i++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackConnectionManager.h 
new/jack2-1.9.19/common/JackConnectionManager.h
--- old/jack2-1.9.18/common/JackConnectionManager.h     2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackConnectionManager.h     2021-07-15 
08:18:26.000000000 +0200
@@ -417,7 +417,7 @@
         JackFixedArray1<PORT_NUM_FOR_CLIENT> fInputPort[CLIENT_NUM];   /*! 
Table of input port per refnum : to find a refnum for a given port */
         JackFixedArray<PORT_NUM_FOR_CLIENT> fOutputPort[CLIENT_NUM];   /*! 
Table of output port per refnum : to find a refnum for a given port */
         JackFixedMatrix<CLIENT_NUM> fConnectionRef;                            
                /*! Table of port connections by (refnum , refnum) */
-        JackActivationCount fInputCounter[CLIENT_NUM];                         
        /*! Activation counter per refnum */
+        alignas(UInt32) JackActivationCount fInputCounter[CLIENT_NUM]; /*! 
Activation counter per refnum */
         JackLoopFeedback<CONNECTION_NUM_FOR_PORT> fLoopFeedback;               
/*! Loop feedback connections */
 
         bool IsLoopPathAux(int ref1, int ref2) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackConstants.h 
new/jack2-1.9.19/common/JackConstants.h
--- old/jack2-1.9.18/common/JackConstants.h     2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/common/JackConstants.h     2021-07-15 08:18:26.000000000 
+0200
@@ -24,7 +24,7 @@
 #include "config.h"
 #endif
 
-#define VERSION "1.9.18"
+#define VERSION "1.9.19"
 
 #define BUFFER_SIZE_MAX 8192
 
@@ -72,7 +72,7 @@
 
 #define ALL_CLIENTS -1 // for notification
 
-#define JACK_PROTOCOL_VERSION 8
+#define JACK_PROTOCOL_VERSION 9
 
 #define SOCKET_TIME_OUT 2               // in sec
 #define DRIVER_OPEN_TIMEOUT 5           // in sec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackEngineControl.h 
new/jack2-1.9.19/common/JackEngineControl.h
--- old/jack2-1.9.18/common/JackEngineControl.h 2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/common/JackEngineControl.h 2021-07-15 08:18:26.000000000 
+0200
@@ -64,7 +64,7 @@
     int fClientPriority;
     int fMaxClientPriority;
     char fServerName[JACK_SERVER_NAME_SIZE+1];
-    JackTransportEngine fTransport;
+    alignas(UInt32) JackTransportEngine fTransport;
     jack_timer_type_t fClockSource;
     int fDriverNum;
     bool fVerbose;
@@ -86,14 +86,18 @@
     UInt64 fConstraint;
 
     // Timer
-    JackFrameTimer fFrameTimer;
+    alignas(UInt32) JackFrameTimer fFrameTimer;
 
 #ifdef JACK_MONITOR
     JackEngineProfiling fProfiler;
 #endif
 
     JackEngineControl(bool sync, bool temporary, long timeout, bool rt, long 
priority, bool verbose, jack_timer_type_t clock, const char* server_name)
-    {
+      {
+        static_assert(offsetof(JackEngineControl, fTransport) % sizeof(UInt32) 
== 0,
+                      "fTransport must be aligned within JackEngineControl");
+        static_assert(offsetof(JackEngineControl, fFrameTimer) % 
sizeof(UInt32) == 0,
+                      "fFrameTimer must be aligned within JackEngineControl");
         fBufferSize = 512;
         fSampleRate = 48000;
         fPeriodUsecs = jack_time_t(1000000.f / fSampleRate * fBufferSize);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackMessageBuffer.cpp 
new/jack2-1.9.19/common/JackMessageBuffer.cpp
--- old/jack2-1.9.18/common/JackMessageBuffer.cpp       2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackMessageBuffer.cpp       2021-07-15 
08:18:26.000000000 +0200
@@ -38,7 +38,10 @@
     fOutBuffer(0),
     fOverruns(0),
     fRunning(false)
-{}
+{
+    static_assert(offsetof(JackMessageBuffer, fOverruns) % sizeof(fOverruns) 
== 0,
+                  "fOverruns must be aligned within JackMessageBuffer");
+}
 
 JackMessageBuffer::~JackMessageBuffer()
 {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackMessageBuffer.h 
new/jack2-1.9.19/common/JackMessageBuffer.h
--- old/jack2-1.9.18/common/JackMessageBuffer.h 2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/common/JackMessageBuffer.h 2021-07-15 08:18:26.000000000 
+0200
@@ -64,7 +64,7 @@
         JackProcessSync fGuard;
         volatile unsigned int fInBuffer;
         volatile unsigned int fOutBuffer;
-        SInt32 fOverruns;
+        alignas(SInt32) SInt32 fOverruns;
         bool fRunning;
 
         void Flush();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackTransportEngine.cpp 
new/jack2-1.9.19/common/JackTransportEngine.cpp
--- old/jack2-1.9.18/common/JackTransportEngine.cpp     2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackTransportEngine.cpp     2021-07-15 
08:18:26.000000000 +0200
@@ -36,6 +36,8 @@
 
 JackTransportEngine::JackTransportEngine(): 
JackAtomicArrayState<jack_position_t>()
 {
+    static_assert(offsetof(JackTransportEngine, fWriteCounter) % 
sizeof(fWriteCounter) == 0,
+                  "fWriteCounter must be first member of JackTransportEngine 
to ensure its alignment");
     fTransportState = JackTransportStopped;
     fTransportCmd = fPreviousCmd = TransportCommandStop;
     fSyncTimeout = 10000000;   /* 10 seconds default...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/JackTransportEngine.h 
new/jack2-1.9.19/common/JackTransportEngine.h
--- old/jack2-1.9.18/common/JackTransportEngine.h       2021-04-14 
20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/JackTransportEngine.h       2021-07-15 
08:18:26.000000000 +0200
@@ -104,7 +104,7 @@
         bool fPendingPos;
         bool fNetworkSync;
         bool fConditionnal;
-        SInt32 fWriteCounter;
+        alignas(SInt32) SInt32 fWriteCounter;
 
         bool CheckAllRolling(JackClientInterface** table);
         void MakeAllStartingLocating(JackClientInterface** table);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/jack/jack.h 
new/jack2-1.9.19/common/jack/jack.h
--- old/jack2-1.9.18/common/jack/jack.h 2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/common/jack/jack.h 2021-07-15 08:18:26.000000000 +0200
@@ -606,10 +606,10 @@
  * register a latency callback.
  *
  * Another case is when a client wants to use
- * @ref jack_port_get_latency_range(), which only returns meaninful
+ * @ref jack_port_get_latency_range(), which only returns meaningful
  * values when ports get connected and latency values change.
  *
- * See the documentation for  @ref jack_port_set_latency_range()
+ * 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
  * passed into @ref jack_port_set_latency_range()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/common/jack/types.h 
new/jack2-1.9.19/common/jack/types.h
--- old/jack2-1.9.18/common/jack/types.h        2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/common/jack/types.h        2021-07-15 08:18:26.000000000 
+0200
@@ -538,11 +538,12 @@
  */
 typedef enum {
 
-    JackPositionBBT = 0x10,     /**< Bar, Beat, Tick */
-    JackPositionTimecode = 0x20,        /**< External timecode */
-    JackBBTFrameOffset =      0x40,     /**< Frame offset of BBT information */
-    JackAudioVideoRatio =     0x80, /**< audio frames per video frame */
-    JackVideoFrameOffset =   0x100  /**< frame offset of first video frame */
+    JackPositionBBT      = 0x10,  /**< Bar, Beat, Tick */
+    JackPositionTimecode = 0x20,  /**< External timecode */
+    JackBBTFrameOffset   = 0x40,  /**< Frame offset of BBT information */
+    JackAudioVideoRatio  = 0x80,  /**< audio frames per video frame */
+    JackVideoFrameOffset = 0x100, /**< frame offset of first video frame */
+    JackTickDouble       = 0x200, /**< double-resolution tick */
 
 } jack_position_bits_t;
 
@@ -550,6 +551,9 @@
 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
 #define EXTENDED_TIME_INFO
 
+/** transport tick_double member is available for use */
+#define JACK_TICK_DOUBLE
+
 PRE_PACKED_STRUCTURE
 struct _jack_position {
 
@@ -609,10 +613,18 @@
                          set, but the value is zero, there is
                          no video frame within this cycle. */
 
+    /* JACK extra transport fields */
+
+    double              tick_double; /**< current tick-within-beat in double 
resolution.
+                         Should be assumed zero if JackTickDouble is not set.
+                         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. */
+
     /* For binary compatibility, new fields should be allocated from
      * this padding area with new valid bits controlling access, so
      * the existing structure size and offsets are preserved. */
-    int32_t             padding[7];
+    int32_t             padding[5];
 
     /* When (unique_1 == unique_2) the contents are consistent. */
     jack_unique_t       unique_2;       /**< unique ID */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/doxyfile.in new/jack2-1.9.19/doxyfile.in
--- old/jack2-1.9.18/doxyfile.in        2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/doxyfile.in        2021-07-15 08:18:26.000000000 +0200
@@ -792,7 +792,7 @@
 # each generated HTML page. If it is left blank doxygen will generate a
 # standard footer.
 
-HTML_FOOTER            = @SRCDIR@/no_date_footer.html
+HTML_FOOTER            =
 
 # 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/macosx/JackAtomic_os.h 
new/jack2-1.9.19/macosx/JackAtomic_os.h
--- old/jack2-1.9.18/macosx/JackAtomic_os.h     2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/macosx/JackAtomic_os.h     2021-07-15 08:18:26.000000000 
+0200
@@ -21,6 +21,7 @@
 #define __JackAtomic_APPLE__
 
 #include "JackTypes.h"
+#include <cassert>
 
 #if defined(__ppc__) || defined(__ppc64__)
 
@@ -67,8 +68,11 @@
 
 #else
 
+#include <stdio.h>
 static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* 
addr)
 {
+    // Assert pointer is 32-bit aligned
+    assert(((long)addr & (sizeof(int)-1)) == 0);
     return __sync_bool_compare_and_swap ((UInt32*)addr, value, newvalue);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tests/test.cpp 
new/jack2-1.9.19/tests/test.cpp
--- old/jack2-1.9.18/tests/test.cpp     2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/tests/test.cpp     2021-07-15 08:18:26.000000000 +0200
@@ -53,7 +53,7 @@
 typedef struct
 {
     jack_nframes_t ft;         // running counter frame time
-    jack_nframes_t fcs;                // from sycle start...
+    jack_nframes_t fcs;                // from cycle start...
     jack_nframes_t lft;                // last frame time...
 }
 FrameTimeCollector;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/alsathread.cc 
new/jack2-1.9.19/tools/zalsa/alsathread.cc
--- old/jack2-1.9.18/tools/zalsa/alsathread.cc  2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/alsathread.cc  2021-07-15 08:18:26.000000000 
+0200
@@ -45,7 +45,15 @@
 
 Alsathread::~Alsathread (void)
 {
-    _alsadev->pcm_stop ();
+    if (_state != INIT)
+    {
+        _state = TERM;
+        thr_wait ();
+    }
+    else
+    {
+        _alsadev->pcm_stop ();
+    }
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/jackclient.cc 
new/jack2-1.9.19/tools/zalsa/jackclient.cc
--- old/jack2-1.9.18/tools/zalsa/jackclient.cc  2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/jackclient.cc  2021-07-15 08:18:26.000000000 
+0200
@@ -193,7 +193,7 @@
        _resamp->out_count = 99999;
        _resamp->process ();
     }
-    // Initiliase state variables.
+    // Initialise state variables.
     _t_a0 = _t_a1 = 0;
     _k_a0 = _k_a1 = 0;
     // Initialise loop filter state.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/pxthread.cc 
new/jack2-1.9.19/tools/zalsa/pxthread.cc
--- old/jack2-1.9.18/tools/zalsa/pxthread.cc    2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/pxthread.cc    2021-07-15 08:18:26.000000000 
+0200
@@ -76,3 +76,12 @@
 {
 }
 
+
+void Pxthread::thr_wait (void)
+{
+    if (_thrid == 0)
+        return;
+    pthread_join (_thrid, NULL);
+    _thrid = 0;
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/pxthread.h 
new/jack2-1.9.19/tools/zalsa/pxthread.h
--- old/jack2-1.9.18/tools/zalsa/pxthread.h     2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/pxthread.h     2021-07-15 08:18:26.000000000 
+0200
@@ -42,6 +42,7 @@
 
     virtual void thr_main (void) = 0;
     virtual int  thr_start (int policy, int priority, size_t stacksize = 0);
+    virtual void thr_wait (void);
 
 private:
   
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/zita-a2j.cc 
new/jack2-1.9.19/tools/zalsa/zita-a2j.cc
--- old/jack2-1.9.18/tools/zalsa/zita-a2j.cc    2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/zita-a2j.cc    2021-07-15 08:18:26.000000000 
+0200
@@ -28,7 +28,7 @@
 #include "lfqueue.h"
 #include "jack/control.h"
 
-static const char *clopt = "hvLSj:d:r:p:n:c:Q:I:";
+static const char *clopt = "hvLSwj:d:r:p:n:c:Q:I:";
 
 static void help (void)
 {
@@ -47,6 +47,7 @@
     jack_info ("  -Q <quality>       Resampling quality, 16..96 [auto]");
     jack_info ("  -I <samples>       Latency adjustment [0]");
     jack_info ("  -L                 Force 16-bit and 2 channels [off]");
+    jack_info ("  -w                 Wait until soundcard is available [off]");
     jack_info ("  -v                 Print tracing information [off]");
 }
 
@@ -60,6 +61,7 @@
        bool v_opt;
        bool L_opt;
        bool S_opt;
+       bool w_opt;
        char *jname;
        char *device;
        int fsamp;
@@ -81,6 +83,7 @@
         v_opt = false;
         L_opt = false;
         S_opt = false;
+        w_opt = false;
         jname = strdup(APPNAME);
         device = 0;
         fsamp = 48000;
@@ -92,6 +95,7 @@
         A = 0;
         C = 0;
         J = 0;
+        t = 0;
     }
 
 private:
@@ -116,6 +120,7 @@
             case 'v' : v_opt = true; break;
             case 'L' : L_opt = true; break;
             case 'S' : S_opt = true; break;
+            case 'w' : w_opt = true; break;
             case 'j' : jname = optarg; break;
             case 'd' : device = optarg; break;
             case 'r' : fsamp = atoi (optarg); break;    
@@ -227,15 +232,48 @@
     Alsathread     *C;
     Jackclient     *J;
 
+    pthread_t t;
+    int       topts;
+
+    static void* _retry_alsa_pcmi (void *arg)
+    {
+        ((zita_a2j*)arg)->retry_alsa_pcmi ();
+        return NULL;
+    }
+
+    void retry_alsa_pcmi ()
+    {
+        Alsa_pcmi *a;
+
+        while (! stop)
+        {
+            sleep(1);
+
+            a = new Alsa_pcmi (0, device, 0, fsamp, bsize, nfrag, topts);
+            if (a->state ())
+            {
+                delete a;
+                continue;
+            }
+
+            A = a;
+            if (v_opt) A->printinfo ();
+            C = new Alsathread (A, Alsathread::CAPT);
+            usleep (100*1000);
+            jack_initialize_part2 ();
+            jack_info (APPNAME ": Device is now available and has been 
activated");
+            break;
+        }
+
+        t = 0;
+    }
+
 public:
 
     int
     jack_initialize (jack_client_t* client, const char* load_init)
     {
-        int            k, k_del, opts;
-        double         t_jack;
-        double         t_alsa;
-        double         t_del;
+        int opts;
 
         if (parse_options (load_init)) {
             jack_error (APPNAME ": parse options failed");
@@ -261,22 +299,56 @@
         opts = 0;
         if (v_opt) opts |= Alsa_pcmi::DEBUG_ALL;
         if (L_opt) opts |= Alsa_pcmi::FORCE_16B | Alsa_pcmi::FORCE_2CH;
-        A = new Alsa_pcmi (0, device, 0, fsamp, bsize, nfrag, opts);
-        if (A->state ())
+        if (w_opt)
         {
-            jack_error (APPNAME ": Can't open ALSA capture device '%s'.", 
device);
-            delete this;
-            return 1;
+            J = new Jackclient (client, 0, Jackclient::CAPT, nchan, S_opt, 
this);
+            A = new Alsa_pcmi (0, device, 0, fsamp, bsize, nfrag, opts);
+
+            // if device is not available, spawn thread to keep trying
+            if (A->state ())
+            {
+                delete A;
+                A = NULL;
+                topts = opts;
+                pthread_create (&t, NULL, _retry_alsa_pcmi, this);
+                jack_info (APPNAME ": Could not open device, will keep trying 
in new thread...");
+                return 0;
+            }
+
+            // otherwise continue as normal
+            if (v_opt) A->printinfo ();
+            C = new Alsathread (A, Alsathread::CAPT);
         }
-        if (v_opt) A->printinfo ();
-        if (nchan > A->ncapt ())
+        else
         {
-            nchan = A->ncapt ();
-            jack_error (APPNAME ": Warning: only %d channels are available.", 
nchan);
+            A = new Alsa_pcmi (0, device, 0, fsamp, bsize, nfrag, opts);
+            if (A->state ())
+            {
+                jack_error (APPNAME ": Can't open ALSA capture device '%s'.", 
device);
+                delete this;
+                return 1;
+            }
+            if (v_opt) A->printinfo ();
+            if (nchan > A->ncapt ())
+            {
+                nchan = A->ncapt ();
+                jack_error (APPNAME ": Warning: only %d channels are 
available.", nchan);
+            }
+            C = new Alsathread (A, Alsathread::CAPT);
+            J = new Jackclient (client, 0, Jackclient::CAPT, nchan, S_opt, 
this);
         }
-        C = new Alsathread (A, Alsathread::CAPT);
-        J = new Jackclient (client, 0, Jackclient::CAPT, nchan, S_opt, this);
-        usleep (100000);
+
+        usleep (100*1000);
+        jack_initialize_part2 ();
+        return 0;
+    }
+
+    void jack_initialize_part2 ()
+    {
+        int            k, k_del;
+        double         t_alsa;
+        double         t_jack;
+        double         t_del;
 
         t_alsa = (double) bsize / fsamp;
         if (t_alsa < 1e-3) t_alsa = 1e-3;
@@ -297,12 +369,16 @@
 
         C->start (audioq, commq, alsaq, J->rprio () + 10);
         J->start (audioq, commq, alsaq, infoq, J->fsamp () / (double) fsamp, 
k_del, ltcor, rqual);
-
-        return 0;
     }
 
     void jack_finish (void* arg)
     {
+        if (t != 0)
+        {
+            stop = true;
+            pthread_join(t, NULL);
+        }
+
         commq->wr_int32 (Alsathread::TERM);
         usleep (100000);
         delete C;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/tools/zalsa/zita-j2a.cc 
new/jack2-1.9.19/tools/zalsa/zita-j2a.cc
--- old/jack2-1.9.18/tools/zalsa/zita-j2a.cc    2021-04-14 20:35:02.000000000 
+0200
+++ new/jack2-1.9.19/tools/zalsa/zita-j2a.cc    2021-07-15 08:18:26.000000000 
+0200
@@ -28,7 +28,7 @@
 #include "lfqueue.h"
 #include "jack/control.h"
 
-static const char *clopt = "hvLSj:d:r:p:n:c:Q:O:";
+static const char *clopt = "hvLSwj:d:r:p:n:c:Q:O:";
 
 static void help (void)
 {
@@ -47,6 +47,7 @@
     jack_info ("  -Q <quality>       Resampling quality, 16..96 [auto]");
     jack_info ("  -O <samples>       Latency adjustment [0]");
     jack_info ("  -L                 Force 16-bit and 2 channels [off]");
+    jack_info ("  -w                 Wait until soundcard is available [off]");
     jack_info ("  -v                 Print tracing information [off]");
 }
 
@@ -60,6 +61,7 @@
        bool v_opt;
        bool L_opt;
        bool S_opt;
+       bool w_opt;
        char *jname;
        char *device;
        int fsamp;
@@ -81,6 +83,7 @@
         v_opt = false;
         L_opt = false;
         S_opt = false;
+        w_opt = false;
         jname = strdup(APPNAME);
         device = 0;
         fsamp = 48000;
@@ -92,6 +95,7 @@
         A = 0;
         P = 0;
         J = 0;
+        t = 0;
     }
 
 private:
@@ -116,6 +120,7 @@
             case 'v' : v_opt = true; break;
             case 'L' : L_opt = true; break;
             case 'S' : S_opt = true; break;
+            case 'w' : w_opt = true; break;
             case 'j' : jname = optarg; break;
             case 'd' : device = optarg; break;
             case 'r' : fsamp = atoi (optarg); break;    
@@ -226,15 +231,48 @@
     Alsa_pcmi      *A;
     Alsathread     *P;
     Jackclient     *J;
-    
+
+    pthread_t t;
+    int       topts;
+
+    static void* _retry_alsa_pcmi (void *arg)
+    {
+        ((zita_j2a*)arg)->retry_alsa_pcmi ();
+        return NULL;
+    }
+
+    void retry_alsa_pcmi ()
+    {
+        Alsa_pcmi *a;
+
+        while (! stop)
+        {
+            sleep(1);
+
+            a = new Alsa_pcmi (device, 0, 0, fsamp, bsize, nfrag, topts);
+            if (a->state ())
+            {
+                delete a;
+                continue;
+            }
+
+            A = a;
+            if (v_opt) A->printinfo ();
+            P = new Alsathread (A, Alsathread::PLAY);
+            usleep (100*1000);
+            jack_initialize_part2 ();
+            jack_info (APPNAME ": Device is now available and has been 
activated");
+            break;
+        }
+
+        t = 0;
+    }
+
 public:
 
     int jack_initialize (jack_client_t* client, const char* load_init)
     {
-        int            k, k_del, opts;
-        double         t_jack;
-        double         t_alsa;
-        double         t_del;
+        int opts;
 
         if (parse_options (load_init)) {
             delete this;
@@ -259,22 +297,56 @@
         opts = 0;
         if (v_opt) opts |= Alsa_pcmi::DEBUG_ALL;
         if (L_opt) opts |= Alsa_pcmi::FORCE_16B | Alsa_pcmi::FORCE_2CH;
-        A = new Alsa_pcmi (device, 0, 0, fsamp, bsize, nfrag, opts);
-        if (A->state ())
+        if (w_opt)
         {
-            jack_error (APPNAME ": Can't open ALSA playback device '%s'.", 
device);
-            delete this;
-            return 1;
+            J = new Jackclient (client, 0, Jackclient::PLAY, nchan, S_opt, 
this);
+
+            // if device is not available, spawn thread to keep trying
+            A = new Alsa_pcmi (device, 0, 0, fsamp, bsize, nfrag, opts);
+            if (A->state ())
+            {
+                delete A;
+                A = NULL;
+                topts = opts;
+                pthread_create (&t, NULL, _retry_alsa_pcmi, this);
+                jack_info (APPNAME ": Could not open device, will keep trying 
in new thread...");
+                return 0;
+            }
+
+            // otherwise continue as normal
+            if (v_opt) A->printinfo ();
+            P = new Alsathread (A, Alsathread::PLAY);
         }
-        if (v_opt) A->printinfo ();
-        if (nchan > A->nplay ())
+        else
         {
-            nchan = A->nplay ();
-            jack_error (APPNAME ": Warning: only %d channels are available.", 
nchan);
+            A = new Alsa_pcmi (device, 0, 0, fsamp, bsize, nfrag, opts);
+            if (A->state ())
+            {
+                jack_error (APPNAME ": Can't open ALSA playback device '%s'.", 
device);
+                delete this;
+                return 1;
+            }
+            if (v_opt) A->printinfo ();
+            if (nchan > A->nplay ())
+            {
+                nchan = A->nplay ();
+                jack_error (APPNAME ": Warning: only %d channels are 
available.", nchan);
+            }
+            P = new Alsathread (A, Alsathread::PLAY);
+            J = new Jackclient (client, 0, Jackclient::PLAY, nchan, S_opt, 
this);
         }
-        P = new Alsathread (A, Alsathread::PLAY);
-        J = new Jackclient (client, 0, Jackclient::PLAY, nchan, S_opt, this);
-        usleep (100000);
+
+        usleep (100*1000);
+        jack_initialize_part2 ();
+        return 0;
+    }
+
+    void jack_initialize_part2 ()
+    {
+        int            k, k_del;
+        double         t_jack;
+        double         t_alsa;
+        double         t_del;
 
         t_alsa = (double) bsize / fsamp;
         if (t_alsa < 1e-3) t_alsa = 1e-3;
@@ -295,14 +367,19 @@
 
         P->start (audioq, commq, alsaq, J->rprio () + 10);
         J->start (audioq, commq, alsaq, infoq, (double) fsamp / J->fsamp (), 
k_del, ltcor, rqual);
-
-        return 0;
     }
 
     void jack_finish (void* arg)
     {
+        if (t != 0)
+        {
+            stop = true;
+            pthread_join(t, NULL);
+            t = 0;
+        }
+
         commq->wr_int32 (Alsathread::TERM);
-        usleep (100000);
+        usleep (100*1000);
         delete P;
         delete A;
         delete J;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/waflib/Context.py 
new/jack2-1.9.19/waflib/Context.py
--- old/jack2-1.9.18/waflib/Context.py  2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/waflib/Context.py  2021-07-15 08:18:26.000000000 +0200
@@ -520,7 +520,7 @@
                """
                Prints a configuration message of the form ``msg: result``.
                The second part of the message will be in colors. The output
-               can be disabled easly by setting ``in_msg`` to a positive 
value::
+               can be disabled easily by setting ``in_msg`` to a positive 
value::
 
                        def configure(conf):
                                self.in_msg = 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jack2-1.9.18/wscript new/jack2-1.9.19/wscript
--- old/jack2-1.9.18/wscript    2021-04-14 20:35:02.000000000 +0200
+++ new/jack2-1.9.19/wscript    2021-07-15 08:18:26.000000000 +0200
@@ -11,7 +11,7 @@
 from waflib import Logs, Options, Task, Utils
 from waflib.Build import BuildContext, CleanContext, InstallContext, 
UninstallContext
 
-VERSION='1.9.18'
+VERSION='1.9.19'
 APPNAME='jack'
 JACK_API_VERSION = '0.1.0'
 
@@ -228,7 +228,7 @@
                 mandatory=False)
 
     conf.env.append_unique('CFLAGS', '-Wall')
-    conf.env.append_unique('CXXFLAGS', '-Wall')
+    conf.env.append_unique('CXXFLAGS', ['-Wall', '-Wno-invalid-offsetof'])
     conf.env.append_unique('CXXFLAGS', '-std=gnu++11')
 
     if not conf.env['IS_MACOSX']:

Reply via email to