Re: [Jack-Devel] Stopping jack from callback

PrevNext  Index
DateThu, 15 Aug 2013 15:31:26 +0200
From Anders Tornvig <[hidden] at gmail dot com>
ToAdrian Knoth <[hidden] at drcomp dot erfurt dot thur dot de>
CcJACK <[hidden] at lists dot jackaudio dot org>
In-Reply-ToAdrian Knoth Re: [Jack-Devel] Stopping jack from callback
Follow-UpHarry van Haaren Re: [Jack-Devel] Stopping jack from callback
On 15 August 2013 14:53, Adrian Knoth <[hidden]> wrote:

> On Thu, Aug 15, 2013 at 02:27:27PM +0200, Anders Tornvig wrote:
>
> > int process (jack_nframes_t nframes, void *arg) {
> >    DPOAE *dpoae = (DPOAE *)arg;
> >    dpoae->m++;
> > }
>
> Just return 1 in the process cycle if your variable reaches the
> threshold, and jackd will deactivate you.
>

Neat. It works.

So it's:
>
> int process (jack_nframes_t nframes, void *arg) {
>    DPOAE *dpoae = (DPOAE *)arg;
>
>    return (dpoae->m++ > 100) ? 1 : 0;
> }
>
> or something less hacky. You'd probably set your global stop variable,
> too, just to inform main() about it. ;)
>
> Yes ok, then I still have to check on the m-variable. Jack wouldn't happen
to have a thread-safe "isactive(client)" function?

Great response time by the way, thanks!
PrevNext  Index

1376573508.16930_0.ltw:2,a <CAMeZe4HA6XkHiF4ZG9nrDVZ=S8Y=r6iHc08AOW1R1KdNHciojw at mail dot gmail dot com>