Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
T
Tidal
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PLN
  • Tidal
  • Repository

Switch branch/tag
  • Tidal
  • tools
  • audio-lens.py
Find file
BlameHistoryPermalink
  • PLN (Algolia)'s avatar
    fix(obs): half the lens was dead code, and it took a device swap to notice · 0d184046
    Three fixes, found by pointing the tool at the laptop's built-in card when PLN
    moved upstairs and played UMC-less out of the aux jack into a Pioneer amp.
    
    1. The rate and STALL checks never ran. They compared consecutive polls and
       required dt > 0.5 s, but the default poll interval is 0.25 s, so the
       condition was almost never true: the 900 s watch that diagnosed the UMC
       collected exactly TWO rate samples. The restart detector carried the entire
       investigation while the other half of the tool was decoration. Now measured
       against a reference sample held at least a second back, which also makes
       'RUNNING but hw_ptr frozen' a check that can actually fire. Verified: 11
       samples in 12 s, 47984/47996/48034 Hz.
    
    2. It watched pcm0p unconditionally. Fine for a USB interface with one playback
       PCM; wrong for the SOF card, which has eight (headphones, speakers, mics,
       HDMI) and where which one is live depends on where the jack is. It would
       have reported perfect health about the speakers while the sound went out the
       headphone jack. Now prefers a RUNNING substream, re-resolved every poll, and
       says so when the live PCM moves.
    
    3. nominal_rate read stream0, which is USB-audio-only, so it returned None on
       the built-in card — disabling the rate comparison on exactly the device PLN
       falls back to when the interface dies. Falls back to hw_params.
    
    Also stops crying wolf: a stream that just restarted has a hw_ptr counting from
    zero, so the first delta across the seam is meaningless. Measuring it anyway
    printed 'RATE OFF - 0 Hz (-100%)' on every reconnect during the replug test — a
    false alarm fired at the exact moment the operator most needs to trust the
    tool.
    
    The lesson is the one this repo keeps relearning: a check that never fires is
    indistinguishable from a check that passes, and you only find it by running the
    thing somewhere new.
    PLN (Algolia) authored Aug 14, 2026
    0d184046
audio-lens.py 16.5 KB
EditWeb IDE
×

Replace audio-lens.py

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.