Hi,
Tobias, you can check my slightly improved version of jack_transport:
https://sourceforge.net/p/nxjsm/code/HEAD/tree/trunk/tools/transport.c
I'm also the author of new Hydrogen jack-master code. It's works much better , but probably not perfect ;-)
P.
Dnia Czwartek, 2 Lipca 2015 18:57 Paul Davis <paul(a)linuxaudiosystems.com> napisał(a)
> Frankly, computing BBT time has never been part of "how to use the
> JACK API". It should probably never have been included in the source
> code in the first place.
>
> Managing BBT time is *extremely* complex - we have worked on it for
> years in Ardour and it still has issues. I'd prefer to just rip it
> out.
>
> On Thu, Jul 2, 2015 at 12:47 PM, Tobias Hoffmann
> <lfile-list(a)thax.hardliners.org> wrote:
> > On 02/07/15 17:30, Tobias Hoffmann wrote:
> >>
> >> On 02/07/15 15:38, Paul Davis wrote:
> >>>
> >>> jack_transport is not intended to act as a the time master.
> >>
> >> Well, comparing example-clients/transport_client.c and tools/transport.c,
> >> I'd say the one big difference between the two is that tools/transport.c
> >> (aka jack_transport) can act as a *simple* timebase master...
> >
> >
> > Ok, I see now that the BBT update algorithm (in the "else" branch in
> > timebase()) in transport.c is quite broken, because it accumulates rounding
> > errors. However always using the first, recalculating branch (basically: if
> > (true)) seems to be stable -- or at least: better than Hydrogen's timebase
> > master, which updates the BBT only every few cycles... (I've read that
> > somewhere a completely rewritten Jack Master implementation for Hydrogen is
> > available, which I have not tested yet).
> >
> > I find it quite sad that even some code distributed in the jack tarball is
> > an example of how NOT to use the Jack API ...
> >
> > Tobias
> >
> >
> >
> >
> >
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel(a)lists.jackaudio.org
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Hi,
I'm still using debian's jackd1/libjack0 package (0.124.1) and have not
tried to reproduce this with git master yet (at least, I haven't seen an
obvious fix in the commit log since 0.124.1).
In one terminal window I run jack_showtime.
In the other window I do:
jack_transport
> tempo 96 # just in case
> master
> play # does not
jack_showtime correctly shows the state, but no BBT information. From my
own client I know that jack_position_t::valid==0.
Some testing revealed that the timebase() callback in tools/transport.c
is *not called at all*, although jack_set_timebase_callback is called
and returns without error.
- But everything works fine when I switch to the jack2 stack...
And in some cases, when switching between/enabling/disabling different
Transport masters,
jack_position_t::valid retains the JackPositionBBT flag (and stale
information) -- but no-one updates them any more...
Maybe related: I've seen some strange values (*very* large negative
number) for bar_start_tick when using ardour4.1.
The very first time (and after rewind?) it contains 0.0 and is not
updated. A quick glance into the ardour source code reveals that this
field is not implemented yet. I could probably live with that.
BUT: After stopping+starting the playback, these strange values
appear... How can I know whether some value in this field is usable at
all -- except for some heuristics?
Back to the original topic... in both cases the jack_position_t struct
contains stale/random values, instead of starting from a "clean" base --
maybe memset(,0,) is all that is needed here?
Tobias
Branch: refs/heads/master
Home: https://github.com/jackaudio/headers
Commit: 23c29914806edefb496af098e937cc09e472bbbe
https://github.com/jackaudio/headers/commit/23c29914806edefb496af098e937cc0…
Author: Paul Davis <paul(a)linuxaudiosystems.com>
Date: 2015-07-02 (Thu, 02 Jul 2015)
Changed paths:
M jack.h
Log Message:
-----------
add new public API: jack_port_rename
This is semantically similar to jack_port_set_name() but because it is also passed a jack_client_t*, it can
contact the server to ensure that not only the rename is done but that port rename callbacks are delivered
appropriately
A few months ago we'd digged jackd code in #alsa IRC trying to find why itfails with "ALSA: could not start playback (File descriptor in bad state)"when run on top "type bluetooth" pcm. The reason was in a single line (both in jack1/drivers/alsa/alsa_driver.cand jack2/linux/alsa/alsa_driver.c): if ((err = snd_pcm_start (driver->playback_handle)) < 0) {which always fails after snd_pcm_mmap_commit() filling the buffer,because pcm's already in RUNNING state and can't be started again:> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html> For playback, if samples in ring buffer is equal or greater than> the start threshold parameters and the stream is not running,> the stream will be started automaticallyThe following small patch fixes it for both jack1 and jack2:--- alsa_driver.c+++ alsa_driver.c @@ -1055,7 +1055,8 @@ alsa_driver_start (alsa_driver_t *driver driver->user_nperiods * driver->frames_per_cycle); - if ((err = snd_pcm_start (driver->playback_handle)) < 0) {+ if (snd_pcm_state(driver->playback_handle) != SND_PCM_STATE_RUNNING+ && (err = snd_pcm_start (driver->playback_handle)) < 0) { jack_error ("ALSA: could not start playback (%s)", snd_strerror (err)); return -1;
Hi there,
Does anyone have any examples on how to use the loopback driver ?
If I want to drive an ALSA system and also have loopback going for
everything which hits the ALSA output, is that possible ?
thanks
Matt
Here http://jackaudio.org/downloads/
"Mixed 64/32 bit, 0.90 of JackOSX for Snow Leopard" ==> should be corrected to "Mixed 64/32 bit, 0.90 of JackOSX for Snow Leopard and later…"
Can someone with write access correct that?
Thanks.
Stéphane
Hi,
I using debian's
jackd version 0.124.1 tmpdir /dev/shm protocol 25
started via
jackd -t1500 -dalsa -dhw:2 -r44100 -p128 -n4 -s -Xseq
(or "jackd -Xalsa_midi ...")
Then jackd segfaults shortly after
creating alsa_midi driver ...
- every time, e.g:
jackd[25175]: segfault at 0 ip (null) sp 00000000ffb828ac
error 14 in jackd[8048000+5000]
It does not segfault when -Xseq (-Xalsa_midi) is removed from the
argument list.
The very same invocation (same jackd version!) used to work until now,
but I did update quite a few packages (e.g. libc, ...) in the mean time.
I did try a reinstall of the jackd1-package, but it did not help.
But I have not restarted the computer yet...
Analysis:
Starting jackd in gdb yields:
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
without any backtrace left.
But with some single-stepping I managed to get to this point:
#0 0xf7f960d7 in jack_client_handle_latency_callback () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#1 0xf7f89466 in jack_deliver_event () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#2 0xf7f8b5ca in ?? () from /usr/lib/i386-linux-gnu/libjackserver.so.0
#3 0xf7f8bec1 in jack_sort_graph () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#4 0xf7f8f792 in jack_client_activate () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#5 0xf7f8d662 in ?? () from /usr/lib/i386-linux-gnu/libjackserver.so.0
#6 0xf7f8e50a in internal_client_request () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#7 0xf7f9563e in jack_client_deliver_request () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#8 0xf7f9868b in jack_activate () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#9 0xf6b47456 in ?? () from /usr/lib/i386-linux-gnu/jack/jack_alsa_midi.so
#10 0xf7f88faa in jack_add_slave_driver () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#11 0xf7f89097 in jack_engine_load_slave_driver () from
/usr/lib/i386-linux-gnu/libjackserver.so.0
#12 0x0804a6d4 in ?? ()
#13 0xf7bc8a63 in __libc_start_main
The very next instruction crashes:
0xf7f960db <jack_client_handle_latency_callback+459> call
*0x10f4(%eax)
because *(eax+0x10f4)==0
Starting jackd in valgrind:
[...]
ALSA: use 4 periods for playback
creating alsa_midi driver ...
==25829== Conditional jump or move depends on uninitialised value(s)
==25829== at 0x406EFAC: jack_client_handle_latency_callback (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4062465: jack_deliver_event (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x40645C9: ??? (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4064EC0: jack_sort_graph (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4068791: jack_client_activate (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4066661: ??? (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x1: ???
==25829==
==25829== Conditional jump or move depends on uninitialised value(s)
==25829== at 0x406EFAC: jack_client_handle_latency_callback (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4062465: jack_deliver_event (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4064629: ??? (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4064EC0: jack_sort_graph (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4068791: jack_client_activate (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x4066661: ??? (in
/usr/lib/i386-linux-gnu/libjackserver.so.0.0.28)
==25829== by 0x1: ???
==25829==
Does this make sense to anyone?
Tobias