Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 626a80cf authored by Philip Cuadra's avatar Philip Cuadra
Browse files

Bluetooth - Add tracing for TX queue and LDAC ABR

For debugging, add tracing to show the length of the TX queue and the
LDAC ABR level.

Test:  Ran bluetooth, took a systrace

Change-Id: Ia23764d68f27ae8209e37c4a0836852d73cf6cbc
parent d8e815c2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
 ******************************************************************************/

#define LOG_TAG "bt_btif_a2dp_source"
#define ATRACE_TAG ATRACE_TAG_AUDIO

#include <base/logging.h>
#include <cutils/trace.h>
#include <limits.h>
#include <string.h>
#include <algorithm>
@@ -660,10 +662,11 @@ static void btif_a2dp_source_audio_handle_timer(UNUSED_ATTR void* context) {

  if (alarm_is_scheduled(btif_a2dp_source_cb.media_alarm)) {
    CHECK(btif_a2dp_source_cb.encoder_interface != NULL);
    if (btif_a2dp_source_cb.encoder_interface->set_transmit_queue_length !=
        NULL) {
    size_t transmit_queue_length =
        fixed_queue_length(btif_a2dp_source_cb.tx_audio_queue);
    ATRACE_INT("btif TX queue", transmit_queue_length);
    if (btif_a2dp_source_cb.encoder_interface->set_transmit_queue_length !=
        NULL) {
      btif_a2dp_source_cb.encoder_interface->set_transmit_queue_length(
          transmit_queue_length);
    }
+1 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ cc_test {
    srcs: ["test/stack_a2dp_test.cc"],
    shared_libs: [
        "liblog",
        "libcutils",
    ],
    static_libs: [
        "libbt-stack",
+3 −0
Original line number Diff line number Diff line
@@ -15,9 +15,11 @@
 */

#define LOG_TAG "a2dp_vendor_ldac_encoder"
#define ATRACE_TAG ATRACE_TAG_AUDIO

#include "a2dp_vendor_ldac_encoder.h"

#include <cutils/trace.h>
#include <dlfcn.h>
#include <inttypes.h>
#include <stdio.h>
@@ -545,6 +547,7 @@ void a2dp_vendor_ldac_send_frames(uint64_t timestamp_us) {
                             a2dp_ldac_encoder_cb.TxQueueLength, flag_enable);
      if (prev_eqmid != a2dp_ldac_encoder_cb.last_ldac_abr_eqmid)
        a2dp_ldac_encoder_cb.ldac_abr_adjustments++;
      ATRACE_INT("LDAC ABR level", a2dp_ldac_encoder_cb.last_ldac_abr_eqmid);
    }
    // Transcode frame and enqueue
    a2dp_ldac_encode_frames(nb_frame);