Commit Graph

182 Commits

Author SHA1 Message Date
Alex P d4c10aef87 Updates: use uint64 since we won't have negative numbers here 2025-09-09 21:37:08 +00:00
Alex P eca1e6a80d Cleanup: implement PR Review suggestions 2025-09-09 18:09:19 +00:00
Alex P 02acee0c75 Fix: Audio Output Enable / Disable 2025-09-09 10:39:47 +00:00
Alex P 0f2aa9abe4 feat(audio): improve socket handling and validation performance
- Add retry logic for socket file removal and listener creation
- Optimize message writing by combining header and data writes
- Move socket paths from temp dir to /var/run
- Refactor OPUS parameter lookup to use map for better readability
- Simplify validation functions for better performance in hotpaths
2025-09-09 10:16:53 +00:00
Alex P 5d4f4d8e10 UX Improvement: keep Mic state accross page refreshes 2025-09-09 09:43:39 +00:00
Alex P a5d1ef1225 refactor(audio): optimize performance and simplify code
- Replace mutex locks with atomic operations for counters
- Remove redundant logging calls to reduce overhead
- Simplify error handling and buffer validation
- Add exponential backoff for audio relay stability
- Streamline CGO audio operations for hotpath optimization
2025-09-09 09:12:05 +00:00
Alex P bda92b4a62 [Milestone] Fix: in-flight audio input quality updates 2025-09-09 08:56:24 +00:00
Alex P 3c6184d0e8 [Milestone] Improvement: In-flight audio output quality update 2025-09-09 07:44:37 +00:00
Alex P 2bc7e50391 [WIP] Cleanup, Refactor: Reduce PR complexity, common IPC layer 2025-09-09 07:08:32 +00:00
Alex P f71d18039b [WIP] Cleanup: reduce PR complexity 2025-09-09 06:59:55 +00:00
Alex P 00e5148eef [WIP] Cleanup: reduce PR complexity 2025-09-09 06:52:40 +00:00
Alex P 0ebfc762f7 [WIP] Cleanup: PR SImplification 2025-09-09 05:41:20 +00:00
Alex P 845eadec18 [WIP] Fix: Audio Latency issues: move audio to a dedicated media stream
For more details please see: https://groups.google.com/g/discuss-webrtc/c/ZvAHvkHsb0E
2025-09-09 00:23:15 +00:00
Alex P aa21b4b459 Updates: increase congestion treshold multiplier 2025-09-08 22:58:49 +00:00
Alex P 89e68f5cdb [WIP] Change playback latency spikes on Audio Output Quality changes 2025-09-08 22:55:19 +00:00
Alex P f873b50469 fix(audio): adjust congestion and CPU thresholds for single-core system
Update congestion threshold multiplier and CPU thresholds to better suit single-core ARM RV1106G3 processor characteristics. Adjust memory thresholds for systems with 200MB total memory.
2025-09-08 22:03:11 +00:00
Alex P 0893eb88ac feat(audio): improve reliability with graceful degradation and async updates
- Implement graceful degradation for congestion handling with configurable thresholds
- Refactor audio relay track updates to be async to prevent deadlocks
- Add timeout-based supervisor stop during quality changes
- Optimize buffer pool configuration and cleanup strategies
2025-09-08 21:47:39 +00:00
Alex P 8cf0b639af perf(audio): increase buffer sizes and timeouts for quality change bursts
Significantly increase message pool, channel buffer, and adaptive buffer sizes to better handle quality change bursts. Adjust timeouts and intervals for improved responsiveness.
2025-09-08 21:17:06 +00:00
Alex P 6f10010d71 refactor(audio): remove redundant config variable assignments
Replace repeated local config variable assignments with direct Config access
to reduce memory allocations and improve code maintainability
2025-09-08 21:04:07 +00:00
Alex P 1d1658db15 refactor(audio): replace GetConfig() calls with direct Config access
This change replaces all instances of GetConfig() function calls with direct access to the Config variable throughout the audio package. The modification improves performance by eliminating function call overhead and simplifies the codebase by removing unnecessary indirection.

The commit also includes minor optimizations in validation logic and connection handling, while maintaining all existing functionality. Error handling remains robust with appropriate fallbacks when config values are not available.

Additional improvements include:
- Enhanced connection health monitoring in UnifiedAudioClient
- Optimized validation functions using cached config values
- Reduced memory allocations in hot paths
- Improved error recovery during quality changes
2025-09-08 17:30:49 +00:00
Alex P 91f9dba4c6 feat(audio): improve audio quality handling and recovery mechanisms
- Add server stats reset and frame drop recovery functions
- Implement global audio server instance management
- Add WebRTC audio track replacement capability
- Improve audio relay initialization with retry logic
- Enhance quality change handling with adaptive buffer management
- Add global helper functions for audio quality control
2025-09-08 12:48:22 +00:00
Alex P df58e04846 feat(audio): implement zero-copy batch processing with reference counting
Add batch reference counting and zero-copy frame management for optimized audio processing. Includes:
- BatchReferenceManager for efficient reference counting
- ZeroCopyFrameSlice utilities for frame management
- BatchZeroCopyProcessor for high-performance batch operations
- Adaptive optimization interval based on stability metrics
- Improved memory management with zero-copy frames
2025-09-08 09:08:07 +00:00
Alex P 323d2587b7 refactor(audio): improve memory management with atomic operations and chunk allocation
- Replace mutex-protected refCount with atomic operations in ZeroCopyFramePool
- Implement chunk-based allocation in AudioBufferPool to reduce allocations
- Add proper reference counting with atomic operations in ZeroCopyAudioFrame
- Optimize buffer pool sizing based on buffer size
2025-09-08 08:25:42 +00:00
Alex P a6913bf33b perf(audio): make refCount operations atomic and optimize frame pooling
Replace mutex-protected refCount operations with atomic operations to improve performance in concurrent scenarios.
Simplify frame release logic and add hitCount metric for pool usage tracking.
2025-09-08 08:20:43 +00:00
Alex P 6890f17a54 refactor(audio): consolidate supervision logic into base implementation
Move common supervision loop logic to BaseSupervisor with configurable parameters
Simplify input/output supervisor implementations by using base template
Update function comments to be more concise
2025-09-08 05:53:06 +00:00
Alex P a2a87b46b8 refactor(audio): move channel and process management to base supervisor
Consolidate duplicate channel and process management code from input/output supervisors into BaseSupervisor
Add new methods for channel initialization and cleanup
Standardize process termination and monitoring behavior
2025-09-07 20:14:33 +00:00
Alex P 96a6a0f8f9 refactor(audio): improve process management and error handling
- Remove unused setRunning method from BaseSupervisor
- Refactor IPC input reader to use running flag and mutex
- Add atomic state management to InputSupervisor
- Implement proper channel cleanup and process termination
- Improve error handling and logging throughout
2025-09-07 19:35:14 +00:00
Alex P bfdbbdc557 [WIP] Simplification 2025-09-07 19:13:35 +00:00
Alex P e3b4bb2002 refactor(audio): replace mute functionality with start/stop for microphone
- Replace MuteMicrophone calls with StartMicrophone/StopMicrophone for clearer behavior
- Update microphone state broadcasting to reflect actual subprocess status
- Modify UI to use enable/disable terminology instead of mute/unmute
- Ensure microphone device changes properly restart the active microphone
2025-09-07 18:32:42 +00:00
Alex P 7d39a2741e [WIP] Improvements: improve Audio Input Activation / Deactivation process so it is faster 2025-09-07 16:17:06 +00:00
Alex P b267348084 feat(audio): add microphone stop endpoint and improve mute handling
- Implement new POST /microphone/stop endpoint
- Refactor mute handling to properly start/stop audio processes
- Add callback mechanism for audio relay to reconnect to current session
- Simplify UI microphone controls by combining mute/start-stop functionality
2025-09-06 20:17:29 +00:00
Alex P 5a0dce9984 Fix: Microphone & audio on page load, PID field parsing in audio input supervisor 2025-09-06 06:11:29 +00:00
Alex P d3e2b2dff2 fix(audio): correct mute state broadcast in audio control service
Use BroadcastAudioMuteChanged instead of BroadcastAudioDeviceChanged to properly reflect mute state changes
2025-09-05 22:10:14 +00:00
Alex P 947b4f9528 [WIP] Updates: Reduce PR complexity 2025-09-05 21:47:21 +00:00
Alex P 8a189ba1b9 [WIP] Updates / FIles reorg: reduce PR complexity 2025-09-05 21:34:23 +00:00
Alex P d3bbe1bf0a refactor(audio): standardize component logging names and cleanup
- Add component name constants for consistent logging across audio modules
- Remove redundant debug logs and outdated comments
- Delete obsolete naming standards documentation file
2025-09-05 21:12:17 +00:00
Alex P e45bec4a9c Fix: currently selected preset not coming from the API 2025-09-05 17:33:13 +00:00
Alex P 2c2f2d416b Refactoring: Move most audio business logic into the audio package 2025-09-05 17:22:14 +00:00
Alex P fcd07b2b59 perf(audio): enhance buffer pool performance with adaptive caching
- Increase goroutine cache size from 4 to 8 buffers for better hit rates
- Add adaptive resize and cache warmup based on usage patterns
- Implement enhanced cleanup with size limits and better TTL management
- Optimize buffer clearing and preallocation strategies
2025-09-05 13:53:00 +00:00
Alex P 1a0c7a84bc refactor(audio): rename latency config fields for clarity
Update config field names to better reflect their specific usage contexts in adaptive buffer and optimizer components. This improves code maintainability by making the purpose of each latency target more explicit.
2025-09-05 12:27:35 +00:00
Alex P 463f34e40b Fix: audio output not working due to too agressive timeout 2025-09-05 12:04:38 +00:00
Alex P 4075057c2b [WIP] Cleanup: Reduce PR Complexity 2025-09-04 22:06:48 +00:00
Alex P c1cc8dd832 refactor(audio): remove audio input subprocess pre-warming feature
The pre-warming feature was removed to simplify the audio input supervisor implementation. This feature added complexity and was not providing significant latency improvements in practice.
2025-09-04 19:48:38 +00:00
Alex P c40459664f Audio Input resiliency. Make sure the IPC client always recovers 2025-09-04 10:51:07 +00:00
Alex P cdf6731639 [WIP] Performance Updates:
Add LSB depth parameter for improved bit allocation and disable MMAP access for compatibility.
Adjust buffer sizing logic to better handle constrained environments while maintaining stability.
2025-09-04 08:47:40 +00:00
Alex P b63404c26b [WIP] Cleanup: reduce PR complexity 2025-09-03 23:50:05 +00:00
Alex P b497444d6d [WIP] Cleanup: reduce PR complexity 2025-09-03 23:13:36 +00:00
Alex P 476a245598 [WIP] Cleanup: Reduce PR complexity 2025-09-03 23:01:08 +00:00
Alex P 5dc04321a1 [WIP] Cleanup: decrease PR complexity 2025-09-03 22:48:25 +00:00
Alex P a3702dadd9 Cleanup: reduce PR complexity 2025-09-03 22:35:52 +00:00
Alex P 2568660149 feat(metrics): add configurable metrics collection and performance optimizations
- Add config flags to enable/disable metrics collection, goroutine monitoring, and latency profiling
- Optimize batch processor with configurable queue sizes and thread pinning thresholds
- Skip metrics operations when disabled to reduce overhead
- Update default config with performance-related settings
2025-09-03 20:18:07 +00:00
Alex P ca365f1acd feat(audio): add subprocess pre-warming to reduce activation latency
implement batched metrics updates to reduce atomic operations
optimize thread locking for high-throughput scenarios only
2025-09-03 19:51:18 +00:00
Alex P 5c55da0787 perf(audio): optimize metrics collection and logging overhead
- Replace direct atomic updates with sampling to reduce contention
- Simplify metrics tracking by removing buffering and using direct updates
- Optimize logging by adding level checks and sampling
- Improve validation performance using cached config values
2025-09-03 19:41:20 +00:00
Alex P 260f62efc3 perf(audio): optimize audio processing paths and reduce overhead
- Replace CGO function variable aliases with direct function calls to eliminate indirection
- Simplify audio frame validation by using cached max size and removing error formatting
- Optimize buffer pool operations by removing metrics collection and streamlining cache access
- Improve batch audio processor by pre-calculating values and reducing config lookups
- Streamline IPC message processing with inline validation and reduced error logging
2025-09-03 17:51:08 +00:00
Alex P a741f05829 fix(audio): add proper locking for config cache updates
Add mutex locking around config cache expiration checks to prevent race conditions. The cache now properly checks initialization status before attempting updates.
2025-09-03 17:08:19 +00:00
Alex P a557987629 perf(audio): optimize hotpath by removing redundant checks and logging
- Skip logging in frame validation to reduce overhead
- Only update cache when expired to avoid unnecessary operations
- Remove duplicate config caching system and simplify buffer handling
- Optimize batch processing with pre-allocated buffers and conditional time tracking
2025-09-03 16:55:39 +00:00
Alex P 5353c1cab2 perf(audio): optimize opus decode-write with separate buffers
- 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
2025-09-03 16:28:25 +00:00
Alex P 370178e43b fix(audio): remove arm architecture restriction from cgo build tags 2025-09-03 15:49:07 +00:00
Alex P 9f1dd28ad6 feat(audio): add batch write processing and improve thread management
- 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
2025-09-03 15:21:35 +00:00
Alex P 2ab90e76e0 feat(audio): add validation cache fields to AudioConfigCache
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
2025-09-03 14:48:41 +00:00
Alex P 1b7198aec2 feat(audio): implement sized buffer pool and config caching
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
2025-09-03 14:00:12 +00:00
Alex P f9781f170c perf(audio): increase worker pool sizes and optimize worker management
Double worker counts and queue sizes to handle higher load scenarios
Modify worker management to maintain minimum 2 persistent workers with longer idle timeout
2025-09-03 12:54:07 +00:00
Alex P d7b67e5012 feat(audio): implement goroutine pool for task processing
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
2025-09-03 12:41:27 +00:00
Alex P 8110be6cc6 feat(audio): optimize audio processing with batch processing and goroutine monitoring
- Add batch audio processing to reduce CGO call overhead
- Implement goroutine monitoring and cleanup for leak prevention
- Optimize buffer pool with TTL-based cache and latency-aware cleanup
- Add configurable parameters for batch processing and monitoring
- Improve CGO audio read performance with config caching
2025-09-03 12:10:54 +00:00
Alex P 950ca2bd99 fix(audio): improve process termination handling in input supervisor
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.
2025-09-01 11:08:13 +00:00
Alex P dfbf9249b9 fix(audio): improve audio initialization and process termination handling
- Add retry logic for CGO audio initialization
- Enhance process termination checks in input supervisor
- Skip initialization check in cgo_audio to avoid compilation issues
- Add proper error handling for audio system initialization failures
2025-09-01 10:24:26 +00:00
Alex P f51f6da2de fix(audio): improve logging for Opus config and subprocess status
Add detailed logging when sending Opus configuration to audio input subprocess
Include supervisor running status in log when subprocess is not connected
2025-09-01 08:07:53 +00:00
Alex P fd7608384a feat(audio): implement dynamic Opus config updates and optimize audio params
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.
2025-09-01 08:02:43 +00:00
Alex P 6adcc26ff2 feat(audio): add goroutine cache cleanup and process reuse
Implement periodic cleanup of stale goroutine buffer caches to prevent memory leaks
Add ability to detect and reuse existing audio input server processes
2025-08-29 17:05:37 +00:00
Alex P 858859e317 perf(audio): optimize audio config for RV1106 SoC compatibility
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.
2025-08-28 22:25:11 +00:00
Alex P 9c0aff4489 feat(audio): implement audio input supervisor and opus config management
add audio input supervisor with opus configuration support
update audio quality presets and configuration handling
restructure audio subprocess management with environment variables
2025-08-28 22:02:22 +00:00
Alex P 0d4176cf98 refactor(audio): centralize metrics collection with new registry
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
2025-08-28 10:01:35 +00:00
Alex P fe4571956d refactor(audio): remove granular latency metrics and histogram functionality
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
2025-08-28 08:44:09 +00:00
Alex P f9adb4382d feat(audio): add latency metrics collection for input and output
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.
2025-08-28 00:35:51 +00:00
Alex P 758bbbfff6 feat(audio): add latency histogram metrics collection and visualization
- 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
2025-08-28 00:24:30 +00:00
Alex P 3efe2f2a1d refactor(audio/validation): improve frame data validation with specific error messages
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.
2025-08-27 23:54:40 +00:00
Alex P ece36ce5fd feat(audio): optimize validation and add dynamic opus encoder configuration
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.
2025-08-27 23:44:16 +00:00
Alex P cdf0b20bc7 perf(audio): optimize validation and buffer pool with caching
- Cache max frame size in validation for hot path performance
- Add lock-free per-goroutine buffer cache to reduce contention
2025-08-27 22:57:07 +00:00
Alex P 25363cef90 perf(audio): replace frame validation with ultra-fast version
Use ValidateAudioFrameUltraFast in critical audio paths to reduce processing overhead
Reduce minimum frame size to 1 byte to allow smaller frames
2025-08-27 22:44:34 +00:00
Alex P e3e7b898b5 style(audio): fix formatting and add missing newlines
- Fix indentation and alignment in performance tests
- Add missing newlines at end of files
- Clean up error message formatting for consistency
2025-08-27 20:54:50 +00:00
Alex P 9dda569523 feat(audio): enhance validation and add logging standards
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
2025-08-27 20:46:47 +00:00
Alex P 6355dd87be feat(audio): add pool hit tracking and optimize buffer management
refactor(ui): extract audio config display and status indicator components
refactor(audio): simplify validation and error handling
refactor(config): remove duplicate audio quality constants
perf(buffer): optimize buffer pool allocation and tracking
docs(audio): streamline package documentation
2025-08-27 19:37:34 +00:00
Alex P 50e04192bf refactor(audio): standardize log levels and messages across components
- 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
2025-08-27 18:11:06 +00:00
Alex P dc2db8ed2d feat(audio): add comprehensive input validation and base components
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
2025-08-27 17:47:39 +00:00
Alex P 8fb0b9f9c6 feat(audio): centralize audio configuration and improve debugging
- Add debug utilities with development-only logging
- Create centralized audio configuration constants
- Implement audio quality service for managing presets
- Replace console logging with debug utilities
- Update audio metrics with unified structure
- Improve microphone error handling and state management
2025-08-27 13:01:56 +00:00
Alex P e8d12bae4b style(audio): fix formatting and add missing newlines
- 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
2025-08-26 16:49:41 +00:00
Alex P 6a68e23d12 refactor(audio): improve error handling and memory management
- 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
2025-08-26 14:36:07 +00:00
Alex P b1f85db7de feat(audio): enhance error handling and add device health monitoring
- 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
2025-08-26 12:51:11 +00:00
Alex P e4ed2b8fad refactor(audio): rename audio components for clarity and add validation
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.
2025-08-26 10:42:25 +00:00
Alex P fff2d2b791 feat(usbgadget): add nil checks for gadget operations and cleanup tests
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
2025-08-25 22:24:41 +00:00
Alex P 6898a6ef1b feat(audio): add granular metrics collection and comprehensive error handling
- 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
2025-08-25 21:00:54 +00:00
Alex P 34f8829e8a refactor(audio): improve configuration handling and validation
- 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
2025-08-25 20:36:26 +00:00
Alex P 60a6e6c5c5 refactor(audio): centralize config values and improve 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.
2025-08-25 20:35:40 +00:00
Alex P c5216920b3 refactor(audio): centralize config constants and update usage
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
2025-08-25 19:30:57 +00:00
Alex P 9e343b3cc7 refactor(audio): move hardcoded values to config for better flexibility
- 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
2025-08-25 19:02:29 +00:00
Alex P 35a666ed31 refactor(audio): centralize configuration constants in audio module
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
2025-08-25 18:08:12 +00:00
Alex P 7ec583ed6a refactor(audio): centralize config and remove debug logs
- Move hardcoded constants to centralized config system
- Remove verbose debug logging statements
- Clean up unused code and improve error handling
2025-08-25 16:49:48 +00:00
Alex P c89d678963 refactor(audio): remove unused context from audio input manager
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.
2025-08-25 13:53:29 +00:00
Alex P 1a0377bbdf Improvement: automatically resume audio when the audio usb gadget is re-enabled from settings 2025-08-25 12:36:04 +00:00
Alex P f24443e072 Improvement: automatically resume audio when the audio usb gadget is re-enabled from settings 2025-08-25 11:05:42 +00:00