Skip to content

Conversation

@BeanRepo
Copy link
Contributor

@BeanRepo BeanRepo commented Nov 27, 2025

Description

Audio Improvements:

  • Fix Mixer Volume Range for Speaker and Microphone
  • Add Low-Latency Configuration args for Speaker

This PR addresses audio issues in real-time synthesis WaveGenerator Brick and improves Speaker configurability.

Changes:

  • Fix Mixer Volume Range: Corrects Speaker volume control to properly map 0-100% to actual hardware mixer ranges, preventing volume setting failures

  • Add Real-Time Audio Configuration:
    Introduces periodsize and queue_maxsize parameters to Speaker peripeheral for optimal latency control:

    • periodsize: Aligns ALSA buffer with generation blocks (eliminates audio glitches in WaveGenerator)
    • queue_maxsize: Controls application queue depth for latency vs stability tradeoff
  • WaveGenerator Enhancements:

    • Auto-configures internal Speaker with optimal real-time settings (periodsize aligned to block_duration)
    • Supports external-defined Speaker instances with ownership pattern and validation warnings
    • Default device changed to USB_SPEAKER_1 for clarity
  • Documentation Updates:

    • READMEs and examples updated to reflect new parameters and external Speaker lifecycle management

Fixes:

  • Audio clipping in theremin app caused by buffer periodsize mismatch between ALSA, Speaker and WaveGenerator buffers.

Tests:

  • All Speaker and WaveGenerator tests passing
  • Real tests on theremin-simulator app passed with 2 available speaker headset.

@BeanRepo BeanRepo changed the title Pub/fix mixer volume range Fix audio clipping and add low-latency Speaker configuration Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant