Commit Graph

605 Commits

Author SHA1 Message Date
Alex P 7442bdc713 Cleanup: reduce drift from dev 2025-10-07 14:00:49 +03:00
Alex P 8caa5fc188 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 eaaada8bcd Merge branch 'feat/dual-audio-mode' into feat/audio-support 2025-10-07 11:26:09 +03:00
Alex P 1caf57ff00 Cleanup: PR Comments 2025-10-07 11:14:16 +03:00
Alex P d84894870c [WIP] Updates: support in-process mode 2025-10-07 11:00:59 +03:00
Alex P d93253cf1b [WIP] Updates: support in-process mode 2025-10-07 10:17:06 +03:00
Alex P 2349f60706 [WIP] Updates: support in-process mode 2025-10-07 10:13:11 +03:00
Alex P 24ca56ba86 [WIP] Updates: support in-process mode 2025-10-07 09:54:48 +03:00
Alex P aa0b4876c4 [WIP] Updates: support in-process mode 2025-10-07 09:51:08 +03:00
Alex P dcc0851f2b [WIP] Updates: support in-process mode 2025-10-07 08:49:49 +03:00
Alex P 6728c492a1 feat: Optimize audio quality and default to USB audio
Audio quality improvements:
- Enable constrained VBR to prevent bitrate starvation at low volumes
- Increase Opus complexity from 2 to 5 for better quality
- Enable DTX for bandwidth optimization
- Enable FEC (Forward Error Correction)
- Add DTX and FEC signaling in SDP (usedtx=1;useinbandfec=1)

Default configuration changes:
- Change default audio output source from HDMI to USB
- Enable USB Audio device by default
- USB audio works on current stable image (HDMI requires newer device tree)

These changes fix crackling issues at low volumes and provide better
overall audio quality for both USB and HDMI audio paths.
2025-10-07 01:38:42 +03:00
Alex P 3b609d2b67 refactor: Simplify audio implementation
Remove dynamic gain code and rely on Opus encoder quality improvements:
- Increase Opus complexity from 2 to 5 for better quality
- Change bandwidth from FULLBAND (20kHz) to SUPERWIDEBAND (16kHz) for better quality at 128kbps
- Disable FEC to allocate all bits to audio quality
- Increase ALSA buffer from 40ms to 80ms for stability

The dynamic gain code was adding complexity without solving the underlying
issue: TC358743 HDMI chip captures digital audio at whatever volume the
source outputs. Users should adjust volume at the source or in their browser.
2025-10-07 00:25:45 +03:00
Alex P 639eecbb93 fix: Add noise gate to prevent amplifying silence artifacts
Add noise gate threshold at peak > 256 (-42dB) to prevent dynamic gain
from amplifying quantization noise and hardware noise floor. This fixes
crackling, buzzing, and static-like noise when HDMI audio is at very
low volume or during silence.

Without the gate, signals below -42dB (peak < 256) would get 8x gain
applied, amplifying noise floor to audible levels. Now these signals
pass through unmodified, eliminating the artifacts.
2025-10-06 22:23:23 +03:00
Alex P e0bdbdd2d2 fix: Replace 'any' with proper React.ChangeEvent type in AudioPopover
Replace 'as any' type assertions with proper React.ChangeEvent<HTMLInputElement>
type for synthetic events passed to audio toggle handlers.
2025-10-06 22:13:21 +03:00
Alex P 8bd370668c fix: Address linting errors in audio code
- Check SetReadDeadline error in IPC client
- Explicitly ignore Kill() error (process may be dead)
- Remove init() function and rely on explicit ExtractEmbeddedBinaries() call
2025-10-06 22:12:20 +03:00
Alex P 78c3dc3a1e Refactor: Simplify / rewrite Audio 2025-10-06 21:59:44 +03:00
Alex P 2aa07e3860 [WIP] Updates: reduce PR complexity 2025-10-02 00:08:42 +03:00
Alex P f5ab13137f [WIP] Updates: reduce PR complexity 2025-10-01 22:58:37 +03:00
Alex P c2d343b0dc [WIP] Updates: reduce PR complexity 2025-10-01 22:54:37 +03:00
Alex P 81134b9b8c [WIP] Updates: reduce PR complexity 2025-10-01 22:21:04 +03:00
Alex P 78a9e6d566 [WIP] Updates: reduce PR complexity 2025-10-01 22:07:45 +03:00
Alex P bf943cc944 [WIP] Updates: reduce PR complexity 2025-10-01 21:20:30 +03:00
Alex P b1b64fc8d2 [WIP] Updates: use native C binaries for audio 2025-10-01 20:13:13 +03:00
Alex P 4e5523d380 Merge branch 'dev' into feat/audio-support 2025-10-01 13:09:03 +00:00
Alex P 7fc363789e Updates: integrate all dev branch changes 2025-10-01 15:50:39 +03:00
Marc Brooks 9438ab7778
Fix the lazy loading for the settings page. (#837)
Move SettingsItem into it's own page

Packages upgraded
@headlessui/react 2.2.8 -> 2.2.9
framer-motion 12.23.18 -> 12/23/22
react-router 7.9.1 -> 7.9.3
@tailwindcss/typography 0.6.18 -> 0.5.19
@types/react 19.1.13 -> 19.1.14
eslint-plugin-react-refresh 0.4.21 -> 0.4.22
2025-10-01 11:43:15 +02:00
Alex P c42432b129 [WIP] Updates: update build flows to work with the CGO jetkvm_native 2025-10-01 10:04:42 +03:00
Alex P 1bb036add4 Merge branch 'dev' into feat/audio-support 2025-09-30 20:08:33 +00:00
Alex P 51a8ed958d Cleanup: remove silence detection 2025-09-30 14:32:36 +00:00
Alex P 186f3cfbe0 [WIP] Cleanup: cleanup audio code after HDMI switch 2025-09-30 13:32:56 +00:00
Alex P 11830e1123 [WIP] Fix: crackling sound when seeking forward after migrating to HDMI Audio 2025-09-30 13:14:15 +00:00
Alex P a0685877bc [WIP] Fix: crackling sound when seeking forwars 2025-09-30 13:11:16 +00:00
Alex P 5d24eba58e [WIP] Fix: crackling sound when seeking forwars 2025-09-30 12:58:49 +00:00
Alex P f891f14152 [WIP] Updates: simplify audio system 2025-09-30 12:36:41 +00:00
Alexander 12d31a3d8e
Add da_DK keyboard Layout (#839) 2025-09-30 14:27:17 +02:00
Alex P 918cdba0b7 Updates: adjust gain to avoid audio artifacts 2025-09-30 12:05:03 +00:00
Alex P 4afaf6023a [WIP] Updates: simplify audio system 2025-09-30 11:41:17 +00:00
Alex P 06399820c4 [WIP] Updates: simplify audio system 2025-09-30 11:03:34 +00:00
Alex P d015542088 [WIP] Updates: simplify audio system 2025-09-30 09:36:19 +00:00
Alex P 36b8f74087 [WIP] Updates: simplify audio system 2025-09-30 09:08:55 +00:00
Alex P c8401cc483 [WIP] Updates: simplify audio system 2025-09-30 09:04:07 +00:00
Aveline 657a177462
feat: jetkvm native in cGo 2025-09-29 14:09:30 +02:00
Alex P 63a6a4a5b1 Merge branch 'dev' into feat/audio-support 2025-09-26 12:53:23 +00:00
Marc Brooks 8f4081a5b1
Cleaning up action versions (#828) 2025-09-26 11:22:17 +02:00
Aveline 359778967f
chore: remove msgpack from gin dependency (#833) 2025-09-26 08:52:07 +02:00
Adam Shiervani 703625d59a
fix: faster paste speed (#824)
* fix: update delay handling in PasteModal component

- Changed default delay value to 20 and adjusted validation to allow values between 0 and 65534.
- Cleaned up code formatting for better readability.

* fix: formatting
2025-09-25 10:26:11 +02:00
Marc Brooks cb24ef6d4f
Update UI dependencies (#819) 2025-09-24 12:16:02 +02:00
Siyuan Miao fe77acd5f0 chore: bump to 0.4.8 2025-09-22 12:51:19 +02:00
Alex P e6a6a1899b [WIP] Improvements, Bugfixes: Improve audio experience when running in HTTP mode 2025-09-21 22:05:19 +00:00
Alex P b33d681383 [WIP] Improvements, Bugfixes: Improve audio experience when running in HTTP mode 2025-09-21 21:20:05 +00:00