Commit Graph

443 Commits

Author SHA1 Message Date
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 e27f1cfa59 fix(AudioControlPopover): swap mute button theme and labels for clarity & consistency 2025-09-06 20:37:18 +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 158437352c Fix: quality not updating in the Audio Control Popover when changed 2025-09-05 17:36:43 +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 0a38451c95 feat(audio): add audio handlers and refactor session management
- Extract audio-related handlers into separate file for better organization
- Simplify session creation logic by removing duplicate code paths
- Add new Prometheus metrics for connection monitoring
- Reduce websocket ping interval from 30s to 15s for better responsiveness
2025-09-05 16:30:09 +00:00
Alex P d9072673c0 Updates: merge 'dev' intu 'feat/audio-support' 2025-09-05 15:07:54 +00:00
Alex P 9cb976ab8d Merge branch 'dev' into feat/audio-support 2025-09-05 14:40:23 +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
Aveline bcc307b147
feat: hid rpc channel (#755)
* feat: use hidRpcChannel to save bandwidth

* chore: simplify handshake of hid rpc

* add logs

* chore: add timeout when writing to hid endpoints

* fix issues

* chore: show hid rpc version

* refactor hidrpc marshal / unmarshal

* add queues for keyboard / mouse event

* chore: change logging level of JSONRPC send event to trace

* minor changes related to logging

* fix: nil check

* chore: add comments and remove unused code

* add useMouse

* chore: log msg data only when debug or trace mode

* chore: make tslint happy

* chore: unlock keyboardStateLock before calling onKeysDownChange

* chore: remove keyPressReportApiAvailable

* chore: change version handle

* chore: clean up unused functions

* remove comments
2025-09-04 22:27:56 +02:00
Marc Brooks e8ef82e582
feat(ui) Fix the CapsLock and Shift key for VirtualKeyboard (#779)
* feat(ui) Fix the CapsLock and Shift key for VirtualKeyboard

* PR feedback: Default LED state in store
2025-09-04 22:26:51 +02: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
Marc Brooks 5f3dd89d55
Upgrade vite and react-router (#778)
| Package                           | From | To       |
|----------------------------------|-----------|---------|
react-router                       | ( new ) | 7.8.2 |
react-router-dom             | 6.22.3 | ( del ) |
@vitejs/plugin-react-swc | 3.10.2 | 4.0.1 |
vite                                      | 6.3.5   | 7.1.4 |
2025-09-04 12:20:01 +02:00
Marc Brooks 1dda6184da
Bumps recharts to 3.1.2 (#777)
* Upgrade UI packages

| Package                                     | From     | To         |
|-----------------------------------|----------|----------|
| dayjs                                           | 1.1.13   | 1.11.18 |
| react-simple-keyboard               | 3.8.115 | 3.8.119 |
| @types/react                              | 19.1.11 | 19.1.12 |
| @types/react-dom                     | 19.1.8   | 19.1.9   |
|  @types/semver                         | 7.7.0      | 7.7.1    |
| @types/validator                        | 13.15.2 | 13.15.3 |
| @typescript-eslint/eslint-plugin | 8.41.0   | 8.42.0   |
| @typescript-eslint/parser           | 8.41.0   | 8.42.0   |

Also fixed lint warning about the missing autocomplete on the password field

* Upgrade recharts to 3.1.2

This is a major version jump, builds and runs correctly
2025-09-04 12:07:19 +02:00
Marc Brooks 825d0311d6
Upgrade UI packages (#776)
| Package                                     | From     | To         |
|-----------------------------------|----------|----------|
| dayjs                                           | 1.1.13   | 1.11.18 |
| react-simple-keyboard               | 3.8.115 | 3.8.119 |
| @types/react                              | 19.1.11 | 19.1.12 |
| @types/react-dom                     | 19.1.8   | 19.1.9   |
|  @types/semver                         | 7.7.0      | 7.7.1    |
| @types/validator                        | 13.15.2 | 13.15.3 |
| @typescript-eslint/eslint-plugin | 8.41.0   | 8.42.0   |
| @typescript-eslint/parser           | 8.41.0   | 8.42.0   |

Also fixed lint warning about the missing autocomplete on the password field
2025-09-04 12:02:59 +02:00
Aveline f3fe78af5d
chore: upgrade deps (#780) 2025-09-04 11:40:49 +02:00
dependabot[bot] d0b3781aaa
build(deps): bump actions/checkout from 4 to 5 (#759)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 11:19:00 +02: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 6f15fdf965 perf(build): update ARM optimization flags for better compatibility
Replace -mcpu with -mtune in compiler flags to improve binary compatibility
while maintaining performance for Cortex-A7 targets
2025-09-04 08:25:16 +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
Adam Shiervani c68e15bf89
Clean up Virtual Keyboard styling (#761)
* Clean up Virtual Keyboard styling

Make the header a bit taller
Add keyboard layout name to header
Make the detached keyboard render smaller key text so you can read them.
Updated the settings text for keyboard layout.

* Add the key graphics and missing keys

* style(ui): add cursor-pointer class to Button component for better UX

* refactor(ui): Improve header styling and detach bug

- Remove unused AttachIcon and related SVG asset.
- Replace icon usage with a styled LinkButton to improve consistency.
- Simplify and reformat VirtualKeyboard component for better readability.

* refactor(ui): Hide keyboard layout settings on mobile and fix minor styling

---------

Co-authored-by: Marc Brooks <IDisposable@gmail.com>
2025-09-03 11:33:07 +02: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