Open jpcima opened 7 years ago
Thank you for the report. Looks like you found a bug. The intended behavior is (1) emitting an error if the backend cannot support the sample format.
One thing you can do in the mean time is check the device capabilities before opening the stream. I believe that will be correct and can be a workaround until this is fixed.
As you have have suggested I now check the capabilities given by device->formats. According to this list I select the first one of int16/float which is available, in that order. I confirm the problem is resolved on my side. Thanks 👍
I also spent time trying to get it to work on a Steam Deck. It works well using the PulseAudio backend, but Jack being the default first priority, I was having lots of issues.
Is it a limitation inherent to Jack that it does not handle anything else than Float32LE
/ Stereo
/ 48000
?
I am also now wondering if https://github.com/crow-misia/go-libsoundio/issues/6 is really an issue with those bindings, or if it's just the Jack backend behaving differently.
I ended-up disabling it completely for now.
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:
I would expect from the library either of these outcomes, but none happen.