nuttx/Documentation/components/audio
fangyibo ecacc7bc7c
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Documentation/audio: document the audio upper half interface
The audio subsystem page listed the source files and the configuration
options, but nothing about the interface the upper half presents to
applications.  PR #18348 added a device state machine, a second buffer
allocation mode, poll and mmap support and several new ioctls, none of
which were described anywhere, so the only way to learn the expected
call sequence was to read audio/audio.c.

Document what the upper half now guarantees:

  - the device state machine, and the fact that AUDIOIOC_START is
    rejected until AUDIOIOC_CONFIGURE has moved the device out of
    AUDIO_STATE_OPEN;
  - the normal open/configure/allocate/enqueue/start sequence;
  - the two AUDIOIOC_ALLOCBUFFER modes selected by u.pbuffer, who owns
    the buffers in each, and that a shared ring request may return zero
    when the ring is already populated;
  - that AUDIOIOC_GETBUFFERINFO also establishes the shared ring depth,
    so a lower half which does not implement it disables that mode;
  - the poll event semantics and how mmap() selects between a ring
    buffer and the device status by requested length;
  - all ioctls handled by the upper half, grouped by purpose;
  - how per-open state is aggregated into the device state when several
    applications share one device.

No functional change.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 07:58:53 +02:00
..
index.rst Documentation/audio: document the audio upper half interface 2026-08-05 07:58:53 +02:00