From 09abc534f3df39c2796fbd59b8be9adffd90b111 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 21 Oct 2024 13:24:08 -0400 Subject: [PATCH] HDA: Adjust printing of stream status in stream_handle_interrupt. Just print the whole status in the "stream buffer not completed", that way we won't have multiple lines printed when errors occur here. See #19196. --- .../kernel/drivers/audio/hda/hda_controller.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp index ca743d4e7a..49e2e9aa35 100644 --- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp +++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp @@ -272,6 +272,12 @@ stream_handle_interrupt(hda_controller* controller, hda_stream* stream, stream->Write8(HDAC_STREAM_STATUS, status); + if ((status & STATUS_BUFFER_COMPLETED) == 0) { + dprintf("hda: stream buffer not completed (id: %" B_PRIu32 ", " + "status 0x%" B_PRIx32 ")\n", stream->id, status); + return false; + } + if ((status & STATUS_FIFO_ERROR) != 0) dprintf("hda: stream fifo error (id:%" B_PRIu32 ")\n", stream->id); if ((status & STATUS_DESCRIPTOR_ERROR) != 0) { @@ -279,12 +285,6 @@ stream_handle_interrupt(hda_controller* controller, hda_stream* stream, stream->id); } - if ((status & STATUS_BUFFER_COMPLETED) == 0) { - dprintf("hda: stream buffer not completed (id:%" B_PRIu32 ")\n", - stream->id); - return false; - } - // Normally we should use the DMA position for the stream. Apparently there // are broken chipsets, which don't support it correctly. If we detect this, // we switch to using the LPIB instead. The link position is ahead of the