Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

usb_audio.USBSpeaker: Speaker audio does not adjust based on Windows volume slider/mute.

Aperta
#11,302 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@peterbay ci sta già lavorando.

Dal 14/9/2026.

  • #11386 di @peterbay — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
c
Ambito
embedded-iot

Direzione di ricerca

Start by reading the Feature Unit descriptor in shared-module/usb_audio/init.c and tracing how volume and mute are handled in tud_audio_set_req_entity_cb, usb_audio_usbspeaker_background_drain(), and usb_audio_usbspeaker_get_buffer(). Determine which behavior the project should adopt: apply the controls to samples, stop advertising them, or expose them to Python. Done means Windows volume and mute work as expected under the chosen approach, with relevant tests or verification documented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

audio bug enhancement usb
CircuitPython version and board name
Adafruit CircuitPython 10.3.0-alpha.4; Adafruit QT Py RP2040 with rp2040
Code/REPL
# in boot.py
import usb_audio
usb_audio.enable(speaker=True, microphone=False)
Behavior

The device correctly registers to Windows 11 Pro 25H2 as a CircuitPython Speaker but adjusting the master volume slider or muting it at the Windows level has no effect on the audio.

Description

No response

Additional information

AI Analysis (Cursor Grok 4.6)

Windows volume does nothing because USBSpeaker claims hardware volume, then never applies it.

The taskbar slider and keyboard volume keys are endpoint volume. On a USB Audio Class 2 speaker, Windows treats that as a hardware Feature Unit control: it sends full-scale PCM and a SET_CUR volume/mute request, and it does not insert a software volume APO.

CircuitPython does the first half of that contract and skips the second.

  1. The descriptor advertises a real volume control. The speaker Feature Unit marks mute and volume as read/write on master and both channels:

shared-module/usb_audio/init.c
Ln 173–174
/* Feature Unit Descriptor(4.7.2.8) */
TUD_AUDIO20_DESC_FEATURE_UNIT(..., AUDIO20_CTRL_RW << MUTE | AUDIO20_CTRL_RW << VOLUME, ...)
Windows therefore binds the system slider to hardware and will not attenuate the stream itself.

  1. Firmware stores the host’s volume, then ignores it. tud_audio_set_req_entity_cb writes usb_audio_mute[] / usb_audio_volume[]. Those arrays are only read back for GET_CUR / GET_RANGE. They are never used when samples are copied.

usb_audio_usbspeaker_background_drain() and usb_audio_usbspeaker_get_buffer() memcpy the USB PCM unchanged. There is no scale, no mute-to-zero, and USBSpeaker exposes no volume/mute property you could apply in Python.

So the slider moves (the SET_CUR succeeded) and the speaker stays at unity gain.

  1. That is why this is a Windows-specific complaint. macOS and Linux often still apply software volume in the host mixer. Windows does not, once a Feature Unit Volume control exists. Per-app sliders in Volume Mixer can still work, because those are session volumes applied before USB. System / keyboard volume cannot.

A firmware fix has to do one of these:

Apply it: scale (and mute) each sample from the per-channel Feature Unit values. Windows prefers channel 1/2 over master when both are advertised.

Stop claiming it: clear Volume/Mute from the Feature Unit so Windows inserts its software volume APO instead.
Until one of those lands, the host-side workaround is the same as for DACs that advertise volume and ignore it: force software attenuation (WinSoftVol, Equalizer APO, or the per-app mixer).

Delegate it: expose the audio channel mute and audio channel volume parameters from Windows and let other code decide what to do with it.

Lingua principale
C
Stelle
4.6k
Fork
1.4k
Merge medio
1g 8h
PR unite (30g)
155

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di adafruit/circuitpython

Tutte le issue di adafruit/circuitpython

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.