/csjsound-alsapcm

Alsa PCM dynamic library for csjsound-provider

Primary LanguageCOtherNOASSERTION

csjsound-alsapcm

Alsa PCM dynamic library for the CleanSine javasound provider https://github.com/pavhofman/csjsound-provider . Only PCM devices are listed (as opposite to the standard OpenJDK alsa provider which lists only hw cards).

Building

For amd64:

cd src
./compile.sh

Cross compiling on ubuntu for aarch64 (requires the aarch64 build chain and libasound2:arm64 library):

./compile.sh aarch64

Logging

The log level is defined at compile time by defining USE_ERROR and/or USE_TRACE in

#define USE_ERROR
.

All logs are sent to stdout (via standard fprintf(stdout))

#ifdef USE_ERROR

Detected Formats

The javasound API requires a list of pre-determined formats supported by the devices. The ALSA-PCM library reads hw_params and sends combinations of:

  • min/max rates
    addFmtForChannels(mInfo, sampleSignBits, sampleBytes, channelsMin, channelsMax, rateMin, enc, isSigned, isBigEndian);
  • min/2/max channels
    clbkAddAudioFmt(mInfo, sampleSignBits, sampleBytes * channelsMin, channelsMin, rate, enc, isSigned, isBigEndian);
    Because only interval rate/channel values are reported, a format with channels = AudioSystem.NOT_SPECIFIED (-1) is added for each combination.

Ignored Config Names

The alsa configs enumeration skips standard config names, same as in PortAudio

static const char *IGNORED_CONFIGS[] = {