AK+LibAudio+AudioServer: Silence very noisy debug statements by default

These are spammed quite heavily on the debug console, especially at the
end of audio playback.
This commit is contained in:
Timothy Flynn 2023-06-11 13:26:49 -04:00 committed by Andreas Kling
parent 976d9b32d6
commit 936ec94f81
4 changed files with 9 additions and 2 deletions

View file

@ -10,6 +10,10 @@
# cmakedefine01 AFLACLOADER_DEBUG
#endif
#ifndef AUDIO_DEBUG
# cmakedefine01 AUDIO_DEBUG
#endif
#ifndef AWAVLOADER_DEBUG
# cmakedefine01 AWAVLOADER_DEBUG
#endif

View file

@ -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)

View file

@ -6,6 +6,7 @@
*/
#include <AK/Atomic.h>
#include <AK/Debug.h>
#include <AK/Format.h>
#include <AK/OwnPtr.h>
#include <AK/Time.h>
@ -97,7 +98,7 @@ void ConnectionToServer::custom_event(Core::CustomEvent&)
Array<Sample, AUDIO_BUFFER_SIZE> 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;
}

View file

@ -12,6 +12,7 @@
#include <AK/Atomic.h>
#include <AK/Badge.h>
#include <AK/ByteBuffer.h>
#include <AK/Debug.h>
#include <AK/Queue.h>
#include <AK/RefCounted.h>
#include <AK/WeakPtr.h>
@ -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());