mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* audio: count microphone overloads on the realtime thread, log them coalesced CoreAudio reports kAudioDeviceProcessorOverload as ErrorKind::Xrun from its real-time thread. Hex's handler ran tracing::warn! there (formatting plus a blocking write to stderr and process.log behind a mutex) and locked STREAM_GLITCHED_AT, once per overload, hundreds of times a day, on a thread that had already missed its cycle. The error callback now only moves atomics (a total, a refused real-time promotion count, and the last overload time against a clock taken before the stream runs). AudioInput::recv_timeout, the poll that drains the stream for dictation and meetings, reports them: one line per burst with count and realtime_denied, at most every 10 s, and the count a throttled poll holds back is taken by the next one rather than lost. since_last_stream_glitch keeps its signature and semantics from the same counters. On macOS the first chunk of each open also logs the callback's frames and period, since cpal exposes no readback for BufferSize::Default and overloads arrive sooner on a smaller hardware period. No FFI or unsafe was added. Moved the counters into audio/overloads.rs to keep audio.rs under the 1,500-line shape limit. * audio: write a closing stream's leftover overloads, and stop calling them CoreAudio's Review follow-ups to the coalesced overload log: - impl Drop for AudioInput drops the stream first, so no callback races, then overloads::flush writes any count the 10 s window still held. Without it, a burst left over at close surfaced on the next open, hours later, next to "microphone stream opened" and read as a cold-start burst. Flush is swap-based and skips the rate limit; nothing pending costs one atomic load, and the fixture and test inputs (no stream) drop as before. - cpal 0.18 emits RealtimeDenied only from the aaudio and jack hosts, so the separate REALTIME_DENIED counter and the realtime_denied log field are gone: record() takes no argument and both kinds just count. Comments and docs no longer call these CoreAudio's overloads, since the poll reports any host's. - now_nanos reads the clock cell before Instant::now, so a first-ever record cannot land on the 0 that means never. - report_period skips HEX_AUDIO_FIXTURE, whose chunks are the file's rather than a device's, and says so. docs/features/recovery.md gains the close-time flush and uses the "Changed after dev" heading; the unsupported "hundreds a day" claim is gone. * audio: clamp the overload clock reading to at least one get_or_init(Instant::now) and the next Instant::now() can return the same tick on Apple Silicon and Windows, so a first-ever reading could still be 0, the sentinel for "never". now_nanos returns at least 1, and the GLITCHED_AT doc says the reading is clamped rather than merely later than the clock. |
||
| .. | ||
| hex_microphone | ||
| recording_environment | ||
| browser_media.rs | ||
| call_input.rs | ||
| fixture.rs | ||
| hex_microphone.rs | ||
| idle_sleep.rs | ||
| input_format.rs | ||
| input_level.rs | ||
| instant.rs | ||
| lid.rs | ||
| mix_format.rs | ||
| output_ducking.rs | ||
| output_route.rs | ||
| overloads.rs | ||
| recording_environment.rs | ||
| transport.rs | ||
| voice_filter.rs | ||
| wasapi_capture.rs | ||