<svg width="100%" viewBox="0 0 780 280" role="img" xmlns="http://www.w3.org/2000/svg">
  <title>Audio device picker on the Pi</title>
  <desc>sudoedge picks the USB capture/playback device, skipping vc4hdmi and other unusable ALSA devices; the choice feeds STT, wake detection, and TTS/cues.</desc>
  <style>
    text{font-family:"Anthropic Sans",-apple-system,system-ui,"Segoe UI",sans-serif}
    .t{font-size:14px;font-weight:500;text-anchor:middle;dominant-baseline:central}
    .s{font-size:12px;text-anchor:middle;dominant-baseline:central}
    .lbl{font-size:11px;fill:#9c9a92;text-anchor:middle}
    rect{stroke-width:.5}
    .green{fill:#27500a;stroke:#97c459}   .gt{fill:#c0dd97} .gs{fill:#97c459}
    .neutral{fill:#444441;stroke:#b4b2a9} .nt{fill:#d3d1c7} .ns{fill:#b4b2a9}
    .arrow{fill:none;stroke:#9c9a92;stroke-width:1.5}
  </style>
  <defs>
    <marker id="a" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
      <path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
    </marker>
  </defs>

  <rect class="neutral" x="20" y="100" width="180" height="80" rx="8"/>
  <text class="t nt" x="110" y="124">ALSA devices</text>
  <text class="s ns" x="110" y="146">USB mic · vc4hdmi · …</text>
  <text class="s ns" x="110" y="166">(plausible but mixed)</text>

  <rect class="green" x="260" y="100" width="240" height="80" rx="8"/>
  <text class="t gt" x="380" y="124">audio_devices.py</text>
  <text class="s gs" x="380" y="146">USB-preferring picker</text>
  <text class="s gs" x="380" y="166">skips known-bad devices</text>

  <rect class="neutral" x="560" y="20"  width="200" height="50" rx="8"/>
  <text class="t nt" x="660" y="42">mic → STT / LiveKit</text>

  <rect class="neutral" x="560" y="120" width="200" height="50" rx="8"/>
  <text class="t nt" x="660" y="142">mic → wake detector</text>

  <rect class="neutral" x="560" y="220" width="200" height="50" rx="8"/>
  <text class="t nt" x="660" y="242">TTS / cues → speaker</text>

  <path class="arrow" d="M 200 140 L 258 140" marker-end="url(#a)"/>
  <path class="arrow" d="M 500 120 L 540  45 L 558  45" marker-end="url(#a)"/>
  <path class="arrow" d="M 500 145 L 558 145" marker-end="url(#a)"/>
  <path class="arrow" d="M 500 160 L 540 245 L 558 245" marker-end="url(#a)"/>
</svg>
