Re: [LAU] Segfault using zita-j2a

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jannis Achstetter <jannis_achstetter@...>
Cc: <linux-audio-user@...>
Date: Thursday, October 25, 2012 - 3:23 pm

On 10/25/2012 04:54 PM, Jannis Achstetter wrote:

Classic race condition. The jack_client is activated before the
resampler is initialized.

zita-j2a.cc:200 creates the jack-client and calls jack_activate.
process_callbacks can arrive starting now.

but not until zita-j2a.cc:211 calls J->start() the data-structures
required to do the processing are initialized.

Easiest solution is probably to check if start() has been called in the
process callback:

--- a/jackclient.cc
+++ b/jackclient.cc
@@ -301,6 +301,8 @@ int Jackclient::jack_process (int nframes)
jack_nframes_t ft;
double tj, err, d1, d2;

+ if (_state == INIT) return 0;
+
// Buffer size change or other evil.
if (_state == TERM)

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] Segfault using zita-j2a, Jannis Achstetter, (Thu Oct 25, 2:54 pm)
Re: [LAU] Segfault using zita-j2a, Robin Gareus, (Thu Oct 25, 3:23 pm)
Re: [LAU] Segfault using zita-j2a, Fons Adriaensen, (Thu Oct 25, 3:51 pm)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Thu Oct 25, 5:37 pm)
Re: [LAU] Segfault using zita-j2a, Fons Adriaensen, (Thu Oct 25, 8:57 pm)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Thu Oct 25, 9:37 pm)
Re: [LAU] Segfault using zita-j2a, Fons Adriaensen, (Fri Oct 26, 7:37 am)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Fri Oct 26, 10:27 am)
Re: [LAU] Segfault using zita-j2a, Fons Adriaensen, (Fri Oct 26, 11:57 am)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Sat Oct 27, 6:23 pm)
Re: [LAU] Segfault using zita-j2a, Fons Adriaensen, (Fri Oct 26, 7:59 am)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Thu Oct 25, 4:52 pm)
Re: [LAU] Segfault using zita-j2a, Jannis Achstetter, (Thu Oct 25, 3:49 pm)
Re: [LAU] Segfault using zita-j2a, Robin Gareus, (Thu Oct 25, 3:53 pm)