diff --git a/AK/Debug.h.in b/AK/Debug.h.in index 9c4525767f..467a6fab32 100644 --- a/AK/Debug.h.in +++ b/AK/Debug.h.in @@ -10,6 +10,10 @@ # cmakedefine01 AFLACLOADER_DEBUG #endif +#ifndef AUDIO_DEBUG +# cmakedefine01 AUDIO_DEBUG +#endif + #ifndef AWAVLOADER_DEBUG # cmakedefine01 AWAVLOADER_DEBUG #endif diff --git a/Meta/CMake/all_the_debug_macros.cmake b/Meta/CMake/all_the_debug_macros.cmake index 8e986fe121..5f956b8c5b 100644 --- a/Meta/CMake/all_the_debug_macros.cmake +++ b/Meta/CMake/all_the_debug_macros.cmake @@ -5,6 +5,7 @@ set(APIC_DEBUG ON) set(APIC_SMP_DEBUG ON) set(ARP_DEBUG ON) set(ATA_DEBUG ON) +set(AUDIO_DEBUG ON) set(AWAVLOADER_DEBUG ON) set(AFLACLOADER_DEBUG ON) set(BBFS_DEBUG ON) diff --git a/Userland/Libraries/LibAudio/ConnectionToServer.cpp b/Userland/Libraries/LibAudio/ConnectionToServer.cpp index 306a0fc3d3..8ca968a144 100644 --- a/Userland/Libraries/LibAudio/ConnectionToServer.cpp +++ b/Userland/Libraries/LibAudio/ConnectionToServer.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -97,7 +98,7 @@ void ConnectionToServer::custom_event(Core::CustomEvent&) Array next_chunk; while (true) { if (m_user_queue->is_empty()) { - dbgln("Reached end of provided audio data, going to sleep"); + dbgln_if(AUDIO_DEBUG, "Reached end of provided audio data, going to sleep"); break; } diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h index 0d5ec8b65d..a3aa8ea996 100644 --- a/Userland/Services/AudioServer/Mixer.h +++ b/Userland/Services/AudioServer/Mixer.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ public: auto result = m_buffer->dequeue(); if (result.is_error()) { if (result.error() == Audio::AudioQueue::QueueStatus::Empty) { - dbgln("Audio client {} can't keep up!", m_client->client_id()); + dbgln_if(AUDIO_DEBUG, "Audio client {} can't keep up!", m_client->client_id()); // Note: Even though we only check client state here, we will probably close the client much earlier. if (!m_client->is_open()) { dbgln("Client socket {} has closed, closing audio server connection.", m_client->client_id());