Commit Graph

653 Commits

Author SHA1 Message Date
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 65bbcf85ad fix: prevent race condition in audio output source switching by reading from in-memory state with proper synchronization 2025-10-28 22:11:11 +02:00
Alex P cd7a098f76 fix: track audio autoplay status separately to handle Safari blocking audio while allowing video 2025-10-28 15:47:36 +02:00
Alex P ef86af8afc fix: enable audio playback via manual start stream button
Browser autoplay policy blocks audio without user interaction.
Store audio elements in ref and trigger playback when user clicks
the existing 'Manually start stream' button.
2025-10-28 14:28:30 +02:00
Alex P b2a57a64e9 Merge branch 'dev' into feat/audio-support 2025-10-27 19:22:45 +02:00
Alex P be2bb518ed Merge branch 'dev' into feat/audio-support 2025-10-27 19:19:41 +02:00
Marc Brooks b1c788cc5e
chore/Automatically sort language files after machine-translate run (#902)
This should ensure that newly added strings are kept in their correct location so later changes yield clean GIT diffs.
Also bumped a couple minor dependencies
2025-10-27 16:34:07 +01:00
Adam Shiervani 71fe95bf57
More UI translations (#899)
* Enhance localization for reboot messages in multiple languages, including descriptions for device rebooting, IP address changes, and reconnection prompts in Danish, German, English, Spanish, French, Italian, Norwegian, Swedish, and Chinese.

* Update Swedish localization strings

* Update German localization strings

* Update Spanish localization strings

* Update Danish localization strings

* Update French localization strings

* Update Italian localization strings

* Update Norwegian localization strings

* Update Chinese localization strings

* sort translation keys

---------

Co-authored-by: Adam Shiervani <adamshiervani@fastmail.com>
2025-10-27 16:33:58 +01:00
Alex P 0f43a84551 fix: remove continuous sleep mode check to prevent audio interference
The continuous ensure_sleep_mode_disabled() call in the format detection
loop caused repeated I2C transactions to the TC358743, disrupting HDMI
audio capture. Sleep mode is already disabled once during video_init(),
which is sufficient.
2025-10-27 17:28:14 +02:00
Adam Shiervani ce9f95b8c8
refactor: ota redirecting (#898)
* refactor: improve URL handling in RebootingOverlay component

* refactor: enhance redirect URL handling in TryUpdate function

* refactor: disable old ota rebooting method in new version

* refactor: streamline version retrieval logic and enhance error handling in useVersion hook

* refactor: rename to RedirectTo

* fix: force page reload when redirecting from reboot actions

* refactor: consolidate sleep utility and update usages across components

* refactor: update JsonRpcCallOptions to use maxAttempts and attemptTimeoutMs, implement exponential backoff for retries

---------

Co-authored-by: Adam Shiervani <adamshiervani@fastmail.com>
2025-10-27 16:21:11 +01:00
Alex P 557b3bf3e6 Fix: app not loading via HTTP 2025-10-27 11:21:49 +02:00
Alex P 450836daba chore: revert golangci-lint config and remove audio stub
- Revert .golangci.yml to dev branch state (removed custom build-tags)
- Remove internal/audio/cgo_source_stub.go (not needed with proper cross-compilation)
- Fix import ordering in ui/src/utils.ts

Use 'make lint-go' for proper ARM cross-compilation environment.
2025-10-24 01:31:06 +03:00
Alex P 68b1bc54ce fix: add stub implementation for CGO audio on non-ARM platforms
Provides no-op AudioSource implementations for platforms that don't
support ARM CGO audio (x86_64, darwin, etc.). This allows golangci-lint
to run successfully on any platform without requiring ARM cross-compilation
toolchain.

The stub implementations return errors when called, ensuring that if
they're accidentally used at runtime on non-ARM platforms, it will fail
gracefully with a clear error message rather than undefined symbols.

Build constraints ensure the real CGO implementation is used on linux/arm
and linux/arm64, while stubs are used everywhere else.
2025-10-24 00:04:05 +03:00
Alex P 54cbd98781 fix: verify audio source change and show accurate feedback
After setting audio output source, fetch the actual value from backend
to verify the change was applied successfully. This prevents the UI
from showing incorrect state when the backend fails to apply the change.

The optimistic update provides immediate feedback, but we now verify
the actual result and show error if backend returned a different value
than expected.
2025-10-23 23:59:02 +03:00
Alex P 47782856f3 feat: add translations and fix audio settings page
Added comprehensive translations for audio settings page:
- Page title and description
- Audio output/input settings
- Audio source selector (HDMI/USB labels)
- Success/error messages for all operations
- Translations added for all 9 languages

Updated devices.$id.settings.audio.tsx:
- Import and use translation keys (m.audio_settings_*)
- Use existing audio_output_* and audio_input_* keys for notifications
- Fix dropdown not updating: update UI optimistically, revert on error
- This prevents the dropdown from appearing stuck after source change

The optimistic update pattern improves UX by immediately reflecting
the user's choice while the backend processes the change.
2025-10-23 23:56:15 +03:00
Alex P f75f5eb58d docs: document JetKVM ARMv7 architecture and lint requirements
Added documentation to .golangci.yml explaining:
- JetKVM uses ARMv7 (Rockchip RK3308, Cortex-A7) not ARM64
- golangci-lint should be run via 'make lint-go' not directly
- Audio CGO code requires cross-compilation environment from Makefile

The build-tags are explicitly listed to match the actual build configuration
used in the Makefile (netgo, timetzdata, nomsgpack).

Running 'make lint' or 'make lint-go' works correctly as it sets up
the full ARM cross-compilation environment with audio library dependencies.
2025-10-23 23:36:23 +03:00
Alex P c96c3e215a fix: use translation key for audio button in ActionBar
Changed hardcoded 'Audio' string to use m.action_bar_audio()
translation key for proper internationalization.
2025-10-23 23:26:23 +03:00
Alex P a20c13d7f3 fix: add AudioOutputSource field to Config struct
The audio.go file references config.AudioOutputSource but the field
was missing from the Config struct definition, causing type errors.

Added AudioOutputSource string field with json tag 'audio_output_source'
to support configuration of audio output source ('hdmi' or 'usb').
2025-10-23 23:24:44 +03:00
Alex P 9a82df662f feat: add proper translations for audio features across all languages
Added comprehensive translations for audio-related UI strings:
- Action bar audio button
- Audio popover (title, output/input settings)
- Enable/Disable button labels
- Success/error notification messages
- USB device audio preset labels

Translations added for all 9 supported languages:
- English (en)
- Danish (da)
- German (de)
- Spanish (es)
- French (fr)
- Italian (it)
- Norwegian Bokmål (nb)
- Swedish (sv)
- Chinese Simplified (zh)

Updated AudioPopover.tsx to use translation keys instead of
hardcoded English strings for all UI elements.

Total of 19 new translation keys per language:
- action_bar_audio
- audio_disable/enable
- audio_input_* (title, description, enabled/disabled, failed)
- audio_output_* (title, description, enabled/disabled, failed)
- audio_popover_title
- usb_device_enable_audio_* (title, description)
- usb_device_keyboard_mouse_mass_storage_and_audio
2025-10-23 23:22:38 +03:00
Alex P 55f40cb729 fix: move ipcMsgTypeOpus constant to source.go for cross-platform builds 2025-10-23 23:13:23 +03:00
Alex P 50b938d13e Merge dev into feat/audio-support
- Resolved conflicts in .gitignore, ActionBar, UsbDeviceSetting, and devices.$id.tsx
- Added audio-related translations to all language files:
  - action_bar_audio
  - usb_device_enable_audio_title
  - usb_device_enable_audio_description
  - usb_device_keyboard_mouse_mass_storage_and_audio
- Updated UI components to use localization messages
- Added separate USB preset for keyboard/mouse/storage without audio
- Kept OPUS_STEREO_PARAMS import from audio branch
- Preserved AudioPopover component from audio branch
2025-10-23 23:11:17 +03:00
Marc Brooks 9a4d061034
Localize the client/browser UI with inlang paraglide-js (#864) 2025-10-23 14:27:29 +02:00
Marc Brooks 374fc310d3
Merge branch 'dev' into feat/audio-support 2025-10-22 16:35:00 -05:00
Aveline 2444817455
chore: disable sleep mode when detecting video format (#887)
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
Co-authored-by: Adam Shiervani <adamshiervani@fastmail.com>
2025-10-17 17:51:02 +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
Adam Shiervani 74e64f69a7
Add stale issues and PRs workflow (#890) 2025-10-16 16:21:37 +02:00
Adam Shiervani eb68c0ea5f
chore: add PR templates (feature, bug fix) (#889) 2025-10-16 15:51:56 +02: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
Adam Shiervani 403141c96a
refactor: safe Comboxbox onChange (#886) 2025-10-14 22:45:48 -05:00
Alex 0951f150bf
Merge branch 'dev' into feat/audio-support 2025-10-09 22:42:16 +03:00
Aveline cc9ff74276
feat: add HDMI sleep mode (#881) 2025-10-09 14:52:51 +02:00
Alex 71553bcef7
Merge branch 'dev' into feat/audio-support 2025-10-07 14:30:07 +03:00
Alex P 532e83e514 Cleanup: reduce drift from dev 2025-10-07 14:00:49 +03: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
Marc Brooks b144d9926f
Remove the temporary directory after extracting buildkit (#874) 2025-10-07 11:57:26 +02:00
Aylen e755a6e1b1
Update openSUSE image reference to Leap 16.0 (#865) 2025-10-07 11:57:10 +02:00
Marc Brooks 99a8c2711c
Add podman support (#875)
Reimplement #141 since we've changed everything since
2025-10-07 11:43:25 +02: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