Re: [Jack-Devel] Client deactivation behavior

PrevNext  Index
DateSat, 03 Sep 2011 22:03:18 -0700
From Devin Anderson <[hidden] at charityfinders dot com>
ToGabriel Beddingfield <[hidden] at gmail dot com>
Cc[hidden] at lists dot jackaudio dot org
In-Reply-ToGabriel Beddingfield Re: [Jack-Devel] Client deactivation behavior
Follow-UpGabriel Beddingfield Re: [Jack-Devel] Client deactivation behavior
On Sat, Sep 3, 2011 at 1:16 PM, Gabriel Beddingfield <[hidden]> wrote:

>> I'm in the middle of testing a new version of `synthclone`, and I'm
>> noticing what I believe is incorrect behavior in JACK 1 (0.120.2 on
>> AVLinux).
>>
>> Intermittently, I notice that the process callback will still be
>> executing after jack_deactivate() returns, and `synthclone` will
>> segfault in the process callback in a call to jack_port_get_buffer().
>> I don't know if the process callback is called before the call to
>> jack_deactivate() and jack_deactivate() isn't waiting for it to
>> finish, or if the process callback is being called after
>> jack_deactivate() returns.
>>
>> Before filing a bug, I want to make sure this is not expected behavior
>> and that this isn't fixed in newer versions of JACK.  I'll try a newer
>> version tomorrow if this isn't cleared up by then.
>
> This is not expected behavior.  jack_deactivate() should be synchronous...
> that is, it should not return until the process() cycle is complete.
>
> FWIW, if JACK 0.120.2 actually exhibits this bug... all hell would be
> breaking loose with every JACK app... not just yours.

I did a bit more experimentation throughout the week, and could only
get this bug to occur when:

1.) (The new version of) `synthclone` is running in debug mode from QtCreator.
2.) JACK functionality is contained in a Qt plugin.
3.) JACK 0.120.2 (from AV Linux) is installed.
4.) A call to jack_deactivate() is closely followed by freeing
resources used in the process callback.

I couldn't get the bug to show itself under any other circumstances.
If I don't use debug mode, make JACK calls in the main executable, use
a different version of JACK, change the code to use
jack_client_close() instead of jack_deactivate(), or wait to free
resources, then everything runs fine.

Hmmm.  I can now confirm that updating QtCreator also makes the bug go away.

I'm confused, but I'm pretty certain this isn't a bug in JACK.

Sorry for any trouble/confusion I may have caused (aside from my own).

-- 
Devin Anderson
devin (at) charityfinders (dot) com

CharityFinders - http://www.charityfinders.com/
synthclone - http://synthclone.googlecode.com/
PrevNext  Index

1315112622.9396_0.ltw:2,a <CAG7zqTo2Wurx-Tn-e+3dkbQUufTNQr2T014t0TuPUKt=vAXLZA at mail dot gmail dot com>