Am Mon, 2 Mar 2009 03:34:08 +0000
schrieb [email protected]:

> 
> 
> Revert rev 851 (double-hit when JACK Transport Master)
> 
> Rev 851 introduced a bug that caused the transport act erratically
> after several tempo changes when master.  The transport would randomly
> jump around to different parts of the song and never reset.  To make
> this bug happen, the typical steps are:
> 
>   1. Set Hydrogen in song mode, and as JACK Transport
>      slave.
> 
>   2. Start playing.  Make several tempo changes using
>      the + and - keyboard buttons.  Also stop, restart,
>      and even re-zero (start from the beginning).
> 
>   3. Stop the song.  Set Hydrogen as JACK Transport
>      master.
> 
>   4. Start the song back up.  Make several tempo changes.
>      Eventually, you should see skips in the transport.
>      I usually got the "best" results by holding down
>      the - key and taking the tempo down into the 80's.
> Commit from user: Gabriel Beddingfield
> 

hi gabriel,

you revert this, but imo your are right with this, that the master have not to 
relocate because he is the master.
the only thing was the jumping and the segfaults. you revert this so fast, and 
in our
discussion this problem will fade into the background. 

the only problem is after tempo change. that we need a relocate here because 
the ticksize changed. than we need a relocate for the h2 internal position.
so i add this to your imo 'RIGHT' changeset.

your old:
else if ( Preferences::getInstance()->m_bJackMasterMode == 
Preferences::USE_JACK_TIME_MASTER )
        return;

the new:
else if ( Preferences::getInstance()->m_bJackMasterMode ==
Preferences::USE_JACK_TIME_MASTER && 
(!Hydrogen::get_instance()->m_bBpmIsChanged)) {
        return;

so we only run into the function if a tempo change actually happens. in 
hydrogen.cpp exits a function which check if bpm will changed.
inline void audioEngine_process_checkBPMChanged()
in this inline function now, the bool m_bBpmIsChanged will set true every time 
we get a tempochange.
after relocate the bool m_bBpmIsChanged will set to false.

now we get no segfaults anymore. and also time master function don't relocate 
if it's not needed.

what do yo think?
 
the patch against rev 863:

Index: libs/hydrogen/include/hydrogen/hydrogen.h
===================================================================
--- libs/hydrogen/include/hydrogen/hydrogen.h   (Revision 864)
+++ libs/hydrogen/include/hydrogen/hydrogen.h   (Arbeitskopie)
@@ -201,6 +201,8 @@
        void ComputeHumantimeFrames(uint32_t nFrames);

        void __panic();
+
+       bool m_bBpmIsChanged;


 private:
Index: libs/hydrogen/src/hydrogen.cpp
===================================================================
--- libs/hydrogen/src/hydrogen.cpp      (Revision 864)
+++ libs/hydrogen/src/hydrogen.cpp      (Arbeitskopie)
@@ -467,6 +467,7 @@
                             && m_audioEngineState == STATE_PLAYING ) {
                                static_cast< JackOutput* >( m_pAudioDriver )
                                        ->calculateFrameOffset();
+                               Hydrogen::get_instance()->m_bBpmIsChanged = 
true;
                        }
 #endif
                }
@@ -1704,7 +1705,6 @@



-
 Hydrogen::Hydrogen()
                : Object( "Hydrogen" )
 {
Index: libs/hydrogen/src/IO/jack_output.cpp
===================================================================
--- libs/hydrogen/src/IO/jack_output.cpp        (Revision 864)
+++ libs/hydrogen/src/IO/jack_output.cpp        (Arbeitskopie)
@@ -242,6 +242,8 @@
                WARNINGLOG( "Relocate: Call it off" );
                calculateFrameOffset();
                return;
+       } else if ( Preferences::getInstance()->m_bJackMasterMode == 
Preferences::USE_JACK_TIME_MASTER && 
(!Hydrogen::get_instance()->m_bBpmIsChanged)) {
+               return;
        } else {
                if ( m_transport.m_status != TransportInfo::ROLLING || !( 
m_JackTransportPos.valid & JackPositionBBT ) /**the last check is *probably* 
redundant*/ ){
                        calculateFrameOffset();
@@ -249,10 +251,10 @@
                }

                INFOLOG( "..." );
-
                Hydrogen * H = Hydrogen::get_instance();
                Song * S = H->getSong();
-
+
+               H->m_bBpmIsChanged = false;
                float hydrogen_TPB = ( float )( S->__resolution / 
m_JackTransportPos.beat_type * 4 );

                long bar_ticks = 0;


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to