- Add PCM buffer pool and config for optimized decode-write operations
- Implement separate buffer handling in CGO audio processing
- Update batch processor to support both legacy and optimized paths
- Add batch write processing functionality to match existing read processing
- Improve thread pinning logic with separate controls for read/write
- Add new batch processing configuration parameters
- Update build tags to exclude arm architecture
Add atomic fields to AudioConfigCache for validation parameters to enable lock-free access
Optimize validation functions to use cached values for common cases
Move AudioFrameBatch to separate file and update validation logic
Add SizedBufferPool for efficient memory management with size tracking and statistics
Introduce AudioConfigCache to minimize GetConfig() calls in hot paths
Add batch processing support for audio frames to reduce CGO overhead
Extend AudioBufferPoolDetailedStats with total bytes and average size metrics
Add goroutine pool implementation to manage reusable workers for audio processing tasks
Add configuration constants for pool sizing and behavior
Modify audio server components to use pool for goroutine management
Add fallback to direct goroutine creation when pools are full
Add more robust process state checking and error handling during audio input server shutdown. Use signal 0 to verify process existence before killing and handle various edge cases. Also improve logging to better track shutdown outcomes.
Add detailed logging when sending Opus configuration to audio input subprocess
Include supervisor running status in log when subprocess is not connected
Add support for dynamic Opus encoder configuration updates without requiring subprocess restart. This allows quality changes to be applied immediately while maintaining audio stream continuity.
Optimize audio quality parameters to reduce CPU load and prevent mouse lag on RV1106 devices. Lower bitrates and complexity while adjusting signal types and bandwidths for better performance.
Add build tags for CGO requirements and improve audio input supervisor behavior to check for existing processes before starting new ones.
Implement periodic cleanup of stale goroutine buffer caches to prevent memory leaks
Add ability to detect and reuse existing audio input server processes
Adjust bitrates, frame sizes, and OPUS parameters to balance quality and performance on RV1106. Reduce channel count for low quality to minimize CPU load. Update CGO constants for better memory efficiency.
add audio input supervisor with opus configuration support
update audio quality presets and configuration handling
restructure audio subprocess management with environment variables
Introduce MetricsRegistry to serve as single source of truth for audio metrics
Remove duplicate metrics collection logic from web endpoints
Add callback mechanism for metrics updates
This commit removes the granular latency metrics collection and histogram visualization functionality across the codebase. The changes include:
- Removing latency histogram tracking from audio input/output processing
- Removing latency histogram UI components and related types
- Removing granular metrics collector's latency tracking capabilities
- Updating Prometheus metrics to use milliseconds instead of seconds
- Removing related tests and benchmarks
Add granular metrics collection for audio processing latency in both input and output paths. This enables better performance monitoring through histograms.
Also update build tags to include ARM platform and rename UI label for clarity.
- Add LatencyHistogramData interface and implement histogram collection in granular metrics
- Create LatencyHistogram component for visualizing latency distribution
- Update audio metrics events to include histogram data
- Add comprehensive tests for histogram functionality
- Improve error handling for OPUS encoder parameter updates
- Optimize validation cache initialization
Split generic frame data validation error into specific cases for empty and oversized frames to provide better error context. The optimized validation maintains performance while improving debuggability.
Consolidate audio frame validation functions into a single optimized implementation and add dynamic OPUS encoder parameter updates based on quality settings. Initialize validation cache at startup for consistent performance.
Add latency profiler for end-to-end audio pipeline monitoring. Update test cases to use unified validation function and initialize cache.
The changes improve performance by reducing function call overhead and enabling runtime optimization of audio encoding parameters based on quality presets.
refactor validation functions to be more comprehensive and add detailed error messages
add new logging standards implementation for audio components
remove deprecated validation_enhanced.go file
add performance-critical tests for validation functions
Remove advanced metrics toggle and related complex display logic, replacing it with a simplified quick status summary. Also clean up unused imports, state variables, and helper functions.
- Change Info logs to Debug for routine operations
- Standardize log message formatting to lowercase
- Improve error message clarity and consistency
- Add new metrics for device health and memory monitoring
- Simplify config constants documentation
refactor(audio): restructure metrics and supervisor components into base implementations
feat(audio): add validation for all audio configurations and frames
fix(audio): fix atomic alignment in metrics structures
refactor(audio): consolidate common functionality into base manager and supervisor
feat(audio): add output IPC manager and config validation
- Fix indentation in test files and supervisor code
- Add missing newlines at end of files
- Clean up documentation formatting
- Fix buffer pool pointer return type
- remove redundant error logging in audio supervisor stop calls
- add buffer pool for memory optimization in audio relay and ipc
- return default metrics when process is not running
- add channel closed flags to prevent double closing
- standardize component naming and logging
- add comprehensive documentation for audio components
- improve test coverage with new unit tests
- Implement robust error recovery with progressive backoff in audio streaming
- Add comprehensive device health monitoring system
- Improve ALSA device handling with enhanced retry logic
- Refactor IPC message handling to use shared pools
- Add validation utilities for audio frames and configuration
- Introduce atomic utilities for thread-safe metrics tracking
- Update latency histogram to use configurable buckets
- Add documentation for new metrics and configuration options
Rename audio server/client components to be more specific (AudioOutputServer/Client). Add new validation.go and ipc_common.go files for shared IPC functionality. Improve error handling and cleanup in input/output IPC components.
Disable granular metrics logging to reduce log pollution. Reset metrics on failed start and ensure proper cleanup. Add common IPC message interface and optimized message pool for reuse.
refactor(usbgadget): reorganize test files into logical categories
test(usbgadget): add integration tests for audio and usb gadget interactions
fix(dev_deploy): clean up /tmp directory before copying test files
- Implement granular metrics collection for latency and buffer pool operations
- Add detailed error messages with context for all IPC operations
- Enhance logging with additional operational details
- Introduce comprehensive test suite including unit and integration tests
- Add package documentation explaining architecture and components
- Replace hardcoded values with configurable parameters in output streamer
- Add detailed validation rules for socket buffer configuration
- Enhance CPU percent calculation with bounds checking and validation
- Document message format and validation for IPC communication
- Update latency monitor to use configurable thresholds
- Improve adaptive buffer calculations with validation and documentation
Move hardcoded values to config and add detailed validation rules documentation for audio components. Update function comments to clearly describe validation logic and thresholds.
The changes ensure consistent configuration management and better maintainability while providing comprehensive documentation of validation rules and system behavior.
Move hardcoded values to config constants and update all references to use centralized configuration. Includes:
- Audio processing timeouts and intervals
- CGO sleep durations
- Batch processing parameters
- Event formatting and timeouts
- Process monitor calculations
- Replace hardcoded values with configurable parameters in audio components
- Add new config fields for adaptive buffer sizes and frame pool settings
- Implement memory guard in ZeroCopyFramePool to prevent excessive allocations
Replace hardcoded values with centralized config constants for better maintainability and flexibility. This includes sleep durations, buffer sizes, thresholds, and various audio processing parameters.
The changes affect multiple components including buffer pools, latency monitoring, IPC, and audio processing. This refactoring makes it easier to adjust parameters without modifying individual files.
Key changes:
- Replace hardcoded sleep durations with config values
- Centralize buffer sizes and pool configurations
- Move thresholds and limits to config
- Update audio quality presets to use config values
- Add audio device change listener in UI to update USB config
- Implement audio configuration validation before enabling USB audio
- Broadcast audio device change events for all state changes
Simplify AudioInputIPCManager by removing unused context and cancellation logic. The context was not providing any meaningful functionality.
fix(ui): handle audio device changes with proper sync
Add delayed microphone state synchronization when audio devices change to prevent race conditions during USB audio reconfiguration.
Add proper cleanup for both audio input manager and output supervisor when disabling audio
Ensure complete shutdown of audio processes before USB reconfiguration