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

Commit 00c4d9af authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12478163 from c927de5e to 25Q1-release

Change-Id: Iefc2d46ba236628d85eda653f17f7f8e9b7688af
parents 1465dcfb c927de5e
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -293,6 +293,16 @@ public:
            bool isBitPerfect = false,
            float volume = 0.0f);

    static constexpr std::string_view getLogHeader() {
        using namespace std::literals;
        return "Type     Id Active Client Session Port Id S  Flags "
                        "  Format Chn mask  SRate "
                        "ST Usg CT "
                        " G db  L dB  R dB  VS dB  PortVol dB "
                        "  Server FrmCnt  FrmRdy F Underruns  Flushed BitPerfect InternalMute"
                        "   Latency\n"sv;
    }

    virtual void pause() = 0;
    virtual void flush() = 0;
    virtual audio_stream_type_t streamType() const = 0;
@@ -468,6 +478,11 @@ public:
            audio_port_handle_t portId = AUDIO_PORT_HANDLE_NONE,
            float volume = 0.0f);

    static constexpr std::string_view getLogHeader() {
        using namespace std::literals;
        return "Client Session Port Id   Format Chn mask  SRate Flags Usg/Src PortVol dB\n"sv;
    };

    // protected by MMapThread::mLock
    virtual void setSilenced_l(bool silenced) = 0;
    // protected by MMapThread::mLock
@@ -511,6 +526,13 @@ public:
            audio_port_handle_t portId = AUDIO_PORT_HANDLE_NONE,
            int32_t startFrames = -1);

    static constexpr std::string_view getLogHeader() {
        using namespace std::literals;
        return "Active     Id Client Session Port Id  S  Flags  "
                        " Format Chn mask  SRate Source  "
                        " Server FrmCnt FrmRdy Sil   Latency\n"sv;
    }

    // clear the buffer overflow flag
    virtual void clearOverflow() = 0;
    // set the buffer overflow flag and return previous value
+22 −0
Original line number Diff line number Diff line
@@ -1058,6 +1058,8 @@ void ThreadBase::dump(int fd, const Vector<String16>& args)
    }

    dprintf(fd, "  Local log:\n");
    const auto logHeader = this->getLocalLogHeader();
    write(fd, logHeader.data(), logHeader.length());
    mLocalLog.dump(fd, "   " /* prefix */, 40 /* lines */);

    // --all does the statistics
@@ -5120,6 +5122,12 @@ void PlaybackThread::toAudioPortConfig(struct audio_port_config* config)
    }
}

std::string PlaybackThread::getLocalLogHeader() const {
    using namespace std::literals;
    static constexpr auto indent = "                             "
                                   "                            "sv;
    return std::string{indent}.append(IAfTrack::getLogHeader());
}
// ----------------------------------------------------------------------------

/* static */
@@ -10252,6 +10260,13 @@ void RecordThread::toAudioPortConfig(struct audio_port_config* config)
    }
}

std::string RecordThread::getLocalLogHeader() const {
    using namespace std::literals;
    static constexpr auto indent = "                             "
                                   "                            "sv;
    return std::string{indent}.append(IAfRecordTrack::getLogHeader());
}

// ----------------------------------------------------------------------------
//      Mmap
// ----------------------------------------------------------------------------
@@ -11132,6 +11147,13 @@ void MmapThread::dumpTracks_l(int fd, const Vector<String16>& /* args */)
    write(fd, result.c_str(), result.size());
}

std::string MmapThread::getLocalLogHeader() const {
    using namespace std::literals;
    static constexpr auto indent = "                             "
                                   "                            "sv;
    return std::string{indent}.append(IAfMmapTrack::getLogHeader());
}

/* static */
sp<IAfMmapPlaybackThread> IAfMmapPlaybackThread::create(
        const sp<IAfThreadCallback>& afThreadCallback, audio_io_handle_t id,
+10 −0
Original line number Diff line number Diff line
@@ -576,6 +576,9 @@ public:
        return mThreadloopExecutor;
    }

    // Used to print the header for the local log on a particular thread type
    virtual std::string getLocalLogHeader() const { return {}; };

protected:

                // entry describing an effect being suspended in mSuspendedSessions keyed vector
@@ -1230,6 +1233,9 @@ public:
            override EXCLUDES_ThreadBase_Mutex {
        // Do nothing. It is only used for bit perfect thread
    }

    std::string getLocalLogHeader() const override;

protected:
    // updated by readOutputParameters_l()
    size_t                          mNormalFrameCount;  // normal mixer and effects
@@ -2134,6 +2140,8 @@ public:
                            return !(mInput == nullptr || mInput->stream == nullptr);
                        }

    std::string getLocalLogHeader() const override;

protected:
    void dumpInternals_l(int fd, const Vector<String16>& args) override REQUIRES(mutex());
    void dumpTracks_l(int fd, const Vector<String16>& args) override REQUIRES(mutex());
@@ -2325,6 +2333,8 @@ class MmapThread : public ThreadBase, public virtual IAfMmapThread

    bool isStreamInitialized() const override { return false; }

    std::string getLocalLogHeader() const override;

    void setClientSilencedState_l(audio_port_handle_t portId, bool silenced) REQUIRES(mutex()) {
                                mClientSilencedStates[portId] = silenced;
                            }
+8 −15
Original line number Diff line number Diff line
@@ -1000,13 +1000,8 @@ void Track::destroy()

void Track::appendDumpHeader(String8& result) const
{
    result.appendFormat("Type     Id Active Client Session Port Id S  Flags "
                        "  Format Chn mask  SRate "
                        "ST Usg CT "
                        " G db  L dB  R dB  VS dB  PortVol dB "
                        "  Server FrmCnt  FrmRdy F Underruns  Flushed BitPerfect InternalMute"
                        "%s\n",
                        isServerLatencySupported() ? "   Latency" : "");
    const auto res = IAfTrack::getLogHeader();
    result.append(res.data(), res.size());
}

void Track::appendDump(String8& result, bool active) const
@@ -2989,10 +2984,8 @@ void RecordTrack::invalidate()

void RecordTrack::appendDumpHeader(String8& result) const
{
    result.appendFormat("Active     Id Client Session Port Id  S  Flags  "
                        " Format Chn mask  SRate Source  "
                        " Server FrmCnt FrmRdy Sil%s\n",
                        isServerLatencySupported() ? "   Latency" : "");
    const auto res = IAfRecordTrack::getLogHeader();
    result.append(res.data(), res.size());
}

void RecordTrack::appendDump(String8& result, bool active) const
@@ -3648,8 +3641,8 @@ void MmapTrack::processMuteEvent_l(const sp<IAudioManager>& audioManager, mute_s

void MmapTrack::appendDumpHeader(String8& result) const
{
    result.appendFormat("Client Session Port Id  Format Chn mask  SRate Flags %s  %s\n",
                        isOut() ? "Usg CT": "Source", isOut() ? "PortVol dB" : "");
    const auto res = IAfMmapTrack::getLogHeader();
    result.append(res.data(), res.size());
}

void MmapTrack::appendDump(String8& result, bool active __unused) const
@@ -3663,10 +3656,10 @@ void MmapTrack::appendDump(String8& result, bool active __unused) const
            mSampleRate,
            mAttr.flags);
    if (isOut()) {
        result.appendFormat("%3x %2x", mAttr.usage, mAttr.content_type);
        result.appendFormat("%4x %2x", mAttr.usage, mAttr.content_type);
        result.appendFormat("%11.2g", 20.0 * log10(mVolume));
    } else {
        result.appendFormat("%6x", mAttr.source);
        result.appendFormat("%7x", mAttr.source);
    }
    result.append("\n");
}