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

Commit 26ac6575 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add traces for measure Audio-Haptics latency (SoundPool)" into main

parents cda0cc44 feb9dc08
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.Trace;
import android.util.AndroidRuntimeException;
import android.util.Log;

@@ -314,8 +315,13 @@ public class SoundPool extends PlayerBase {
    public final int play(int soundID, float leftVolume, float rightVolume,
            int priority, int loop, float rate) {
        // FIXME: b/174876164 implement device id for soundpool
        try {
            Trace.traceBegin(Trace.TRACE_TAG_AUDIO, "SoundPool.play");
            baseStart(0);
            return _play(soundID, leftVolume, rightVolume, priority, loop, rate, getPlayerIId());
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_AUDIO);
        }
    }

    /**
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
#include <algorithm>
#include <thread>

#define ATRACE_TAG ATRACE_TAG_AUDIO
#include <utils/Trace.h>

#include "SoundPool.h"

namespace android
@@ -135,8 +138,10 @@ int32_t SoundPool::play(int32_t soundID, float leftVolume, float rightVolume,
        return 0;
    }

    ATRACE_BEGIN("SoundPool::play (native)");
    const int32_t streamID = mStreamManager.queueForPlay(
            sound, soundID, leftVolume, rightVolume, priority, loop, rate, playerIId);
    ATRACE_END();
    ALOGV("%s returned %d", __func__, streamID);

    return streamID;