feat: A2DP bluetooth audio working

This commit is contained in:
daniel committed 2026-06-10 16:00:42 +02:00
1 parent 4eb4ba4073
commit e0c8787727
18 files changed
+1312 -4340

No files matched your search

+10
View File
@@ -17,6 +17,7 @@
#include <Sched/Scheduler.hpp>
#include <Drivers/Net/E1000E.hpp>
#include <Drivers/USB/Xhci.hpp>
#include <Drivers/USB/Bluetooth/Bluetooth.hpp>
#include <Drivers/USB/HidKeyboard.hpp>
using namespace Kt;
@@ -211,6 +212,15 @@ namespace Timekeeping {
Drivers::USB::Xhci::ProcessDeferredWork();
}
// Service Bluetooth inbound traffic (the headset's SDP/AVRCP queries,
// AVDTP commands, ACL flow-control credits) whenever a core idles.
// Without this, BT events are only processed while some syscall happens
// to be pumping a wait loop -- a peer that queries us between audio
// writes got silence (observed: Bose re-dialing SDP during playback,
// queries never answered). Self-serializing and a cheap no-op when
// the adapter is down.
Drivers::USB::Bluetooth::ServiceEvents();
if (cpu == nullptr || cpu->cpuIndex != 0 || !g_schedEnabled || g_ticksPerMs == 0) {
// Non-BSP or pre-scheduler fallback: plain HLT keeps the LAPIC
// timer running in C1 on hardware where MWAIT promotes to deeper