Commit Graph

64 Commits

Author SHA1 Message Date
Alex P b9705f4bac Revert "refactor: use atomic.Pointer for thread-safe inputSource access"
This reverts commit 41345b0527.
2025-11-10 15:42:10 +02:00
Alex P 41345b0527 refactor: use atomic.Pointer for thread-safe inputSource access
- Replace mutex-protected inputSource with atomic.Pointer for lock-free reads
- Eliminate ~100 mutex operations per second in audio packet hot path
- Add defer pattern for safer mutex unlock in enable/disable functions
- Add error logging for audio write failures
- Consolidate Makefile lint commands for brevity
2025-11-08 00:43:09 +02:00
Alex P 4bc60c3f1b Updates: revert VERSION to 0.4.8 2025-10-28 22:36:52 +02:00
Alex P e7e6d7cb9d Updates: bump Makefile VERSION to 0.4.9 2025-10-28 22:32:18 +02:00
Alex P a81544070b Merge branch 'dev' into feat/audio-support
This merge integrates the latest dev branch changes while preserving all
audio support functionality. Key changes include:

- Network stack refactoring: migrated from internal/network to pkg/nmlite
- New NetworkManager architecture with jetdhcpc client
- Function-based config pattern to avoid shared pointer bugs
- Updated UI components for network settings
- GitHub workflow and PR templates

- config.go: Retained AudioOutputSource field in Config struct
- config.go: Kept Audio: true in defaultUsbDevices
- config.go: Set AudioOutputSource: "usb" as default
- config.go: Adopted dev's types.NetworkConfig import path
- config.go: Adopted dev's function-based getDefaultConfig() pattern

1. config.go Config struct: Combined audio fields with dev's network refactoring
2. config.go default config: Adopted dev's function-based pattern while preserving audio defaults
3. ui/src/utils/jsonrpc.ts: Fixed unused error variable in catch block

All linters pass with 0 errors and 0 warnings.
2025-10-17 00:33:32 +03:00
Aveline c775979ccb
feat: refactoring network stack (#878)
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
2025-10-15 18:32:58 +02:00
Alex P bb5634be58 refactor: Remove subprocess audio infrastructure, use CGO-only
Remove all subprocess-based audio code to simplify the audio system and
reduce complexity. Audio now uses CGO in-process mode exclusively.

Changes:
- Remove subprocess mode: Deleted Supervisor, IPCSource, embed.go
- Remove audio mode selection from UI (Settings → Audio)
- Remove audio mode from backend config (AudioMode field)
- Remove JSON-RPC handlers: getAudioMode/setAudioMode
- Remove Makefile targets: build_audio_output/input/binaries
- Remove standalone C binaries: jetkvm_audio_{input,output}.c
- Remove IPC protocol implementation: ipc_protocol.{c,h}
- Remove unused IPC functions from audio_common.{c,h}
- Simplify audio.go: startAudio() instead of startAudioSubprocesses()
- Update all function calls and comments to remove subprocess references
- Add constants to cgo_source.go (ipcMaxFrameSize, ipcMsgTypeOpus)
- Keep update_opus_encoder_params() for potential future runtime config

Benefits:
- Simpler codebase: -1,734 lines of code
- Better performance: No IPC overhead on embedded hardware
- Easier maintenance: Single audio implementation
- Smaller binary: No embedded audio subprocess binaries

The audio system now works exclusively via CGO direct C function calls,
with ALSA device selection (HDMI vs USB) still configurable via settings.
2025-10-07 13:34:03 +03:00
Alex P 7872ddc8fc Refactor: Simplify / rewrite Audio 2025-10-06 21:59:44 +03:00
Alex P 178c7486cc [WIP] Updates: reduce PR complexity 2025-10-01 22:54:37 +03:00
Alex P 6ccd9fdf19 [WIP] Updates: use native C binaries for audio 2025-10-01 20:13:13 +03:00
Alex P ef5c25efcf Updates: integrate all dev branch changes 2025-10-01 15:50:39 +03:00
Alex P bdcac6a468 [WIP] Updates: update build flows to work with the CGO jetkvm_native 2025-10-01 10:04:42 +03:00
Alex P 160a925f40 Merge branch 'dev' into feat/audio-support 2025-09-30 20:08:33 +00:00
Aveline 657a177462
feat: jetkvm native in cGo 2025-09-29 14:09:30 +02:00
Alex P dcce0fefb7 Merge branch 'dev' into feat/audio-support 2025-09-26 12:53:23 +00:00
Aveline 359778967f
chore: remove msgpack from gin dependency (#833) 2025-09-26 08:52:07 +02:00
Siyuan Miao fe77acd5f0 chore: bump to 0.4.8 2025-09-22 12:51:19 +02:00
Alex P 1dbc6c9d06 [WIP] Cleanup: PR cleanup 2025-09-19 23:53:40 +03:00
Alex P 3e24a3c186 Merge branch 'dev' into feat/audio-support 2025-09-19 12:41:46 +00:00
Siyuan Miao 1ffdca4fd6 build: use immediate assignment for VERSION_DEV and other vars 2025-09-18 15:41:39 +02:00
Siyuan Miao c6dba4d59f chore: bump to 0.4.7 2025-09-18 13:53:08 +02:00
Alex P 140a803ccf perf(audio): add ARM NEON SIMD optimizations for audio processing
Implement SIMD-optimized audio operations using ARM NEON for Cortex-A7 targets
Update Makefile and CI configuration to support NEON compilation flags
Add SIMD implementations for common audio operations including:
- Sample clearing and interleaving
- Volume scaling and format conversion
- Channel manipulation and balance adjustment
- Endianness swapping and prefetching
2025-09-16 18:18:19 +00:00
Alex P b040b8feaf [WIP] Optimizations: Optimize audio system 2025-09-15 21:22:02 +00:00
Alex P 0eaad6ba16 Merge branch 'dev' into feat/audio-support 2025-09-13 06:35:25 +00:00
Alex P 557aa5891a Cleanup: Simplify Makefile by exporting all needed env vars at the top 2025-09-12 09:47:11 +00:00
Alex P 49d62f8eb0 Cleanup: only set PKG_CONFIG_PATH once 2025-09-12 09:22:14 +00:00
Alex P 9e4392127e Fix: add accidentally removed test file back, devcontainer build process on clean devcontainer 2025-09-12 09:10:31 +00:00
Marc Brooks ca8b06f4cf
chore: enhance the gzip and cacheable handling of static files
Add SVG and ICO to cacheable files.
Emit robots.txt directly.
Recognize WOFF2 (font) files as assets (so the get the immutable treatment)
Pre-gzip the entire /static/ directory (not just /static/assets/) and include SVG, ICO, and HTML files
Ensure fonts.css is processed by vite/rollup so that the preload and css reference the same immutable files (which get long-cached with hashes)
Add CircularXXWeb-Black to the preload list as it is used in the hot-path.
Handle system-driven color-scheme changes from dark to light correctly.
2025-09-12 08:41:41 +02:00
Alex P 15baf9323b Merge branch 'dev' into feat/audio-support 2025-09-12 01:18:46 +03:00
Aveline 6202e3cafa
chore: serve pre-compressed static files (#793) 2025-09-11 19:17:15 +02: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
Adam Shiervani 0651faeceb feat: improve custom jiggler settings and add timezone support (#742)
* feat: add timezone support to jiggler and fix custom settings persistence

- Add timezone field to JigglerConfig with comprehensive IANA timezone list
- Fix custom settings not loading current values
- Remove business hours preset, add as examples in custom settings
- Improve error handling for invalid cron expressions

* fix: format jiggler.go with gofmt

* fix: add embedded timezone data and validation

- Import time/tzdata to embed timezone database in binary
- Add timezone validation in runJigglerCronTab() to gracefully fallback to UTC
- Add timezone to debug logging in rpcSetJigglerConfig
- Fixes 'unknown time zone' errors when system lacks timezone data

* refactor: add timezone field comments from jiggler options

* chore: move tzdata to backend

* refactor: fix JigglerSetting linting

- Adjusted useEffect dependency to include send function for better data fetching
- Modified layout classes for improved responsiveness and consistency
- Cleaned up code formatting for better readability

---------

Co-authored-by: Siyuan Miao <i@xswan.net>
2025-08-24 22:54:26 +00:00
Alex P 2082b1a671 refactor(audio): rename audio-server flag to audio-output-server for clarity
docs: update development documentation with new make targets
refactor: simplify audio quality presets implementation
style: remove redundant comments and align error handling
chore: add lint-ui-fix target to Makefile
2025-08-23 12:18:33 +00:00
Alex P 5e28a6c429 feat(audio): add system memory endpoint and process metrics monitoring
- Add new /system/memory endpoint to expose total system memory
- Implement process metrics collection for audio and microphone processes
- Update UI to display real-time process metrics with charts
- Replace environment variable check with CLI flag for audio input server
- Improve audio metrics broadcasting with 1-second intervals
- Add memory usage capping for CPU percentage metrics
2025-08-23 11:41:03 +00:00
Adam Shiervani 8527b1eff1
feat: improve custom jiggler settings and add timezone support (#742)
* feat: add timezone support to jiggler and fix custom settings persistence

- Add timezone field to JigglerConfig with comprehensive IANA timezone list
- Fix custom settings not loading current values
- Remove business hours preset, add as examples in custom settings
- Improve error handling for invalid cron expressions

* fix: format jiggler.go with gofmt

* fix: add embedded timezone data and validation

- Import time/tzdata to embed timezone database in binary
- Add timezone validation in runJigglerCronTab() to gracefully fallback to UTC
- Add timezone to debug logging in rpcSetJigglerConfig
- Fixes 'unknown time zone' errors when system lacks timezone data

* refactor: add timezone field comments from jiggler options

* chore: move tzdata to backend

* refactor: fix JigglerSetting linting

- Adjusted useEffect dependency to include send function for better data fetching
- Modified layout classes for improved responsiveness and consistency
- Cleaned up code formatting for better readability

---------

Co-authored-by: Siyuan Miao <i@xswan.net>
2025-08-19 16:50:42 +02:00
Alex P 4688f9e6ca perf(build): add ARM Cortex-A7 optimization flags for audio builds
Add compiler optimization flags targeting ARM Cortex-A7 with NEON support
to improve performance of audio library builds and Go binaries. The flags
enable vectorization, fast math, and loop unrolling for better execution
speed on the target hardware.
2025-08-12 11:20:19 +00:00
Alex P a9a92c52ab feat(rpc): optimize input handling with direct path for performance
perf(audio): make audio library versions configurable in build

test(input): add comprehensive tests for input RPC validation
2025-08-12 10:56:09 +00:00
Alex P 4f47d62079 [#315] Updates: add advanced audio support 2025-08-02 02:23:37 +00:00
Siyuan Miao bde0a086ab chore: bump to 0.4.7 2025-07-03 19:03:46 +02:00
Siyuan Miao fe127ed41c chore: bump version to 0.4.6 2025-06-25 13:28:09 +02:00
Caedis a1ed28c676
build: allow the versions in the Makefile to be overwritten with ENV variables (#619) 2025-06-16 11:30:57 +02:00
Siyuan Miao 772527849f chore: bump version to 0.4.4 2025-06-13 00:51:09 +02:00
Aveline b822b73a03
chore: use pure Go resolver and remove CGO_ENABLED=0 (#603) 2025-06-12 14:04:51 +02:00
Siyuan Miao 3cc119c646 chore: bump version to 0.4.3 2025-06-12 09:35:34 +02:00
Aveline c494cf26ef
chore: disable cgo (#601) 2025-06-12 09:29:31 +02:00
Siyuan Miao 0cee284561 chore: bump version to 0.4.1 2025-05-22 11:17:00 +02:00
Siyuan Miao a60e1a5e98 chore: bump version to 0.4.0 2025-05-20 20:38:00 +02:00
Siyuan Miao 4e90883bf8 build: enable trimpath for both dev and prod releases 2025-05-20 20:28:40 +02:00
Siyuan Miao 354941b54d build: add trimpath to go build command 2025-05-20 20:18:21 +02:00
Aveline 5ba08de566
fix: unit test not returning error when test fails
* fix: unit test not returning error when test fails

* chore: add unit test to smoketest.yml

* fix: make linter happy
2025-05-19 22:51:11 +02:00