github ilyakruchinin/SomnoTrace v4.1.0-beta2

one hour ago

SomnoTrace v4.1.0-beta2 Changelog (since v4.1.0-beta1)

✨ New Features

  • 📈 Conditional Perfusion Index (PI%) Graph: Added a new Perfusion Index (%) chart directly below Motion in the Web UI dashboard. It automatically appears only for nights recorded with live optical PI data (SNTv3 channel 6) and stays hidden on legacy 5-channel recordings.

🔧 Ring & BLE Fixes

  • 💍 Gen1 (O2Ring / Oxyfit) Live PPG Stability & Timing:
    • Connects directly with fast, ring-compatible 15–30 ms BLE intervals (4000 ms supervision timeout) and skips redundant ble_gap_update_params() calls when already fast — eliminating rc=530 / 0x3B parameter errors.
    • Added a 1000 ms deadline inside legacy_drain_rt_ppg() so 1 Hz vitals polling never starves behind back-to-back 0x1C PPG drains on slower links.
    • Cleaned up notification resyncs by skipping straight to the next 0x55 frame lead byte instead of logging byte-by-byte warnings on stale post-disconnect tails.
  • 🚀 Gen2 (OxyII / SHQO2Pro) Auto-Stream Reliability:
    • Verifies wear state via 0x04 (LIVE_B) before starting 0x10(0x0D) auto-push, and cross-checks 0x04 (falling back cleanly to 0x04/0x05 polling) if 0x11 initially reports state=0 while worn — fixing sessions that previously disconnected right after connect without recording.
    • Connects with 15–30 ms / 4000 ms initial BLE parameters and cleanly skips to the next 0xA5 lead byte on partial frames.

🧹 Quality of Life

  • 🔇 Quieter Logs: Stops 0x10(0x00) cleanly before resetting auto-stream state on session end, and demoted benign resync and short-session (< 30 epochs) SomnoStage marker messages from warnings to debug/info so normal logs stay clean.

SomnoTrace v4.1.0-beta1 Changelog (since v4.0.6)

✨ Highlights

  • 🔴 Live PPG Recording for Both Gen1 & Gen2 Rings: Capture full 150 Hz lossless dual-wavelength (IR + Red) raw optical PPG from both Gen1 (e.g., Oxyfit) and Gen2 (e.g., O2 Ring S / SHQO2Pro) rings right from the Web UI Recording Mode selector.
  • ⚡ Live-Only Sessions (No Post-Session Ring Downloads): When Live PPG Recording is enabled, SomnoTrace now builds your overnight vitals directly from the live stream as soon as you take the ring off — completely skipping post-session file transfers from the ring. Ideal for Gen1 rings with 4-hour memory caps or rings without onboard storage (Standard download mode remains unchanged).
  • 🗜️ New Lossless .ppg.gz Binary Format: Replaced massive ~160–230 MB raw CSVs with a compact, lossless multi-member gzip format (~10–14 MB per night) that is crash-resilient (each ~5 s chunk is an independent gzip member) and seamlessly resumes across mid-night toilet breaks or BLE drops (30-minute resume window).
  • 🧭 3-Axis Accelerometer Capture (Gen2) & Live Perfusion Index (PI%): Gen2 rings now stream 3-axis (X, Y, Z) accelerometer data alongside 150 Hz PPG, and both Gen1 and Gen2 live sessions now calculate 1 Hz optical Perfusion Index (PI%) into a backwards-compatible 6-channel SNTv3 track.

💍 Ring & BLE Improvements

  • 🚀 Gen2 (OxyII) Auto-Push & Zero-Drop Capture:
    • Switched Live PPG mode to autonomous BLE push streaming (0x10 auto-stream for vitals, 150 Hz PPG, and 3-axis ACC) with automatic fallback to burst-drained polling if a firmware doesn't push.
    • Fixed Gen2 raw PPG packet parsing and multi-packet FIFO draining — eliminating the ~32% sample drop seen when polling once per second.
  • 🔧 Gen1 (Oxy / Oxyfit) Support & Speedups:
    • Added Oxyfit discovery handling, fast BLE link-interval negotiation (7.5–20 ms), and write-without-response support for faster round-trips.
    • Burst-drains 0x1C 150 Hz raw IR+Red PPG with graceful fallback to vitals-only on older Gen1 firmware lacking 0x1C.

🛠️ Tooling, Docs & Testing

  • 🐍 Python .ppg.gz Decoder (scripts/ppg_decoder.py): Decode PPG1 optical waveforms and ACC1 3-axis accelerometer streams to CSV or JSON summaries, with built-in recovery for truncated tails.
  • 📖 Protocol & Format Spec: Added spec/0017-live-ppg-recording-and-format.md documenting the Gen1/Gen2 PPG & ACC protocols, .ppg.gz binary format, and THIRD-PARTY-NOTICES.md updates.
  • 🧪 Automated Host Tests: Added synthetic ppg_writer_test and cross-language ppg_contract_test suites covering lossless compression, discontinuities, ACC1 chunks, and power-loss tail recovery.

Don't miss a new SomnoTrace release

NewReleases is sending notifications on new releases.