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

Commit 90aa89fe authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge "AudioFlinger: PatchPanel: prioritize quality vs latency for FM Bridge"...

Merge "AudioFlinger: PatchPanel: prioritize quality vs latency for FM Bridge" am: d621f14f am: 77e63f79 am: 33099974 am: d03b7b48

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1697167

Change-Id: I70252737d040e332c14fdc3427de7052b362c0b7
parents 63697e06 d03b7b48
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -575,6 +575,12 @@ status_t AudioFlinger::PatchPanel::Patch::createConnections(PatchPanel *panel)

    // create a special playback track to render to playback thread.
    // this track is given the same buffer as the PatchRecord buffer

    // Default behaviour is to start as soon as possible to have the lowest possible latency even if
    // it might glitch.
    // Disable this behavior for FM Tuner source if no fast capture/mixer available.
    const bool isFmBridge = mAudioPatch.sources[0].ext.device.type == AUDIO_DEVICE_IN_FM_TUNER;
    const size_t frameCountToBeReady = isFmBridge && !usePassthruPatchRecord ? frameCount / 4 : 1;
    sp<PlaybackThread::PatchTrack> tempPatchTrack = new PlaybackThread::PatchTrack(
                                           mPlayback.thread().get(),
                                           streamType,
@@ -584,7 +590,9 @@ status_t AudioFlinger::PatchPanel::Patch::createConnections(PatchPanel *panel)
                                           frameCount,
                                           tempRecordTrack->buffer(),
                                           tempRecordTrack->bufferSize(),
                                           outputFlags);
                                           outputFlags,
                                           {} /*timeout*/,
                                           frameCountToBeReady);
    status = mPlayback.checkTrack(tempPatchTrack.get());
    if (status != NO_ERROR) {
        return status;