Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Automatic Gain Control #621

Merged

Commits on Sep 26, 2024

  1. Configuration menu
    Copy the full SHA
    85bfcbd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    625d0f2 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2024

  1. Configuration menu
    Copy the full SHA
    6b62544 View commit details
    Browse the repository at this point in the history
  2. Enhance AGC with asymmetric attack/release and safety limits

    - Implement asymmetric attack/release
    - Introduce MIN_ATTACK_TIME limit to prevent AGC instability
    - Clamp attack_time to prevent instability
    - Faster decrease, slower increase for smoother sound
    - Safeguard against extreme gain fluctuations
    UnknownSuperficialNight committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    611055c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97636d1 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2024

  1. Configuration menu
    Copy the full SHA
    9497f5c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1b27bcd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d9f7967 View commit details
    Browse the repository at this point in the history
  4. Optimize AGC with CircularBuffer and enhance functionality

    - Replace Vec-based RMS calculation with efficient CircularBuffer
    - Add separate release_time for asymmetric gain control
    - Implement MAX_PEAK_LEVEL constant to prevent clipping
    - Revise gain calculation logic:
      • Separate RMS and peak gain calculations
      • Use RMS for general adjustments, peak for limiting
      • Implement smoother transitions between gain levels
      • Improve handling of edge cases (e.g., zero RMS)
    - Improve code organization and documentation
    UnknownSuperficialNight committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    ce3d7e0 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2024

  1. Configuration menu
    Copy the full SHA
    28b3c4b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d4a09f3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f4bb729 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d2a6fd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    beeacf6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9bf97ac View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2024

  1. Enhance AGC stability and flexibility

    - Increase RMS_WINDOW_SIZE for more stable measurements of very low frequencies
    - Replace MIN_ATTACK_COEFF with release_coeff for improved customizability
    
    These changes provide better handling of low-frequency content and allow
    developers more control over AGC behavior, particularly in attack/release
    time adjustments.
    UnknownSuperficialNight committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    a8a443b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68e1bd2 View commit details
    Browse the repository at this point in the history
  3. Add real-time toggle for AGC processing

    Implement get_agc_control() to allow dynamic enabling/disabling of AGC
    during audio playback.
    UnknownSuperficialNight committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    2442aa0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b59533e View commit details
    Browse the repository at this point in the history
  5. Enhance automatic_gain_control documentation

    - Add references to get_agc_control method in automatic_gain_control docs
    - Include a quick start example demonstrating usage of get_agc_control
    UnknownSuperficialNight committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    42fe832 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2024

  1. Refactor CircularBuffer to use heap allocation to avoid large stack u…

    …sage
    
    - Updated CircularBuffer implementation to allocate on the heap instead of the stack to prevent excessive stack usage (32KB) which can lead to stack overflow issues.
    - Optimized index wrapping logic using bitwise operations, leveraging the fact that RMS_WINDOW_SIZE is a power of two for improved efficiency.
    UnknownSuperficialNight committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    86cb156 View commit details
    Browse the repository at this point in the history
  2. Implement thread-safe parameter control for AGC using AtomicF32

    - Replace static parameters with AtomicF32 for thread-safe access
    - Add methods to get Arc<AtomicF32> for release_coeff, attack_coeff, absolute_max_gain, and target_level
    - Enable real-time modification of AGC parameters during playback
    - Use Ordering::Relaxed for optimal low-latency performance
    - Remove set_* methods in favor of direct atomic access
    - Update internal methods to use atomic loads consistently
    
    This change allows for dynamic adjustment of AGC parameters
    without interrupting audio playback, improving real-time control
    and responsiveness of the Automatic Gain Control system.
    UnknownSuperficialNight committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    3e4bf8b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cb85bce View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    db0bfb0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3ce64ef View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fd94703 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e2ee86e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ef60286 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    af210a6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2610a27 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2024

  1. Configuration menu
    Copy the full SHA
    f8cf3c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5ce1fff View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bdbc159 View commit details
    Browse the repository at this point in the history