Add native macOS client (Swift, zero-dependency)#125
Open
mrowlinson wants to merge 1 commit intosipeed:mainfrom
Open
Add native macOS client (Swift, zero-dependency)#125mrowlinson wants to merge 1 commit intosipeed:mainfrom
mrowlinson wants to merge 1 commit intosipeed:mainfrom
Conversation
Single-file Swift app with zero external dependencies. Features: - USB HDMI capture with GPU-accelerated preview (MJPEG/H.264/H.265/NV12) - Full keyboard/mouse HID passthrough over USB serial - CoreAudio pass-through with lock-free ring buffer - Video recording (H.264/H.265) and screenshots (PNG/JPEG/HEIC) - Background refresh with audio-triggered wake and session watchdog - Mouse jiggler, paste-as-typing, preset key combos
efe91b1 to
561d74a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Native macOS application for NanoKVM-USB that replaces the browser-based workflow with a standalone
.appbundle. Single Swift file, no Xcode project, no dependencies — compiles from the command line withswiftc.Why
The Chrome-based solution (WebSerial + getUserMedia) works but uses significant CPU and RAM on macOS due to JavaScript video processing. This native app uses
AVCaptureVideoPreviewLayerwhich renders USB capture card frames directly on the GPU, using a fraction of the CPU and RAM compared to Chrome.Features
Build
cd macos bash build.command open NanoKVM.appRequires macOS 12+ and Xcode command line tools.
Files
NanoKVM.swiftInfo.plistbuild.commandAppIcon.icnsProtocol Compatibility
Uses the same CH552 serial protocol (57600 baud,
[0x57][0xAB]framing) with commands:0x01GET_INFO0x02SEND_KB_GENERAL (8-byte HID keyboard reports)0x04SEND_MS_ABS (7-byte absolute mouse, 12-bit coordinates)0x05SEND_MS_REL (5-byte relative mouse)