Commit Graph

604 Commits

Author SHA1 Message Date
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 1bca60ae6b Merge branch 'feat/dual-audio-mode' into feat/audio-support 2025-10-07 11:26:09 +03:00
Alex P dd09cbcdc3 Cleanup: PR Comments 2025-10-07 11:14:16 +03:00
Alex P 035ba4c35f [WIP] Updates: support in-process mode 2025-10-07 11:00:59 +03:00
Alex P 00b8da45d9 [WIP] Updates: support in-process mode 2025-10-07 10:17:06 +03:00
Alex P 9abb2aa026 [WIP] Updates: support in-process mode 2025-10-07 10:13:11 +03:00
Alex P 0f16e0b11a [WIP] Updates: support in-process mode 2025-10-07 09:54:48 +03:00
Alex P 9d7fd878a1 [WIP] Updates: support in-process mode 2025-10-07 09:51:08 +03:00
Alex P 58fad71112 [WIP] Updates: support in-process mode 2025-10-07 08:49:49 +03:00
Alex P 9c72db913b 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 19fe908426 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 04dd37f58f 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 5158c89103 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 141e2f9099 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 7872ddc8fc Refactor: Simplify / rewrite Audio 2025-10-06 21:59:44 +03:00
Alex P 67447e4e5e [WIP] Updates: reduce PR complexity 2025-10-02 00:08:42 +03:00
Alex P c8e220334d [WIP] Updates: reduce PR complexity 2025-10-01 22:58:37 +03:00
Alex P 178c7486cc [WIP] Updates: reduce PR complexity 2025-10-01 22:54:37 +03:00
Alex P 257993ec20 [WIP] Updates: reduce PR complexity 2025-10-01 22:21:04 +03:00
Alex P 56c02f1067 [WIP] Updates: reduce PR complexity 2025-10-01 22:07:45 +03:00
Alex P 4c12783107 [WIP] Updates: reduce PR complexity 2025-10-01 21:20:30 +03:00
Alex P 6ccd9fdf19 [WIP] Updates: use native C binaries for audio 2025-10-01 20:13:13 +03:00
Alex P 74f73d9496 Merge branch 'dev' into feat/audio-support 2025-10-01 13:09:03 +00:00
Alex P ef5c25efcf 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 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
Alex P 70ef7193fd Cleanup: remove silence detection 2025-09-30 14:32:36 +00:00
Alex P 35b5dbd034 [WIP] Cleanup: cleanup audio code after HDMI switch 2025-09-30 13:32:56 +00:00
Alex P 7dc57bcdf3 [WIP] Fix: crackling sound when seeking forward after migrating to HDMI Audio 2025-09-30 13:14:15 +00:00
Alex P 05b347fe74 [WIP] Fix: crackling sound when seeking forwars 2025-09-30 13:11:16 +00:00
Alex P e989cad633 [WIP] Fix: crackling sound when seeking forwars 2025-09-30 12:58:49 +00:00
Alex P fc38830af1 [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 76b80da157 Updates: adjust gain to avoid audio artifacts 2025-09-30 12:05:03 +00:00
Alex P 01719e01dd [WIP] Updates: simplify audio system 2025-09-30 11:41:17 +00:00
Alex P 753c613708 [WIP] Updates: simplify audio system 2025-09-30 11:03:34 +00:00
Alex P f6dd605ea6 [WIP] Updates: simplify audio system 2025-09-30 09:36:19 +00:00
Alex P 680607e82e [WIP] Updates: simplify audio system 2025-09-30 09:08:55 +00:00
Alex P 6c6a1def28 [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 dcce0fefb7 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 630571da25 [WIP] Improvements, Bugfixes: Improve audio experience when running in HTTP mode 2025-09-21 22:05:19 +00:00
Alex P d311dee4c6 [WIP] Improvements, Bugfixes: Improve audio experience when running in HTTP mode 2025-09-21 21:20:05 +00:00
Alex P 7060f9e8d6 [WIP] Improvements, Bugfixes: Improve audio experience when running in HTTP mode 2025-09-21 21:11:30 +00:00