The JACK ring buffer requires that a buffer be a power of two in size.
This is not possible if the number of voices is not a power of two, so
I have removed the JACK ring buffer from the io-audio JACK driver. I
have replaced it with use of the raw DMA buffer along with a current
fragment value to track where we should be reading from the DMA buffer.
snd_pcm_read() was failing because we were not attempting to read a
multiple of the fragment size. This patch fixes that so we read a
whole fragment at a time instead of the fragment size / frame size.
Generally, JACK input ports are called "capture" and a number, while
output ports are called "playback". The io-audio JACK driver for QNX
looks like an io-audio playback device, but to JACK, it looks like a
capture device. So I have updated the driver to call its ports
"capture" rather than "playback".
When playing a fixed-point wave file, the JACK io-audio driver was
only playing every fourth sample. This was due to a math error in the
io-audio driver code that was incrementing by the sizeof a sample
rather than just incrementing by 1.
This patch adds a missing case to the tests wscript, to handle the QNX
platform. It also adds code to the setup for the various directory
macros, to handle the case when the build is taking place on Windows,
to ensure that the directory paths still come across in POSIX format.
Change-Id: If8054284d390e40c97c8c585af2851e94275aad8
Adds enough support and platform-specific files to get JACK building
on QNX SDP 6.6.0. This does not include any integration with the QNX
audio system, io-audio.
The expression tries to take the absolute value of an unsigned
(jack_nframes_t) which is the difference between two unsigned.
Cast the unsigned to signed before taking the difference so a
cur_buffer_size larger than delta_time actually produces a meaningful
result.
According to the posix standard, a named semaphore needs to begin with a
slash in order to guarantee the same semaphore will be opened by that name
by multiple processes.
This is an issue on QNX where a named semaphore that does not begin with a
slash has the current working directory prepended to the name as a kind of
namespacing.
jack_ringbuffer_reset_size changed the tracked size of the internal
buffer but didn't actually resize the buffer itself, potentially
leading to buffer overflows.
JACK2 added this function first, but the int return has been always wrong.
When JACK1 added JackPortRenameCallback it used the proper return.
Now that JACK1 supports port renames, devs will start to use it.
(previously it didn't work properly because of the missing jack_client_t* arg)
Some code might be broken because of this, but it's a very simple change,
and existing code would have been broken when changing JACK1 to JACK2.
Finally, JACK2 code never uses the int return value of this callback.
So there's no real reason to NOT change this.