Skip to content

Remote API serves stale data while reporting active: true — meters and spectrum stop updating until restart (v1.5.2, Windows) #137

Description

@coaxk

On v1.5.2 (Windows 11), OSM intermittently stops updating its measurement data while the remote API on port 49007 continues to answer normally and reports active: true. There is no error, no status change, and no way to detect it from a single request. Only an application restart clears it.

What we observe

requestChanged returns bit-identical level and referenceLevel across repeated reads, minutes apart:

level            -68.29955291748047     unchanged across dozens of reads
referenceLevel  -156.5355987548828      unchanged
active           true                   throughout
error            (no error reported)

level did not move through a source switch between two different signals, which is what first showed this was the instrument rather than the signal path.

It is not only the meters — the spectrum is stale too

This is the part that matters most for anyone consuming the API. In one affected session we took 9 successive requestData reads and compared the returned coherence value in each FFT bin across those reads:

affected session    100.0% of 4101 bins returned BIT-IDENTICAL values across all 9 reads
healthy sessions      0.0% of 8192 bins, across 13 separate runs — not one repeat

A working instance never repeats a float. An affected one repeats every float. So the API is serving a cached frame rather than a live measurement, and the response is indistinguishable from a real one unless you compare successive reads.

Why it is hard to notice

An automated consumer polling the API sees active: true, a well-formed response, and plausible numbers. Every downstream statistic computes normally and is meaningless. In our case a coherence estimate ran against a dead reference and produced values spanning 0.001 to 1.000 that looked like data.

Reproduction

We cannot reproduce it on demand — that is part of the report. What we can say about when it happened:

2026-09-07   froze after >=2 hours of an active measurement session
2026-09-08   froze within ~18 hours with the application COMPLETELY IDLE —
             no measurement running, no generator, no signal present

So it does not require measurement activity. Both instances cleared on an application restart, with nothing else changed.

What the log shows

%LOCALAPPDATA%\OpenSoundMeter\OpenSoundMeter\log.txt (8423 lines) ends in a repeating cycle that is completely absent from the first half of the file:

wasapi.cpp(403): "GetNextPacketSize" -7776fffc "Unknown error 0x88890004" "AUDCLNT_E_DEVICE_INVALIDATED"
wasapi.cpp(403): "GetBuffer"         -7776fffc "Unknown error 0x88890004" "AUDCLNT_E_DEVICE_INVALIDATED"
wasapi.cpp(403): "stop client" 1 "Incorrect function." "unknown"
generatorthread.cpp(80): audio device not present  "Dante Via (x64)"
asioplugin.cpp(103): "Realtek ASIO" ASIOInit

59 AUDCLNT_E_DEVICE_INVALIDATED lines in three clusters, at 53%, 97% and 99% through the file, and none in the first half. The log ends mid-cycle and goes silent once the application is restarted.

The WASAPI capture client is being invalidated, and stop client then fails with Incorrect function. We are not claiming to have diagnosed this — it is simply the only error class present, it is on the capture path, and a capture client that stops delivering while the source object retains its last values would produce the behaviour above. Happy to attach the full log if useful.

One honest caveat: the log carries no timestamps, so we cannot tie those clusters to the moment of the freeze, only to the same broad period. The operator had also changed the generator's audio device earlier in the same log, which may account for the first cluster.

Environment

OSM            v1.5.2 (latest release)
OS             Windows 11 Pro
Audio device   Dante Via, native (non-ASIO) receive endpoint
Access         remote API, port 49007
Recurrence     at least twice in 24 hours

What would help

Even without a fix, a way to distinguish stale data from live data would remove this whole class of silent corruption — a frame counter or a timestamp on the data returned by requestData, or a status field that goes false when the processing thread stops delivering. At present active: true is returned in both states, so a consumer has no way to tell them apart from a single request.

A timestamp in log.txt would also make this kind of report much easier to substantiate. (For what it's worth, QT_MESSAGE_PATTERN does not help here — the binary installs its own message handler and formats the prefix itself.)

Our own workaround, in case it helps anyone else hitting this: poll requestChanged six times and refuse to trust the instrument if level is bit-identical across all six and above the silence floor. It has caught it twice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions