Re: Again on sudden and occasional Jack crackling sound

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Again on sudden and occasional Jack crackling sound

Kjetil Matheussen

Lee Revell:

>
> On Tue, 2005-08-09 at 16:49 -0400, Paul Davis wrote:
>> On Tue, 2005-08-09 at 22:17 +0000, Salvatore Di Pietro wrote:
>>
>> > Moreover, using jack_bufsize, or resizing buffer within Ardour, causes
>> > complete muting of output sound (bit not clients death, as it was
>> > before), until I restart jack.
>> > Notice that this "complete muting" only affects the output ports, i.e.
>> I
>> > can continue recording with qarecord, or ardour, I just cannot hear
>> (and
>> > monitor) anything anymore until I restart jack and its clients.
>>
>> as far as we can tell, this is an ALSA (kernel) driver issue. it does
>> not affect other backends, and does not affect (we think) every ALSA
>> supported piece of h/w. it would be nice for it to be either fixed or at
>> least tracked down conclusively.
>>
>
> I suspect it's in the ALSA core (could be alsa-lib or in the kernel) as
> it's been reported with everything from ice1712 to emu10k1 to RME
> hardware to cheap onboard stuff.
>

Okey, this might be totally wrong. It might be that I haven't fully
understood
how the lock/unlock-stuff in the jack engine works.

But reading the code for jack_driver_buffer_size in jackd/engine, the
following seems to happen:

1. Lock graph
2. Change the buffer sizes integer for all the clients on the server:
   for-each-client-do: client->control->nframes = nframes;
3. Unlock the graph.
4. Lock the graph
5. Send a message to all clients that the buffersize must be changed.
5. Unlock the graph.

So, from what I can see, a process-cycle can happen between point 3 and 4,
where the server think the buffersize is the new value, while the clients
thing the buffersize is the old value.






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Again on sudden and occasional Jack crackling sound

Paul Davis
On Wed, 2005-08-10 at 14:33 +0200, Kjetil Svalastog Matheussen  wrote:

> Okey, this might be totally wrong. It might be that I haven't fully
> understood
> how the lock/unlock-stuff in the jack engine works.
>
> But reading the code for jack_driver_buffer_size in jackd/engine, the
> following seems to happen:
>
> 1. Lock graph
> 2. Change the buffer sizes integer for all the clients on the server:
>    for-each-client-do: client->control->nframes = nframes;
> 3. Unlock the graph.
> 4. Lock the graph
> 5. Send a message to all clients that the buffersize must be changed.
> 5. Unlock the graph.
>
> So, from what I can see, a process-cycle can happen between point 3 and 4,
> where the server think the buffersize is the new value, while the clients
> thing the buffersize is the old value.

nope.

see libjack/driver.c:jack_driver_nt_bufsize() which is called if using
the ALSA backend or any other non-thread-providing backend.

we stop the backend (e.g. the ALSA PCM device), then reset the
parameters. during the reset, the backend calls the engine's buffer size
callback, which notifies all clients of the change. then we restart the
backend.

--p






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel