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

Commit 973db02a authored by Eric Laurent's avatar Eric Laurent
Browse files

audio flinger: return port ID as track ID to client

Return the port ID allocated by audio policy manager instead of the
internal track ID allocated by audio flinger when an AudioTrack or
AudioRecord is created.
This information is more useful for logs and allows to associate information coming
from audiopolicy manager with a specific client instance.

Bug: 111438757
Test: Manual playback and capture tests
Change-Id: Ib467d8fcc34d9a8aa7bcaac0770a741982b847c5
parent f4a342ab
Loading
Loading
Loading
Loading
+32 −32
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ AudioRecord::~AudioRecord()
        mBufferMemory.clear();
        mBufferMemory.clear();
        IPCThreadState::self()->flushCommands();
        IPCThreadState::self()->flushCommands();
        ALOGV("%s(%d): releasing session id %d",
        ALOGV("%s(%d): releasing session id %d",
                __func__, mId, mSessionId);
                __func__, mPortId, mSessionId);
        AudioSystem::releaseAudioSessionId(mSessionId, -1 /*pid*/);
        AudioSystem::releaseAudioSessionId(mSessionId, -1 /*pid*/);
    }
    }
}
}
@@ -239,7 +239,7 @@ status_t AudioRecord::set(
    pid_t callingPid;
    pid_t callingPid;
    pid_t myPid;
    pid_t myPid;


    // Note mId is not valid until the track is created, so omit mId in ALOG for set.
    // Note mPortId is not valid until the track is created, so omit mPortId in ALOG for set.
    ALOGV("%s(): inputSource %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, "
    ALOGV("%s(): inputSource %d, sampleRate %u, format %#x, channelMask %#x, frameCount %zu, "
          "notificationFrames %u, sessionId %d, transferType %d, flags %#x, opPackageName %s "
          "notificationFrames %u, sessionId %d, transferType %d, flags %#x, opPackageName %s "
          "uid %d, pid %d",
          "uid %d, pid %d",
@@ -356,7 +356,7 @@ status_t AudioRecord::set(
    // create the IAudioRecord
    // create the IAudioRecord
    status = createRecord_l(0 /*epoch*/, mOpPackageName);
    status = createRecord_l(0 /*epoch*/, mOpPackageName);


    ALOGV("%s(%d): status %d", __func__, mId, status);
    ALOGV("%s(%d): status %d", __func__, mPortId, status);


    if (status != NO_ERROR) {
    if (status != NO_ERROR) {
        if (mAudioRecordThread != 0) {
        if (mAudioRecordThread != 0) {
@@ -393,7 +393,7 @@ exit:


status_t AudioRecord::start(AudioSystem::sync_event_t event, audio_session_t triggerSession)
status_t AudioRecord::start(AudioSystem::sync_event_t event, audio_session_t triggerSession)
{
{
    ALOGV("%s(%d): sync event %d trigger session %d", __func__, mId, event, triggerSession);
    ALOGV("%s(%d): sync event %d trigger session %d", __func__, mPortId, event, triggerSession);


    AutoMutex lock(mLock);
    AutoMutex lock(mLock);
    if (mActive) {
    if (mActive) {
@@ -434,7 +434,7 @@ status_t AudioRecord::start(AudioSystem::sync_event_t event, audio_session_t tri


    if (status != NO_ERROR) {
    if (status != NO_ERROR) {
        mActive = false;
        mActive = false;
        ALOGE("%s(%d): status %d", __func__, mId, status);
        ALOGE("%s(%d): status %d", __func__, mPortId, status);
    } else {
    } else {
        sp<AudioRecordThread> t = mAudioRecordThread;
        sp<AudioRecordThread> t = mAudioRecordThread;
        if (t != 0) {
        if (t != 0) {
@@ -458,7 +458,7 @@ status_t AudioRecord::start(AudioSystem::sync_event_t event, audio_session_t tri
void AudioRecord::stop()
void AudioRecord::stop()
{
{
    AutoMutex lock(mLock);
    AutoMutex lock(mLock);
    ALOGV("%s(%d): mActive:%d\n", __func__, mId, mActive);
    ALOGV("%s(%d): mActive:%d\n", __func__, mPortId, mActive);
    if (!mActive) {
    if (!mActive) {
        return;
        return;
    }
    }
@@ -638,7 +638,7 @@ status_t AudioRecord::dump(int fd, const Vector<String16>& args __unused) const


    result.append(" AudioRecord::dump\n");
    result.append(" AudioRecord::dump\n");
    result.appendFormat("  id(%d) status(%d), active(%d), session Id(%d)\n",
    result.appendFormat("  id(%d) status(%d), active(%d), session Id(%d)\n",
                        mId, mStatus, mActive, mSessionId);
                        mPortId, mStatus, mActive, mSessionId);
    result.appendFormat("  flags(%#x), req. flags(%#x), audio source(%d)\n",
    result.appendFormat("  flags(%#x), req. flags(%#x), audio source(%d)\n",
                        mFlags, mOrigFlags, mAttributes.source);
                        mFlags, mOrigFlags, mAttributes.source);
    result.appendFormat("  format(%#x), channel mask(%#x), channel count(%u), sample rate(%u)\n",
    result.appendFormat("  format(%#x), channel mask(%#x), channel count(%u), sample rate(%u)\n",
@@ -680,7 +680,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    status_t status;
    status_t status;


    if (audioFlinger == 0) {
    if (audioFlinger == 0) {
        ALOGE("%s(%d): Could not get audioflinger", __func__, mId);
        ALOGE("%s(%d): Could not get audioflinger", __func__, mPortId);
        status = NO_INIT;
        status = NO_INIT;
        goto exit;
        goto exit;
    }
    }
@@ -708,7 +708,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
            (mTransfer == TRANSFER_OBTAIN);
            (mTransfer == TRANSFER_OBTAIN);
        if (!useCaseAllowed) {
        if (!useCaseAllowed) {
            ALOGW("%s(%d): AUDIO_INPUT_FLAG_FAST denied, incompatible transfer = %s",
            ALOGW("%s(%d): AUDIO_INPUT_FLAG_FAST denied, incompatible transfer = %s",
                  __func__, mId,
                  __func__, mPortId,
                  convertTransferToText(mTransfer));
                  convertTransferToText(mTransfer));
            mFlags = (audio_input_flags_t) (mFlags & ~(AUDIO_INPUT_FLAG_FAST |
            mFlags = (audio_input_flags_t) (mFlags & ~(AUDIO_INPUT_FLAG_FAST |
                    AUDIO_INPUT_FLAG_RAW));
                    AUDIO_INPUT_FLAG_RAW));
@@ -744,7 +744,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String


    if (status != NO_ERROR) {
    if (status != NO_ERROR) {
        ALOGE("%s(%d): AudioFlinger could not create record track, status: %d",
        ALOGE("%s(%d): AudioFlinger could not create record track, status: %d",
              __func__, mId, status);
              __func__, mPortId, status);
        goto exit;
        goto exit;
    }
    }
    ALOG_ASSERT(record != 0);
    ALOG_ASSERT(record != 0);
@@ -755,7 +755,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    mAwaitBoost = false;
    mAwaitBoost = false;
    if (output.flags & AUDIO_INPUT_FLAG_FAST) {
    if (output.flags & AUDIO_INPUT_FLAG_FAST) {
        ALOGI("%s(%d): AUDIO_INPUT_FLAG_FAST successful; frameCount %zu -> %zu",
        ALOGI("%s(%d): AUDIO_INPUT_FLAG_FAST successful; frameCount %zu -> %zu",
              __func__, mId,
              __func__, mPortId,
              mReqFrameCount, output.frameCount);
              mReqFrameCount, output.frameCount);
        mAwaitBoost = true;
        mAwaitBoost = true;
    }
    }
@@ -765,13 +765,13 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    mSampleRate = output.sampleRate;
    mSampleRate = output.sampleRate;


    if (output.cblk == 0) {
    if (output.cblk == 0) {
        ALOGE("%s(%d): Could not get control block", __func__, mId);
        ALOGE("%s(%d): Could not get control block", __func__, mPortId);
        status = NO_INIT;
        status = NO_INIT;
        goto exit;
        goto exit;
    }
    }
    iMemPointer = output.cblk ->pointer();
    iMemPointer = output.cblk ->pointer();
    if (iMemPointer == NULL) {
    if (iMemPointer == NULL) {
        ALOGE("%s(%d): Could not get control block pointer", __func__, mId);
        ALOGE("%s(%d): Could not get control block pointer", __func__, mPortId);
        status = NO_INIT;
        status = NO_INIT;
        goto exit;
        goto exit;
    }
    }
@@ -786,7 +786,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    } else {
    } else {
        buffers = output.buffers->pointer();
        buffers = output.buffers->pointer();
        if (buffers == NULL) {
        if (buffers == NULL) {
            ALOGE("%s(%d): Could not get buffer pointer", __func__, mId);
            ALOGE("%s(%d): Could not get buffer pointer", __func__, mPortId);
            status = NO_INIT;
            status = NO_INIT;
            goto exit;
            goto exit;
        }
        }
@@ -800,14 +800,14 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    mAudioRecord = record;
    mAudioRecord = record;
    mCblkMemory = output.cblk;
    mCblkMemory = output.cblk;
    mBufferMemory = output.buffers;
    mBufferMemory = output.buffers;
    mId = output.trackId;
    mPortId = output.portId;
    IPCThreadState::self()->flushCommands();
    IPCThreadState::self()->flushCommands();


    mCblk = cblk;
    mCblk = cblk;
    // note that output.frameCount is the (possibly revised) value of mReqFrameCount
    // note that output.frameCount is the (possibly revised) value of mReqFrameCount
    if (output.frameCount < mReqFrameCount || (mReqFrameCount == 0 && output.frameCount == 0)) {
    if (output.frameCount < mReqFrameCount || (mReqFrameCount == 0 && output.frameCount == 0)) {
        ALOGW("%s(%d): Requested frameCount %zu but received frameCount %zu",
        ALOGW("%s(%d): Requested frameCount %zu but received frameCount %zu",
              __func__, mId,
              __func__, mPortId,
              mReqFrameCount,  output.frameCount);
              mReqFrameCount,  output.frameCount);
    }
    }


@@ -815,7 +815,7 @@ status_t AudioRecord::createRecord_l(const Modulo<uint32_t> &epoch, const String
    // The computation is done on server side.
    // The computation is done on server side.
    if (mNotificationFramesReq > 0 && output.notificationFrameCount != mNotificationFramesReq) {
    if (mNotificationFramesReq > 0 && output.notificationFrameCount != mNotificationFramesReq) {
        ALOGW("%s(%d): Server adjusted notificationFrames from %u to %zu for frameCount %zu",
        ALOGW("%s(%d): Server adjusted notificationFrames from %u to %zu for frameCount %zu",
                __func__, mId,
                __func__, mPortId,
                mNotificationFramesReq, output.notificationFrameCount, output.frameCount);
                mNotificationFramesReq, output.notificationFrameCount, output.frameCount);
    }
    }
    mNotificationFramesAct = (uint32_t)output.notificationFrameCount;
    mNotificationFramesAct = (uint32_t)output.notificationFrameCount;
@@ -883,7 +883,7 @@ status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, int32_t waitCount, size_
        timeout.tv_nsec = (long) (ms % 1000) * 1000000;
        timeout.tv_nsec = (long) (ms % 1000) * 1000000;
        requested = &timeout;
        requested = &timeout;
    } else {
    } else {
        ALOGE("%s(%d): invalid waitCount %d", __func__, mId, waitCount);
        ALOGE("%s(%d): invalid waitCount %d", __func__, mPortId, waitCount);
        requested = NULL;
        requested = NULL;
    }
    }
    return obtainBuffer(audioBuffer, requested, NULL /*elapsed*/, nonContig);
    return obtainBuffer(audioBuffer, requested, NULL /*elapsed*/, nonContig);
@@ -993,7 +993,7 @@ ssize_t AudioRecord::read(void* buffer, size_t userSize, bool blocking)
        // sanity-check. user is most-likely passing an error code, and it would
        // sanity-check. user is most-likely passing an error code, and it would
        // make the return value ambiguous (actualSize vs error).
        // make the return value ambiguous (actualSize vs error).
        ALOGE("%s(%d) (buffer=%p, size=%zu (%zu)",
        ALOGE("%s(%d) (buffer=%p, size=%zu (%zu)",
                __func__, mId, buffer, userSize, userSize);
                __func__, mPortId, buffer, userSize, userSize);
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }


@@ -1050,7 +1050,7 @@ nsecs_t AudioRecord::processAudioBuffer()
            pollUs <<= 1;
            pollUs <<= 1;
        } while (tryCounter-- > 0);
        } while (tryCounter-- > 0);
        if (tryCounter < 0) {
        if (tryCounter < 0) {
            ALOGE("%s(%d): did not receive expected priority boost on time", __func__, mId);
            ALOGE("%s(%d): did not receive expected priority boost on time", __func__, mPortId);
        }
        }
        // Run again immediately
        // Run again immediately
        return 0;
        return 0;
@@ -1174,7 +1174,7 @@ nsecs_t AudioRecord::processAudioBuffer()
        timeout.tv_sec = ns / 1000000000LL;
        timeout.tv_sec = ns / 1000000000LL;
        timeout.tv_nsec = ns % 1000000000LL;
        timeout.tv_nsec = ns % 1000000000LL;
        ALOGV("%s(%d): timeout %ld.%03d",
        ALOGV("%s(%d): timeout %ld.%03d",
                __func__, mId, timeout.tv_sec, (int) timeout.tv_nsec / 1000000);
                __func__, mPortId, timeout.tv_sec, (int) timeout.tv_nsec / 1000000);
        requested = &timeout;
        requested = &timeout;
    }
    }


@@ -1187,17 +1187,17 @@ nsecs_t AudioRecord::processAudioBuffer()
        status_t err = obtainBuffer(&audioBuffer, requested, NULL, &nonContig);
        status_t err = obtainBuffer(&audioBuffer, requested, NULL, &nonContig);
        LOG_ALWAYS_FATAL_IF((err != NO_ERROR) != (audioBuffer.frameCount == 0),
        LOG_ALWAYS_FATAL_IF((err != NO_ERROR) != (audioBuffer.frameCount == 0),
                "%s(%d): obtainBuffer() err=%d frameCount=%zu",
                "%s(%d): obtainBuffer() err=%d frameCount=%zu",
                __func__, mId, err, audioBuffer.frameCount);
                __func__, mPortId, err, audioBuffer.frameCount);
        requested = &ClientProxy::kNonBlocking;
        requested = &ClientProxy::kNonBlocking;
        size_t avail = audioBuffer.frameCount + nonContig;
        size_t avail = audioBuffer.frameCount + nonContig;
        ALOGV("%s(%d): obtainBuffer(%u) returned %zu = %zu + %zu err %d",
        ALOGV("%s(%d): obtainBuffer(%u) returned %zu = %zu + %zu err %d",
                __func__, mId, mRemainingFrames, avail, audioBuffer.frameCount, nonContig, err);
                __func__, mPortId, mRemainingFrames, avail, audioBuffer.frameCount, nonContig, err);
        if (err != NO_ERROR) {
        if (err != NO_ERROR) {
            if (err == TIMED_OUT || err == WOULD_BLOCK || err == -EINTR) {
            if (err == TIMED_OUT || err == WOULD_BLOCK || err == -EINTR) {
                break;
                break;
            }
            }
            ALOGE("%s(%d): Error %d obtaining an audio buffer, giving up.",
            ALOGE("%s(%d): Error %d obtaining an audio buffer, giving up.",
                    __func__, mId, err);
                    __func__, mPortId, err);
            return NS_NEVER;
            return NS_NEVER;
        }
        }


@@ -1220,7 +1220,7 @@ nsecs_t AudioRecord::processAudioBuffer()
        // Sanity check on returned size
        // Sanity check on returned size
        if (ssize_t(readSize) < 0 || readSize > reqSize) {
        if (ssize_t(readSize) < 0 || readSize > reqSize) {
            ALOGE("%s(%d):  EVENT_MORE_DATA requested %zu bytes but callback returned %zd bytes",
            ALOGE("%s(%d):  EVENT_MORE_DATA requested %zu bytes but callback returned %zd bytes",
                    __func__, mId, reqSize, ssize_t(readSize));
                    __func__, mPortId, reqSize, ssize_t(readSize));
            return NS_NEVER;
            return NS_NEVER;
        }
        }


@@ -1280,7 +1280,7 @@ nsecs_t AudioRecord::processAudioBuffer()


status_t AudioRecord::restoreRecord_l(const char *from)
status_t AudioRecord::restoreRecord_l(const char *from)
{
{
    ALOGW("%s(%d): dead IAudioRecord, creating a new one from %s()", __func__, mId, from);
    ALOGW("%s(%d): dead IAudioRecord, creating a new one from %s()", __func__, mPortId, from);
    ++mSequence;
    ++mSequence;


    const int INITIAL_RETRIES = 3;
    const int INITIAL_RETRIES = 3;
@@ -1311,7 +1311,7 @@ retry:
    }
    }


    if (result != NO_ERROR) {
    if (result != NO_ERROR) {
        ALOGW("%s(%d): failed status %d, retries %d", __func__, mId, result, retries);
        ALOGW("%s(%d): failed status %d, retries %d", __func__, mPortId, result, retries);
        if (--retries > 0) {
        if (--retries > 0) {
            // leave time for an eventual race condition to clear before retrying
            // leave time for an eventual race condition to clear before retrying
            usleep(500000);
            usleep(500000);
@@ -1330,18 +1330,18 @@ retry:
status_t AudioRecord::addAudioDeviceCallback(const sp<AudioSystem::AudioDeviceCallback>& callback)
status_t AudioRecord::addAudioDeviceCallback(const sp<AudioSystem::AudioDeviceCallback>& callback)
{
{
    if (callback == 0) {
    if (callback == 0) {
        ALOGW("%s(%d): adding NULL callback!", __func__, mId);
        ALOGW("%s(%d): adding NULL callback!", __func__, mPortId);
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }
    AutoMutex lock(mLock);
    AutoMutex lock(mLock);
    if (mDeviceCallback.unsafe_get() == callback.get()) {
    if (mDeviceCallback.unsafe_get() == callback.get()) {
        ALOGW("%s(%d): adding same callback!", __func__, mId);
        ALOGW("%s(%d): adding same callback!", __func__, mPortId);
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }
    status_t status = NO_ERROR;
    status_t status = NO_ERROR;
    if (mInput != AUDIO_IO_HANDLE_NONE) {
    if (mInput != AUDIO_IO_HANDLE_NONE) {
        if (mDeviceCallback != 0) {
        if (mDeviceCallback != 0) {
            ALOGW("%s(%d): callback already present!", __func__, mId);
            ALOGW("%s(%d): callback already present!", __func__, mPortId);
            AudioSystem::removeAudioDeviceCallback(this, mInput);
            AudioSystem::removeAudioDeviceCallback(this, mInput);
        }
        }
        status = AudioSystem::addAudioDeviceCallback(this, mInput);
        status = AudioSystem::addAudioDeviceCallback(this, mInput);
@@ -1354,12 +1354,12 @@ status_t AudioRecord::removeAudioDeviceCallback(
        const sp<AudioSystem::AudioDeviceCallback>& callback)
        const sp<AudioSystem::AudioDeviceCallback>& callback)
{
{
    if (callback == 0) {
    if (callback == 0) {
        ALOGW("%s(%d): removing NULL callback!", __func__, mId);
        ALOGW("%s(%d): removing NULL callback!", __func__, mPortId);
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }
    AutoMutex lock(mLock);
    AutoMutex lock(mLock);
    if (mDeviceCallback.unsafe_get() != callback.get()) {
    if (mDeviceCallback.unsafe_get() != callback.get()) {
        ALOGW("%s(%d): removing different callback!", __func__, mId);
        ALOGW("%s(%d): removing different callback!", __func__, mPortId);
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }
    mDeviceCallback.clear();
    mDeviceCallback.clear();
+73 −68

File changed.

Preview size limit exceeded, changes collapsed.

+10 −4
Original line number Original line Diff line number Diff line
@@ -534,6 +534,12 @@ public:
     */
     */
            status_t    getActiveMicrophones(std::vector<media::MicrophoneInfo>* activeMicrophones);
            status_t    getActiveMicrophones(std::vector<media::MicrophoneInfo>* activeMicrophones);


     /* Get the unique port ID assigned to this AudioRecord instance by audio policy manager.
      * The ID is unique across all audioserver clients and can change during the life cycle
      * of a given AudioRecord instance if the connection to audioserver is restored.
      */
            audio_port_handle_t getPortId() const { return mPortId; };

     /*
     /*
      * Dumps the state of an audio record.
      * Dumps the state of an audio record.
      */
      */
@@ -654,7 +660,7 @@ private:
    audio_input_flags_t     mOrigFlags;             // as specified in constructor or set(), const
    audio_input_flags_t     mOrigFlags;             // as specified in constructor or set(), const


    audio_session_t         mSessionId;
    audio_session_t         mSessionId;
    int                     mId;                    // Id from AudioFlinger
    audio_port_handle_t     mPortId;                    // Id from Audio Policy Manager
    transfer_type           mTransfer;
    transfer_type           mTransfer;


    // Next 5 fields may be changed if IAudioRecord is re-created, but always != 0
    // Next 5 fields may be changed if IAudioRecord is re-created, but always != 0
+9 −2
Original line number Original line Diff line number Diff line
@@ -912,6 +912,13 @@ public:
                AutoMutex lock(mLock);
                AutoMutex lock(mLock);
                return mState == STATE_ACTIVE || mState == STATE_STOPPING;
                return mState == STATE_ACTIVE || mState == STATE_STOPPING;
            }
            }

    /* Get the unique port ID assigned to this AudioTrack instance by audio policy manager.
     * The ID is unique across all audioserver clients and can change during the life cycle
     * of a given AudioTrack instance if the connection to audioserver is restored.
     */
            audio_port_handle_t getPortId() const { return mPortId; };

 protected:
 protected:
    /* copying audio tracks is not allowed */
    /* copying audio tracks is not allowed */
                        AudioTrack(const AudioTrack& other);
                        AudioTrack(const AudioTrack& other);
@@ -1166,7 +1173,7 @@ protected:


    audio_session_t         mSessionId;
    audio_session_t         mSessionId;
    int                     mAuxEffectId;
    int                     mAuxEffectId;
    int                     mId;                    // Id from AudioFlinger.
    audio_port_handle_t     mPortId;                    // Id from Audio Policy Manager


    mutable Mutex           mLock;
    mutable Mutex           mLock;


+6 −6
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ public:
            afSampleRate = parcel->readInt64();
            afSampleRate = parcel->readInt64();
            afLatencyMs = parcel->readInt32();
            afLatencyMs = parcel->readInt32();
            (void)parcel->read(&outputId, sizeof(audio_io_handle_t));
            (void)parcel->read(&outputId, sizeof(audio_io_handle_t));
            (void)parcel->readInt32(&trackId);
            (void)parcel->read(&portId, sizeof(audio_port_handle_t));
            return NO_ERROR;
            return NO_ERROR;
        }
        }


@@ -164,7 +164,7 @@ public:
            (void)parcel->writeInt64(afSampleRate);
            (void)parcel->writeInt64(afSampleRate);
            (void)parcel->writeInt32(afLatencyMs);
            (void)parcel->writeInt32(afLatencyMs);
            (void)parcel->write(&outputId, sizeof(audio_io_handle_t));
            (void)parcel->write(&outputId, sizeof(audio_io_handle_t));
            (void)parcel->writeInt32(trackId);
            (void)parcel->write(&portId, sizeof(audio_port_handle_t));
            return NO_ERROR;
            return NO_ERROR;
        }
        }


@@ -181,7 +181,7 @@ public:
        uint32_t afSampleRate;
        uint32_t afSampleRate;
        uint32_t afLatencyMs;
        uint32_t afLatencyMs;
        audio_io_handle_t outputId;
        audio_io_handle_t outputId;
        int32_t trackId;
        audio_port_handle_t portId;
    };
    };


    /* CreateRecordInput contains all input arguments sent by AudioRecord to AudioFlinger
    /* CreateRecordInput contains all input arguments sent by AudioRecord to AudioFlinger
@@ -274,7 +274,7 @@ public:
                    return BAD_VALUE;
                    return BAD_VALUE;
                }
                }
            }
            }
            (void)parcel->readInt32(&trackId);
            (void)parcel->read(&portId, sizeof(audio_port_handle_t));
            return NO_ERROR;
            return NO_ERROR;
        }
        }


@@ -301,7 +301,7 @@ public:
            } else {
            } else {
                (void)parcel->writeInt32(0);
                (void)parcel->writeInt32(0);
            }
            }
            (void)parcel->writeInt32(trackId);
            (void)parcel->write(&portId, sizeof(audio_port_handle_t));


            return NO_ERROR;
            return NO_ERROR;
        }
        }
@@ -318,7 +318,7 @@ public:
        audio_io_handle_t inputId;
        audio_io_handle_t inputId;
        sp<IMemory> cblk;
        sp<IMemory> cblk;
        sp<IMemory> buffers;
        sp<IMemory> buffers;
        int32_t trackId;
        audio_port_handle_t portId;
    };
    };


    // invariant on exit for all APIs that return an sp<>:
    // invariant on exit for all APIs that return an sp<>:
Loading