ViezeVingertjes opened a new pull request, #22401: URL: https://github.com/apache/nuttx/pull/22401
## Summary **audio/pcm_decode: Complete the stream on every first-buffer failure.** When the first buffer of a stream cannot be accepted, the client must be told the stream is over with AUDIO_CALLBACK_COMPLETE (nxplayer waits for AUDIO_MSG_COMPLETE after a failed enqueue). pcm_enqueuebuffer() only did so when the lower half rejected the buffer; if the data had no valid WAV header or the lower half could not be configured, it just returned an error and the client waited forever. Route all first-buffer failures through the same completion path and return the actual error code instead of always -EINVAL, also in the completion callback. Tested on Waveshare ESP32-S3-Touch-AMOLED-2.16 with ES8311 behind the PCM decoder: "tone" (raw PCM, no WAV header) in nxplayer used to hang the player on exit; it now fails and nxplayer exits normally. The last commit fixes the pre-existing nxstyle errors in the touched file (whitespace only, no functional change), as CI checks whole files. ## Impact * Is new feature added? Is existing feature changed? NO * Impact on user (will user need to adapt to change)? NO * Impact on build (will build process change)? NO * Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO * Impact on documentation (is update required / provided)? NO * Impact on security (any sort of implications)? NO * Impact on compatibility (backward/forward/interoperability)? NO ## Testing I confirm that changes are verified on local setup and works as intended: * Build Host(s): Linux x86_64, xtensa-esp-elf GCC 15.2.0 (esp-15.2.0_20251204), riscv32-esp-elf GCC 15.2.0 for the ESP32-C3 build. * Target(s): Waveshare ESP32-S3-Touch-AMOLED-2.16 (ESP32-S3R8, 16 MB flash, 8 MB PSRAM). * nxplayer "tone" (raw PCM without WAV header) through the PCM decoder in front of an ES8311. Builds (each on current master plus this PR only): * PASS pr/pcm-decode-complete korvo esp32s3-korvo-2:audio (warnings: 0) Testing logs before change: ``` nxplayer hung on exit waiting for AUDIO_MSG_COMPLETE. ``` Testing logs after change: ``` The tone is refused, the error is reported and nxplayer exits normally. ``` ## PR verification Self-Check * [x] This PR introduces only one functional change. * [x] I have updated all required description fields above. * [x] My PR adheres to Contributing Guidelines and Documentation (git commit title and message, coding standard, etc). * [ ] My PR is still work in progress (not ready for review). * [x] My PR is ready for review and can be safely merged into a codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
