libsoundio
libsoundio copied to clipboard
Jack backend does not handle sample formats correctly
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:
- using Pulseaudio, either int16 or float sample type -> OK
- using Jack, float sample type, or format not specified -> OK
- using Jack, int16 sample type -> NOT OK
I would expect from the library either of these outcomes, but none happen.
- emitting an error
- automatic sample conversion (rtaudio behavior)
- change stream->format whatever is supported, and make the user is responsible for converting manually.