nuttx/audio
fangyibo 975ab1d9aa audio: limit the buffer count guard to shared ring requests
The upper->periods >= upper->nbuffers check sat at the top of
audio_allocbuffer(), but upper->periods is only incremented for shared
ring requests (u.pbuffer == NULL), so for private buffer callers the
check degenerated into "nbuffers == 0" and rejected every allocation
when the lower half does not implement AUDIOIOC_GETBUFFERINFO, which is
the only place nbuffers is ever assigned.

Move the guard inside the shared ring branch so private buffers, which
never enter upper->apbs[] and are unrelated to the ring depth, stay
allocatable. The zero return value is kept as-is because a second
application attaching to the same device relies on it to skip
allocation and go straight to AUDIOIOC_ENQUEUEBUFFER.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 07:58:53 +02:00
..
audio.c audio: limit the buffer count guard to shared ring requests 2026-08-05 07:58:53 +02:00
audio_comp.c style: Fix "is is" typo across the codebase. 2026-03-24 09:39:26 +08:00
CMakeLists.txt audio: migrate to SPDX identifier 2024-09-10 11:33:26 +08:00
Kconfig nuttx/audio: Add amr and opus format control switches 2024-08-23 08:57:00 +08:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
pcm_decode.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00