Files
Adolfo Reyna c7dc66e04b fix(audio): ES8311 BOTH complementary open + audio-stream close ref-count + mic unmute
- es8311 driver open() now allows OUTPUT->INPUT complementary (promotes to BOTH) when same native rate 44100
- audio-stream close_stream() ref-counts shared BOTH codec (don't close if other direction still open)
- MCP recordVoice + VoiceRecorder app explicitly unmute and set 100% gain

Fixes mic input not working - was returning ERROR_RESOURCE when output already open
2026-07-18 19:55:47 -04:00
..
2026-07-14 08:34:29 +02:00
2026-07-14 08:34:29 +02:00
2026-07-14 08:34:29 +02:00
2026-07-14 08:34:29 +02:00

Audio stream module

Defines AUDIO_STREAM_TYPE and AudioStreamApi: the high-level, full-duplex audio API that apps (including ELF side-loaded apps) and AudioService should use instead of talking to an AUDIO_CODEC_TYPE device directly. Binds to one input-capable and/or one output-capable codec device (found automatically at start; see Drivers/audio-codec-module) and adds on top of it:

  • Resampling, so the same app code works at any requested sample rate regardless of what rate the bound codec natively runs at.
  • Shared volume/mute/enable state per direction, with a change callback (AudioStreamChangeCallback) that AudioService subscribes to.
  • A single always-present device (audio-stream0), constructed unconditionally at module-start time before any devicetree codec exists, and bound lazily on first use -- so boards with no audio hardware at all still get a harmless, inert device rather than nothing.

open_input/open_output return a stream handle; read/write on that handle are blocking and must be called from the caller's own task, never from the main/LVGL thread.

License: Apache v2.0