JamesDSP Documentation

repository·master·Indexed 20 days ago

https://github.com/james34602/jamesdspmanager

A cross-platform Digital Signal Processing (DSP) library and Android application providing advanced audio effects including multiband compression, convolution reverb, and live programmable EEL-based DSP. It supports various bit depths (16, 24, 32-bit) and provides a framework for developers to build custom Android audio effects for versions 4.4 through 10.0.

Tokens
6K
Snippets
11
Records
22
Agent score
75%

What's inside JamesDSP

  1. Overview of JamesDSP Features

    master

    JamesDSP is a cross-platform audio effect and Digital Signal Processing library. Key features include:

    • Multiband Dynamic Range Compander: A highly tunable multiband dynamic range booster/reducer.
    • Auto Bass Boost: Frequency detecting bass boost that adjusts gain, bandwidth, and cut-off frequency.
    • Reverb: Uses Progenitor 2 (a complicated IIR network).
    • Equalizers: Supports both Interpolating FIR and IIR equalizers (both yield flat response when gain is uniform).
    • Partitioned Convolver: Supports mono, stereo, and full/true stereo (LL, LR, RL, RR) impulse responses.
    • Live Programmable DSP: Compiles EEL code into opcode for real-time processing. The EEL virtual machine includes advanced math routines (Linear algebra, spectral processing, etc.).
    • Stereo Widen: Enhances stereo soundstage without affecting vocal integrity.
    • Crossfeed: Includes traditional BS2B mode and convolution-based HRTF.
    • Vacuum Tube Modelling: Second harmonic generator.
    • Viper DDC: Cascaded Second-Order Sections Form II IIR filterbank.
  2. Root requirements for JamesDSP Engine development

    master

    Whether root access is required depends on your deployment method:

    1. For testing/development: Yes, your Android device must be rooted to test the audio effect.
    2. For ROM distribution: No, root is not required if you build the engine code directly into an Android ROM source tree.
  3. Install JamesDSP via Automatic Installation

    master

    Automatic installation is supported on devices running up to Android Pie. You can use a custom recovery or Magisk to install the package.

    Methods:

    1. Copy the zip package to your phone, reboot to custom recovery, install the package, and reboot.
    2. Use Magisk manager to install JDSP.

    This method works on most Android devices from Lollipop to Pie.

  4. Build an Android audio effect using the JamesDSP Engine frame

    master

    The JamesDSP Engine frame serves as a starting point for developers to build custom Android audio effects without needing the full Android Open Source Project (AOSP) source code. It provides a framework that supports Android versions from 4.4 (KitKat) up to 10.0 (Q).

    Note: The current repository frame does not contain signal processing code itself; it is a structural template. Developers should use this repository to learn the Android audio framework and integrate their own DSP (Digital Signal Processing) code into the engine.

  5. Install JamesDSP via Manual Installation (Advanced)

    master

    For advanced users, JamesDSP can be installed manually by configuring the system's audio effects configuration file. This method involves adding the library to the system's sound effects directory and updating audio_effects.conf with the specific UUID and path for JamesDSP.

    Note: The effect may be unloaded by the Android system if there is no active audio stream for a period of time.

    # 1. Add to audio_effects.conf
    
    under {
      bundle {
        path /system/lib/soundfx/libbundlewrapper.so
      }
    }
    
    AND {
      jamesdsp {
        library jdsp
        uuid f27317f4-c984-4de6-9a90-545759495bf2
      }
    }
    
    under {
      effects {
        jdsp {
          path /system/lib/soundfx/libjamesdsp.so
        }
      }
    }
    
    # 2. Copy libjamesdsp.so to /system/lib/soundfx
    # 3. Reboot
    # 4. Install APK
  6. Understand the hadamVerb DSP architecture

    master

    The hadamVerb effect implements a dual-array structure using Hadamard matrices to mix signals. It consists of two primary units:

    1. Chorus Unit (h1): Uses a first array of delays modulated by two VLFOs (Variable Low Frequency Oscillators) to create a chorus effect.
    2. Reverb Unit (h2): Uses a second array of delays modulated by two VLFOs to create a reverberation effect.

    Signal Flow:

    • The Chorus unit (h1) takes input from the main signal (spl0, spl1) and feedback from the Reverb unit (h2).
    • The Reverb unit (h2) takes input from the Chorus unit (h1).
    • The final output is a combination of the outputs from both the Reverb unit (h2.y0, h2.y1) and the Chorus unit (h1.y0, h1.x0, etc.), scaled by the gain parameter.

    This architecture creates a complex, interdependent modulation pattern between the chorus and reverb stages.

  7. Format of .vdc DSP parameter files

    master

    A .vdc file is a pre-configured Digital Signal Processing (DSP) parameter file used by JamesDSP. It contains coefficient data mapped to specific sample rates. Each entry follows the pattern SR_[sample_rate]:[comma-separated coefficients].

    When using these files, the system selects the coefficient set that matches the current audio sample rate (e.g., SR_44100 for 44.1kHz or SR_48000 for 48kHz).

  8. Initialize and use the JamesDSP library

    master

    To use JamesDSP in a C/C++ application, you must first allocate global memory, initialize the library with a specific sample rate, and finally free the resources when finished. The library operates on a JamesDSPLib structure which holds the state for all DSP effects.

    Lifecycle:

    1. Call JamesDSPGlobalMemoryAllocation() to prepare global resources.
    2. Allocate memory for a JamesDSPLib instance.
    3. Call JamesDSPInit(jdsp, device_id, sample_rate) to initialize the instance.
    4. Perform DSP operations.
    5. Call JamesDSPFree(jdsp) to clean up the instance.
    6. Call JamesDSPGlobalMemoryDeallocation() to clean up global resources.
    JamesDSPGlobalMemoryAllocation();
    JamesDSPLib *jdsp = (JamesDSPLib *)malloc(sizeof(JamesDSPLib));
    memset(jdsp, 0, sizeof(JamesDSPLib));
    
    // Initialize with device ID 77 and sample rate 44100
    JamesDSPInit(jdsp, 77, 44100);
    
    // ... perform DSP tasks ...
    
    JamesDSPFree(jdsp);
    JamesDSPGlobalMemoryDeallocation();
    free(jdsp);
  9. Configure the hadamVerb effect parameters

    master

    The hadamVerb (Hadamard Variable Delay Array) effect is controlled via several sliders that manage delay times, feedback, modulation, and gain. These parameters can be mapped to the following internal controls:

    SliderParameterRangeDefault
    slider1Base Delay (s)0.01 to 10.2
    slider4Fb 1 (Feedback 1)0 to 52
    slider5Fb 2 (Feedback 2)0 to 52
    slider8VLFO cycle A0 to 6030
    slider9B (VLFO cycle B)0 to 6020
    slider12Factor between arrays1 to 2010
    slider14Modulation depth0 to 0.50.01
    slider20Gain (dB)-24 to 240
  10. License information for the JamesDSP Engine frame

    master

    All code located within the Tutorials/ folder is distributed under the Apache License.

    Important: This is distinct from the main repository, which uses the GNU license. The GNU license of the main repository does not apply to the contents of this folder.