[email protected] wrote:
h2 as slave
(song mode)
+ no double hit at start. (start impulse from h2 or ardour)
+ follow correct tempo changes from master (ardour)

Actually, I'm getting double-hits at start after a few +/- button tempo changes.

(song mode)
h2 as master
+ no double hit at start. (start impulse from h2 or ardour)
+ no jumping in timeline on tempochanging during playback.

Yes, but...


so imoh,
we can remove the whole getArdourTransportAdjustment function. because ardour 2.7.1 and 3 , qjackctl(transport buttons), and seq24 produce no double hit anymore.

If everyone else agrees that our users only plan to use the H2 transport with Ardour 2.7.1 and 3.x... then yes, let's take out the transport adjustment.

only time master will need on two places - getBufferSize() what is the same 
than getArdourTransportAdjustment.

No.  This is wrong.

There should be no buffersize correction. Frame=0 should be 1:1:0... not Frame=getBufferSize(). Any sort of buffersize correction like this is *not* conforming to the transport and is working around some other bug.

I did some transport auditing, and find that Hydrogen (as transport master) isn't working right at all -- independent of audio. I wrote a JACK Client that just observes the jack_position_t that is being fed to all the JACK Clients (see attached). Here's what we get with your patch:

usecs=179033476580 fps=48000 frame=0 bpm=110.4 B:B:T=1:1:0 bbt_offset=0
usecs=179033497885 fps=48000 frame=1024 bpm=110.4 B:B:T=1:1:0 bbt_offset=0
usecs=179033519235 fps=48000 frame=2048 bpm=110.4 B:B:T=1:1:40 bbt_offset=0
usecs=179033540554 fps=48000 frame=3072 bpm=110.4 B:B:T=1:1:48 bbt_offset=0
usecs=179033561939 fps=48000 frame=4096 bpm=110.4 B:B:T=1:1:56 bbt_offset=0

Notice that ticks 0 and 1024 are both 1:1:0, and that 2048 jumps to 1:1:40. I would expect the ticks to go 0, 8, 16, etc.

Here's rev 858:

usecs=179454108209 fps=48000 frame=0 bpm=120 B:B:T=1:1:0 bbt_offset=0
usecs=179454129526 fps=48000 frame=1024 bpm=120 B:B:T=1:1:0 bbt_offset=0
usecs=179454150858 fps=48000 frame=2048 bpm=120 B:B:T=1:1:52 bbt_offset=0
usecs=179454172379 fps=48000 frame=3072 bpm=120 B:B:T=1:1:60 bbt_offset=0
usecs=179454193586 fps=48000 frame=4096 bpm=120 B:B:T=1:1:68 bbt_offset=0

...not much better.

What's more... the tick count is usually 8 ticks per period. But, with your patch we sometimes get a period with only 4 ticks (1:2:76 -> 1:2:80):

usecs=179034095196 fps=48000 frame=29696 bpm=110.4 B:B:T=1:2:52 bbt_offset=0
usecs=179034118910 fps=48000 frame=30720 bpm=110.4 B:B:T=1:2:60 bbt_offset=0
usecs=179034138749 fps=48000 frame=31744 bpm=110.4 B:B:T=1:2:68 bbt_offset=0
usecs=179034160514 fps=48000 frame=32768 bpm=110.4 B:B:T=1:2:76 bbt_offset=0
usecs=179034181174 fps=48000 frame=33792 bpm=110.4 B:B:T=1:2:80 bbt_offset=0
usecs=179034201904 fps=48000 frame=34816 bpm=110.4 B:B:T=1:2:88 bbt_offset=0
usecs=179034223196 fps=48000 frame=35840 bpm=110.4 B:B:T=1:2:96 bbt_offset=0

This happens regularly. Some other patches may do this, but I didn't see it with rev 858.

In contrast, I get this from InConcert:

usecs=180994287332 fps=48000 frame=0 bpm=120 B:B:T=1:1:0 bbt_offset=0
usecs=180994308692 fps=48000 frame=1024 bpm=120 B:B:T=1:1:15 bbt_offset=23
usecs=180994330006 fps=48000 frame=2048 bpm=120 B:B:T=1:1:30 bbt_offset=47
usecs=180994351333 fps=48000 frame=3072 bpm=120 B:B:T=1:1:46 bbt_offset=5
usecs=180994372664 fps=48000 frame=4096 bpm=120 B:B:T=1:1:61 bbt_offset=29

(...not that InConcert is a pillar of stability and reliability... but... you get the point.)

*sigh*  I'm not sure what to do.  :-/

I'm backing out rev 851 to find a better solution.

Peace,
Gabriel




/**********************************************-*- indent-tabs-mode:nil; -*-
 *                                                                         *
 *   Jack Transport Audit Utils                                            *
 *                                                                         *
 *   Copyright (C) 2008 by Gabriel M. Beddingfield                         *
 *   [email protected]                                                    *
 *                                                                         *
 *   "For of him [God], and through him, and unto him, are all things.     *
 *   To him be the glory for ever. Amen." (Romans 11:36)                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; version 2 of the License, or any later  *
 *   version                                                               *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

/* t_log_xport.cpp
 *
 * JACK Transport client that logs the frame and BBT of the transport
 * for every process cycle.  This is similar to the showtime.c
 * example client in the jack sources... but this catches every
 * frame.  It records up to 262144 process cycles, it only records
 * while Rolling.
 */

#include <cstring>
#include <unistd.h>
#include <iostream>
#include <iomanip>
#include <jack/jack.h>
#include <jack/transport.h>

using namespace std;

struct xpos_t {
    jack_time_t usecs;
    jack_nframes_t frame_rate;
    jack_nframes_t frame;
    int32_t bar, beat, tick;
    jack_nframes_t bbt_offset;
    double beats_per_minute;
};

jack_client_t *_client;
const long int BUFSIZE = 262144;  // max recording space.
xpos_t buf[BUFSIZE];
unsigned long buf_pos = 0;
bool done = false;

int jack_callback (jack_nframes_t nframes, void* /*arg*/)
{
    jack_transport_state_t     state; 
    jack_position_t            posit;

    if( buf_pos >= (unsigned long)BUFSIZE ) {
        done = true;
    }

    if(done) return 0;

    state = jack_transport_query (_client, &posit);

    if (state == JackTransportRolling)
    {
        buf[buf_pos].usecs = posit.usecs;
        buf[buf_pos].frame_rate = posit.frame_rate;
        buf[buf_pos].frame = posit.frame;
        buf[buf_pos].bar = posit.bar;
        buf[buf_pos].beat = posit.beat;
        buf[buf_pos].tick = posit.tick;
        buf[buf_pos].bbt_offset =
            ((posit.valid & JackBBTFrameOffset) ? posit.bbt_offset : 0);
        buf[buf_pos].beats_per_minute = posit.beats_per_minute;
        ++buf_pos;
    }

    return 0;  
}

ostream& operator<<(ostream& os, xpos_t p)
{
    os << "usecs=" << p.usecs
       << " fps=" << p.frame_rate
       << " frame=" << p.frame
       << " bpm=" << p.beats_per_minute
       << " B:B:T=" << p.bar << ':' << p.beat << ':' << p.tick
       << " bbt_offset=" << p.bbt_offset;
    return os;
}

int main(void)
{
    jack_client_t *client;

    memset (buf, 0, BUFSIZE * sizeof (float));

    _client = jack_client_open(__FILE__,
			      JackNullOption,
			      0);
    jack_set_process_callback(_client,
			      jack_callback,
			      0);
				 
    jack_activate(_client);

    unsigned long k = 0, tmp;
    while(!done) {
	sleep(1);
        if( (buf_pos - k) >= 30 ) {
            tmp = buf_pos;
            for( k ; k < tmp ; ++k ) {
                cout << buf[k] << endl;
            }
        }
    }

    done = true;

    jack_client_close(_client);

    return 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