[Jack-Devel] How to use jackd as a 'system-wide' server?

Chris Caudle chris at chriscaudle.org
Fri May 11 23:13:53 CEST 2018

On Fri, May 11, 2018 3:59 pm, Chris Caudle wrote:
> I don't see jack_ringbuffer_write() in that same app_jack.c file and I

OK, I had time to search a little.  That function is from jack, not
asterisk, but I think the asterisk code may not be using it correctly.
The jack ringbuffer.h file has this note:
return the number of bytes write, which may range from 0 to cnt

So it seems that the write() function is documented as possibly writing
less than the full data given.

There is also this function, which seems to be for getting the amount of
free space available in the ringbuffer, but I cannot see that the asterisk
code ever calls this function:

 * Return the number of bytes available for writing.
 * @param rb a pointer to the ringbuffer structure.
 * @return the amount of free space (in bytes) available for writing.
size_t jack_ringbuffer_write_space(const jack_ringbuffer_t *rb);

In short, I think this is a bug in the asterisk implementation.  It should
be checking how much free space is available and only attempting to write
that, or  should just deal with write() not writing the full amount of
data and calling write() again later to finish writing all the data.

Chris C

More information about the Jackaudio mailing list