Skip to content

v1.2.0 — Windows Native: Sun-Aware Adaptive Controller

Latest

Choose a tag to compare

@RMANOV RMANOV released this 08 Feb 11:19
· 18 commits to rust-rewrite since this release

Adaptive Brightness & Volume Controller v1.2.0 — Windows Native

Sun-Aware. Zero-Dependency. Blazing Fast.

The Rust performance engine now runs natively on Windows — no Python, no WSL, no virtual machines. Just a single .exe that intelligently adapts your display and audio to natural light cycles.


What's New

Full Windows Port

  • Native Windows binary — starts in <100ms, uses <4MB RAM
  • No external dependencies — everything is self-contained
  • Automatic volume control via Windows Core Audio API (pre-compiled C# helper, compiled once from embedded source via csc.exe)
  • Laptop brightness via WMI (graceful fallback on desktop monitors)
  • Cross-platform audio capture via cpal (WASAPI on Windows)

Privacy-First Microphone Usage

  • Microphone active only 4% of the time (200ms sample every 5 seconds)
  • Indicator light stays OFF between samples — no always-on surveillance feel
  • Sun-position updates every 2s (was 100ms) — matched to actual rate of change
  • ~96% reduction in audio hardware usage vs continuous capture

NOAA Solar Position Engine

  • Pure-math sunrise/sunset calculator replaces physical camera
  • Hardcoded for Sofia, Bulgaria (42.6977°N, 23.3219°E)
  • Smooth cosine-interpolated brightness curves at dawn/dusk
  • Sun-window detection: 1.5x accelerated adaptation during transitions
  • Today (Feb 8): sunrise 07:32, sunset 17:48 ☀️

Intelligent Zero-UI Scheduling

  • Daily planner runs at midnight, calculates exact sunrise/sunset via NOAA
  • Sets precise one-shot triggers in Windows Task Scheduler — no waiting, no sleep
  • Controller .exe launches directly — no PowerShell window, no wrapper, fully hidden
  • Seasonal adaptation — trigger times shift automatically throughout the year
  • ~90% energy savings vs continuous operation
Architecture:

  AdaptiveController-Planner (00:05 daily, hidden, <1s)
    │  NOAA solar calculator → today's sunrise/sunset
    │
    ├── AdaptiveController-Sunrise  → exact time (e.g. 06:10)
    │     └── adaptive-controller.exe  (direct, no wrapper)
    │
    └── AdaptiveController-Sunset   → exact time (e.g. 18:10)
          └── adaptive-controller.exe  (direct, no wrapper)

System Architecture

┌─────────────────────────────────────────────┐
│           adaptive-controller.exe           │
├──────────┬──────────┬──────────┬────────────┤
│ Sun NOAA │  cpal    │ WMI/PS   │ C# CoreAudio│
│ Position │  Audio   │ Brightness│ Volume     │
│ (2s poll)│(200ms/5s)│ Control  │ Control    │
├──────────┴──────────┴──────────┴────────────┤
│              adaptive-core                   │
│  SIMD brightness · log volume · smooth EMA  │
│  change detection · screen analysis · sun   │
└─────────────────────────────────────────────┘

Performance

Metric Python + Numba Rust Native
Startup 2-3s <100ms
Memory ~45MB <4MB
Brightness calc 0.08ms 0.02ms
Volume mapping 0.015ms 0.003ms
Convergence ~30s ~15s
Mic duty cycle ~100% ~4%

Quick Start (Windows)

# One-time setup: create scheduled tasks
powershell -ExecutionPolicy Bypass -File scripts\setup-tasks.ps1

# Manual one-time run
.\adaptive-rust\target\release\adaptive-controller.exe

# Continuous mode
.\adaptive-rust\target\release\adaptive-controller.exe --continuous

# Check volume helper
%APPDATA%\adaptive-controller\volume_helper.exe get

Files

  • adaptive-rust/target/release/adaptive-controller.exe — main binary
  • scripts/daily-planner.ps1 — NOAA sunrise/sunset → Task Scheduler triggers
  • scripts/setup-tasks.ps1 — one-time task creation
  • %APPDATA%/adaptive-controller/volume_helper.exe — auto-compiled audio helper
  • %APPDATA%/adaptive-controller/controller.log — runtime logs

Built with Rust 1.93 · SIMD-optimized · LTO fat · Privacy-first audio sampling