Menu

Libninjam Notes

bill-auger

Libninjam Notes

DONE:

refactor audioStreamer classes to be more OOP
* added audioStreamer::WinApi, audioStreamer::MacApi, audioStreamer::NixApi public enums
* added many audioStreamer::DEFAULT_ device default public constants
* added NINJAM constants namespace in constants.h
* added NINJAM::MAX_USER_NAME_LEN, NINJAM::MAX_CHANNEL_NAME_LEN,
NINJAM::MAX_DEVICE_NAME_LEN, NINJAM::HOST_CHARS, NINJAM::NICK_CHARS constants
* named the NJClient:: connection status enum (as NJClient::ConnectionStatus)
* added NJClient::ConnectionStatus, NJClient::SubscribeMode, NJClient::SaveMultitrack,
NJClient::SaveMixdown, NJClient::DebugLevel enums
* added NJClient::GetLocalChannelName() convienence method
* added create_audioStreamer_ALSA() override accepting explicit params
* moved all create_audioStreamer_
functions into audioStreamer class
and renamed as NewASIO, NewKS, NewDS, New,WAVE, NewCA, NewJACK, NewALSA
* added audiostream_njasiodrv.cpp (functinality extraced from njasiodrv_if.cpp)
* re-wrote njasiodrv_create_asio_streamer to accept explicit params
(renamed as NewASIO())
* re-wrote init_dll() and njasiodrv_avail()
(renamed as LoadNjasiodrvDll() and IsNjasiodrvAvailable())
* renamed pointer cas() to newASIO()
* added audioStreamer::ASIO_DLL_FILENAME, audioStreamer::ASIO_CONSTRUCTOR_NAME,
audioStreamer::ASIO_ARGS_FMT private constants
* added DsDevice struct and audioStreamer::DsDevices vector
* added audioStreamer::GetDsNames(), audioStreamer::GetDsNamesCSV(),
audioStreamer::GetDsGuids(), audioStreamer::GetDsGuidsCSV(),
audioStreamer::GetDsGuidByName(), audioStreamer::GetDsGuidIdx(),
audioStreamer::DsGuidToString(), audioStreamer::DsGuidFromString()
audioStreamer::DsEnumDo() public helpers
* added audioStreamer::LoadDsDevices(), audioStreamer::StoreDsDevice() private helpers
* added audioStreamer::getNInputChannels(), audioStreamer::getNOutputChannels(),
audioStreamer::getSampleRate(), audioStreamer::getBitDepth()
audioStreamer::GetASIODriverName() public getters
* added GCC pragmas to supress warnings in WDL/string.h and WDL/jnetlib/httpget.h
* removed (commented) unused functions in WDL/pcmfmtcvt.h

TODO:
  • config_play_prebuffer enum ?
  • should_save_ogg and should_save_wav undocumented - no instance vars config only
  • config_debug_level , config_autosubscribe undocumented
  • all members of audioStreamer class are public (not very OOP)
  • all audioStreamer "constructors" are not even class members (fixed - kinda)
    they are all now class methods of audioStreamer abstract superclass
  • audioStreamer subclass naming is confusing
    • e.g. audioStreamer_KS is not a audioStreamer but audioStreamer_KS_asiosim is
    • audioStreamer_KS_asiosim constructor take 2 audioStreamer_KS as args (in,out)
    • suggest move device instantiation from global "constructor" into real constructor
    • e.g. the body of audioStreamer::NewKS() into audioStreamer_KS_asiosim::audioStreamer_KS_asiosim()
    • suggest renaming all audioStreamer classes to NjAudio
      e.g. audioStreamer would become NjAudio
      e.g. audioStreamer_KS_asiosim would become NjAudioKS
    • suggest renaming all non-audioStreamer audioStreamer classes to NjDevice
      e.g. audioStreamer_KS would become NjDeviceKS
  • most of the LinJam NJClient/audioStreamer helpers could be public methods of NJClient and audioStreamer
  • latency estimation could be a public method of audioStreamer
    if n_buffers and buffer_size instance vars were added
  • auto-agree could be a feature of NJClient by deferring mpb_client_auth_user reply to MESSAGE_SERVER_AUTH_CHALLENGE until the client is ready to accept (as of now the server will timeout if license is not accepted in 45 sec while LicenseAgreementCallback is blocking) - ideally also setting "mpb_server_auth_challenge::license_agreement_version" server-side and pre-setting "NJClient::accepted_license_versions" client-side to avoid calling LicenseAgreementCallback at all if match is found
  • support for faux-stereo pairs and/or true stereo
  • support for chord progression display
  • support for elected soundman
  • registered users - vote to kick - vote for soundman
  • normalizing/conditioning features such as auto-gain and limiter
  • make local channel "gain" knob actually set input gain instaed of monitor level
  • are subscriptions IDs (nicks) per-server or universal - probably universal but that would be wonky
  • currently the only way to distinguish a login failure due to room full
    is to compare Client->GetErrorStr() to "server full" on NJC_STATUS_CANTCONNECT
    • a new NJClient::ConnectionStatus state NJC_STATUS_ROOMFULL would be nifty
  • create_audioStreamer_JACK issues warning "jack_client_new: deprecated"
  • full JACK support/integration on all JACK supported OSes
  • provide a few more device query helpers so we can avert C-style memory sharing
    especially getters for current n_buffers and buffer_size
    for KS "constructor" (modifies ks_n_buffers and ks_buffer_size params)
    and getter for current device name
    for CA "constructor" (modifies device_name buffer param)
    this could include full device enumerations as in LinJam ConfigAudio::query*Devices(

Notes

  • re: is_stereo - this essentially equates to is_pannable

  • re: config_savelocalaudio

    • semantics =>
      win.ini("saveogg") == ogg mixdown
      win.ini("savewave") == wav mixdown
      win.ini("savelocal") == ogg? multitrack
      win.ini("savelocalwav") == wav multitrack

    • algorhythm =>
      config_savelocalaudio = 0
      if win.ini("savelocal")
      => config_savelocalaudio |= 1
      => if win.ini "savelocalwav"
      => config_savelocalaudio |= 2
      if win.ini("savewave")
      => config_savelocalaudio (no internal representation)
      waveWrite = new WaveWriter(GetWorkDir() + "output.wav" , 24 , ... )
      if win.ini("saveogg")
      => config_savelocalaudio (no internal representation)
      SetOggOutFile(fopen(GetWorkDir() + "output.ogg" ,"ab") , ... , win.ini("saveoggbr"))
      if config_savelocalaudio
      SetLogFile(GetWorkDir() + "clipsort.log")

  • re: config_debug_level - handling of this seems a bit wonky

  • prints some data via printf and others via OutputDebugString()
  • never prints to log

    • semantics =>
      => config_debug_level > 0 => prints buffer underruns (windows only)
      => config_debug_level > 1 => traces normal network messaging

gNinjam Notes

for reference - these are some of the older pre-reqs for gninjam binary package
* deb http://gehrignet.de/ubuntu/ jaunty/ # gninjam
* deb http://gehrignet.de/ubuntu/ hardy/ # libninjam

  $ sudo apt-get install gninjam # with only jaunty repo
  The following packages have unmet dependencies:
   gninjam : Depends: libninjam-client (>= 0.02-7ubuntu2) but it is not installable

  $ sudo apt-get install gninjam # with both repos
  The following packages will be REMOVED:
    jackd2 jackd2-firewire libjack-jackd2-0 libjack-jackd2-dev
  The following NEW packages will be installed:
    gninjam jackd1 jackd1-firewire libgconf2-4 libgconfmm-2.6-1c2 libjack0
    libninjam-client libninjam-common libxcb-render-util0 libzita-alsa-pcmi0
    libzita-resampler1

  $ sudo apt-get build-dep gninjam
  The following packages will be REMOVED:
    jackd2 jackd2-firewire libjack-jackd2-0 libjack-jackd2-dev
  The following NEW packages will be installed:
    gir1.2-gtk-2.0 jackd1 libatk1.0-dev libatkmm-1.6-dev
    libcairo-script-interpreter2 libcairo2-dev libcairomm-1.0-dev libgconf2-dev
    libgconfmm-2.6-1c2 libgconfmm-2.6-dev libgdk-pixbuf2.0-dev libglibmm-2.4-dev
    libgtk2.0-dev libgtkmm-2.4-dev libharfbuzz-dev libharfbuzz-gobject0 libjack0
    libninjam-client libninjam-client-dev libninjam-common libninjam-common-dev
    libpango1.0-dev libpangomm-1.4-dev libsigc++-2.0-dev libxcb-shm0-dev
    libxcomposite-dev libxi-dev libxrandr-dev libzita-alsa-pcmi0
    libzita-resampler1 x11proto-composite-dev

  # NOTE: do not install - jackd1 libjack0 libninjam-client libninjam-client-dev libninjam-common libninjam-common-dev
  $ sudo apt-get install gir1.2-gtk-2.0 libatk1.0-dev libatkmm-1.6-dev libcairo-script-interpreter2 libcairo2-dev libcairomm-1.0-dev libgconf2-dev libgconfmm-2.6-1c2 libgconfmm-2.6-dev libgdk-pixbuf2.0-dev libglibmm-2.4-dev libgtk2.0-dev libgtkmm-2.4-dev libharfbuzz-dev libharfbuzz-gobject0 libpango1.0-dev libpangomm-1.4-dev libsigc++-2.0-dev libxcb-shm0-dev libxcomposite-dev libxi-dev libxrandr-dev libzita-alsa-pcmi0 libzita-resampler1 x11proto-composite-dev
The following NEW packages will be installed:
  gir1.2-gtk-2.0 libatk1.0-dev libatkmm-1.6-dev libcairo-script-interpreter2
  libcairo2-dev libcairomm-1.0-dev libgconf2-dev libgconf2-doc
  libgconfmm-2.6-1c2 libgconfmm-2.6-dev libgdk-pixbuf2.0-dev libglibmm-2.4-dev
  libgtk2.0-dev libgtkmm-2.4-dev libharfbuzz-dev libharfbuzz-gobject0
  libpango1.0-dev libpangomm-1.4-dev libsigc++-2.0-dev libxcb-shm0-dev
  libxcomposite-dev libxi-dev libxrandr-dev libzita-alsa-pcmi0
  libzita-resampler1 x11proto-composite-dev