github tphakala/birdnet-go nightly-20251025
Nightly Build 20251025

pre-release14 hours ago

🚨 Critical Bug Fix - Detection Logic

Detection Rate Restoration (BG-16) (#1432) - MAJOR PRIORITY

  • Problem: 19+ confirmed users reported zero or near-zero bird detections since September 14, 2025
  • GitHub Issues: Closes #1314 (6 users, Sept 20), Closes #1359 (13+ users, Oct 8)
  • Root Cause: FlushDeadline calculated in the past, causing immediate flush before overlap-based false positive filtering could accumulate confirmations
    • With default settings (15s capture, 3s pre-capture, overlap 2.2):
    • FlushDeadline = (Now - 13s) + 12s = Now - 1s (already in the past!)
    • Result: Detections flushed immediately with count=1, needed=2 → "matched 1/2 times" → REJECTED
  • User Impact:
    • "20-30 different birds daily, until after the last nightly and then nothing"
    • "Cardinals and Blue Jays stopped being detected even though making plenty of noise"
    • Users forced to disable overlap (flooding with false positives) or increase capture length to 60s
  • Solution: One-line fix - decouple FlushDeadline from backdated startTime
    • Changed: FlushDeadline: time.Now().Add(detectionWindow) instead of using backdated item.StartTime
    • Result: FlushDeadline = Now + 12s (in future) → Wait 12 seconds → ~15 overlapping analyses → Count = 3-4, needs 2 → APPROVED ✓
  • Impact: Restores normal detection rates for all users on default settings

If you experienced low or zero detections, please update immediately and revert overlap to 2.2-2.5


🚀 Major Features & Enhancements

Spectrogram Generation System Overhaul (PR Series #1403, #1407, #1408, #1410, #1422)

A comprehensive series of improvements to address UI lag and resource constraints:

Spectrogram Pre-Rendering (#1403)

  • Problem: UI freezes when loading spectrograms on-demand
  • Solution: Automatic background generation of spectrograms after detections
  • Features:
    • Background worker pool with 2 concurrent generators
    • Queue-based processing with priority (new detections first)
    • Configurable modes: auto/prerender (default), manual (user-requested only), off
    • Deduplication prevents redundant generation
  • Impact: Eliminates UI lag when browsing detections

UI Settings Toggle (#1407)

  • Feature: User-facing toggle in Settings → Output → Spectrograms
  • Options: Auto Pre-Render, User Requested Only, Disabled
  • Help Text: Explains CPU/memory vs. UX trade-offs

Code Deduplication (#1408)

  • Refactor: Eliminated duplicate spectrogram generation code across codebase
  • Impact: Single source of truth, easier maintenance

User-Requested Mode for Resource-Constrained Systems (#1410)

  • Problem: Pre-rendering too resource-intensive for Raspberry Pi and low-power devices
  • Solution: Manual generation mode triggered only when user views detection
  • Configuration:
    • Config: output.spectrogram.generation_mode: "manual"
    • Modes: auto (background), manual (on-demand), off (disabled)
  • Impact: Allows users to control CPU/memory usage vs. UX trade-off

Backend Scalability Improvements (BG-13) (#1422)

  • Enhancement: Async generation with non-blocking HTTP 503 responses
  • Features:
    • Check if spectrogram exists first (fast path)
    • If exists: serve immediately
    • If not exists: trigger async generation, return HTTP 503
    • Frontend retries with exponential backoff
  • Impact: Multiple browsers no longer block on same spectrogram generation

Dynamic Threshold Persistence (#1383)

  • Problem: Dynamic thresholds lost on application restart, requiring re-learning
  • Solution: Persist thresholds to database with automatic restore
  • Features:
    • species_thresholds table with species_code/confidence/updated_at
    • Automatic load on startup
    • Background save with 5-minute interval
    • Graceful shutdown persistence
  • Database Changes: ALTER TABLE species_thresholds ADD COLUMN confidence REAL
  • Impact: Consistent detection accuracy across restarts

🐛 Bug Fixes & Performance Improvements

SSE Connection Management (#1420)

  • Problem: Slow clients blocked other SSE connections, causing UI freezes
  • Root Cause: Shared broadcast channel blocked on slow consumers
  • Solution: Per-client buffered channels with timeout-based eviction
  • Features:
    • 100-message buffer per client
    • 10-second write timeout
    • Automatic cleanup on timeout or disconnect
    • Graceful degradation (slow clients dropped, not all blocked)
  • Impact: SSE streams remain responsive even with slow/disconnected clients

Database Lock Elimination (#1395)

  • Problem: Dynamic threshold persistence caused SQLite database locks and "database is locked" errors
  • Root Cause: Long-running transaction held lock during batch updates
  • Solution:
    • Changed from single transaction to individual transactions per species
    • Immediate commit after each UPDATE
    • Reduced lock duration from seconds to milliseconds
  • Impact: No more database lock errors, concurrent operations work smoothly

Disk Manager Optimization (#1394)

  • Problem: Unnecessary file scanning during cleanup caused performance issues
  • Solution: Optimized file walking logic to reduce allocations
  • Impact: Reduced memory usage and faster cleanup operations

BirdWeather DNS Timeout Handling (#1401)

  • Problem: DNS resolution failures on multi-server environments
  • Solution: Improved timeout handling with fallback and retry logic
  • Impact: More reliable BirdWeather uploads in diverse network environments

Debian Trixie Timezone Support (#1419)

  • Problem: Missing timezone data on Debian 13 Trixie causing startup failures
  • Solution: Add tzdata-legacy package to Docker images
  • Impact: Timezone support works out of the box on Debian Trixie

Settings API Updates (#1405, #1406)

  • Fix #1405: Allow clearing BirdNET model/label paths to revert to defaults
  • Fix #1406: Enable main and security settings updates through API
  • Impact: Full configuration management via API

Installation Enhancements (#1400)

  • Telemetry Diagnostics: Enhanced logging and error reporting
  • AVX2 Optional: Made AVX2 detection non-blocking for wider compatibility
  • Impact: Smoother installation experience on diverse hardware

🎨 Frontend Improvements

Audio Player Debug Logging (#1428)

  • Feature: Add debug logging for multi-session troubleshooting
  • Impact: Better diagnostics when investigating audio playback issues

🏗️ Infrastructure & Developer Experience

Contributing Guide (#1424)

  • Feature: Comprehensive guide with automated dev setup
  • Tools: Taskfile automation, devcontainer support
  • Impact: Faster onboarding for new contributors

Dependency Updates

  • golang.org/x/time: 0.13.0 → 0.14.0 (#1415)
  • google.golang.org/api: 0.251.0 → 0.252.0 (#1413)
  • github.com/getsentry/sentry-go: 0.35.3 → 0.36.0 (#1412)
  • github.com/getsentry/sentry-go/echo: 0.35.2 → 0.36.0 (#1411)
  • github.com/nicholas-fedor/shoutrrr: 0.10.1 → 0.10.3 (#1414)
  • golang.org/x/sys: 0.36.0 → 0.37.0 (#1390)
  • golang.org/x/net: 0.44.0 → 0.46.0 (#1387)
  • golang.org/x/crypto: 0.42.0 → 0.43.0 (#1386)
  • vite: 7.1.5 → 7.1.11 (#1423)
  • playwright: latest (#1421)
  • Dependency license updates (#1392, #1417, #1427)

🎯 Developer Notes

This release prioritizes detection accuracy restoration and spectrogram performance. PR #1432 fixes a critical 41-day bug that affected default configurations, restoring normal detection rates for 19+ confirmed users (likely many more unreported).

The spectrogram generation overhaul (#1403, #1407, #1408, #1410, #1422) provides a flexible system for balancing UI responsiveness with resource constraints - essential for users on Raspberry Pi and low-power devices.

Key improvements since nightly-20251012:

  • Detection logic fix (BG-16) - Restores normal detection rates for default configurations
  • Async spectrogram generation - Prevents UI blocking on multiple concurrent requests
  • Configurable generation modes - Users control CPU/memory vs. UX trade-off
  • Dynamic threshold persistence - Consistent detection accuracy across restarts
  • SSE connection isolation - Slow clients no longer block other connections
  • Database lock elimination - Concurrent operations work smoothly

These improvements make the system more reliable, performant, and easier to operate in production environments.


Full Changelog: nightly-20251012...nightly-20251025

Contributors: Special thanks to all contributors who helped identify, test, and resolve these issues.

Don't miss a new birdnet-go release

NewReleases is sending notifications on new releases.