libsoundio icon indicating copy to clipboard operation
libsoundio copied to clipboard

Jack backend does not handle sample formats correctly

Open jpcima opened this issue 7 years ago • 2 comments

I am currently trying to port a synthesizer program from rtaudio to libsoundio. The synth is written largely in fixed-point integer and outputs signed 16 bit samples.

Now when I request the sample format S16NE and I also use the Jack backend, the audio output is garbage. I know Jack jack accepts only float data, but I act as if I do not know being user of the library. (previously rtaudio did automatic sample conversion from the program to Jack)

I request the format like suggested on the main page example, you can see the steps in the source linked for reference. https://gist.github.com/jpcima/96f842a1d78d643e70d4531ac2ef3acc

I tested the following scenarii:

  1. using Pulseaudio, either int16 or float sample type -> OK
  2. using Jack, float sample type, or format not specified -> OK
  3. using Jack, int16 sample type -> NOT OK

I would expect from the library either of these outcomes, but none happen.

  1. emitting an error
  2. automatic sample conversion (rtaudio behavior)
  3. change stream->format whatever is supported, and make the user is responsible for converting manually.

jpcima avatar Nov 21 '16 22:11 jpcima