Loading media/libaaudio/src/binding/AAudioServiceMessage.h +6 −3 Original line number Diff line number Diff line Loading @@ -38,14 +38,17 @@ typedef enum aaudio_service_event_e : uint32_t { AAUDIO_SERVICE_EVENT_FLUSHED, AAUDIO_SERVICE_EVENT_CLOSED, AAUDIO_SERVICE_EVENT_DISCONNECTED, AAUDIO_SERVICE_EVENT_VOLUME AAUDIO_SERVICE_EVENT_VOLUME, AAUDIO_SERVICE_EVENT_XRUN } aaudio_service_event_t; struct AAudioMessageEvent { aaudio_service_event_t event; union { double dataDouble; int64_t dataLong; }; }; typedef struct AAudioServiceMessage_s { enum class code : uint32_t { Loading media/libaaudio/src/client/AudioStreamInternal.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -492,6 +492,9 @@ aaudio_result_t AudioStreamInternal::onEventFromServer(AAudioServiceMessage *mes doSetVolume(); ALOGD("%s - AAUDIO_SERVICE_EVENT_VOLUME %lf", __func__, message->event.dataDouble); break; case AAUDIO_SERVICE_EVENT_XRUN: mXRunCount = static_cast<int32_t>(message->event.dataLong); break; default: ALOGE("%s - Unrecognized event = %d", __func__, (int) message->event.event); break; Loading media/libaaudio/src/client/AudioStreamInternalCapture.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ aaudio_result_t AudioStreamInternalCapture::processDataNow(void *buffer, int32_t } // If the write index passed the read index then consider it an overrun. if (mAudioEndpoint.getEmptyFramesAvailable() < 0) { // For shared streams, the xRunCount is passed up from the service. if (mAudioEndpoint.isFreeRunning() && mAudioEndpoint.getEmptyFramesAvailable() < 0) { mXRunCount++; if (ATRACE_ENABLED()) { ATRACE_INT("aaOverRuns", mXRunCount); Loading media/libaaudio/src/client/AudioStreamInternalPlay.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ aaudio_result_t AudioStreamInternalPlay::processDataNow(void *buffer, int32_t nu } // If the read index passed the write index then consider it an underrun. if (mAudioEndpoint.getFullFramesAvailable() < 0) { // For shared streams, the xRunCount is passed up from the service. if (mAudioEndpoint.isFreeRunning() && mAudioEndpoint.getFullFramesAvailable() < 0) { mXRunCount++; if (ATRACE_ENABLED()) { ATRACE_INT("aaUnderRuns", mXRunCount); Loading services/oboeservice/AAudioMixer.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ void AAudioMixer::clear() { memset(mOutputBuffer, 0, mBufferSizeInBytes); } bool AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { int32_t AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { WrappingBuffer wrappingBuffer; float *destination = mOutputBuffer; Loading Loading @@ -105,7 +105,7 @@ bool AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { ATRACE_END(); #endif /* AAUDIO_MIXER_ATRACE_ENABLED */ return (framesLeft > 0); // did not get all the frames we needed, ie. "underflow" return (framesDesired - framesLeft); // framesRead } void AAudioMixer::mixPart(float *destination, float *source, int32_t numFrames) { Loading Loading
media/libaaudio/src/binding/AAudioServiceMessage.h +6 −3 Original line number Diff line number Diff line Loading @@ -38,14 +38,17 @@ typedef enum aaudio_service_event_e : uint32_t { AAUDIO_SERVICE_EVENT_FLUSHED, AAUDIO_SERVICE_EVENT_CLOSED, AAUDIO_SERVICE_EVENT_DISCONNECTED, AAUDIO_SERVICE_EVENT_VOLUME AAUDIO_SERVICE_EVENT_VOLUME, AAUDIO_SERVICE_EVENT_XRUN } aaudio_service_event_t; struct AAudioMessageEvent { aaudio_service_event_t event; union { double dataDouble; int64_t dataLong; }; }; typedef struct AAudioServiceMessage_s { enum class code : uint32_t { Loading
media/libaaudio/src/client/AudioStreamInternal.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -492,6 +492,9 @@ aaudio_result_t AudioStreamInternal::onEventFromServer(AAudioServiceMessage *mes doSetVolume(); ALOGD("%s - AAUDIO_SERVICE_EVENT_VOLUME %lf", __func__, message->event.dataDouble); break; case AAUDIO_SERVICE_EVENT_XRUN: mXRunCount = static_cast<int32_t>(message->event.dataLong); break; default: ALOGE("%s - Unrecognized event = %d", __func__, (int) message->event.event); break; Loading
media/libaaudio/src/client/AudioStreamInternalCapture.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,8 @@ aaudio_result_t AudioStreamInternalCapture::processDataNow(void *buffer, int32_t } // If the write index passed the read index then consider it an overrun. if (mAudioEndpoint.getEmptyFramesAvailable() < 0) { // For shared streams, the xRunCount is passed up from the service. if (mAudioEndpoint.isFreeRunning() && mAudioEndpoint.getEmptyFramesAvailable() < 0) { mXRunCount++; if (ATRACE_ENABLED()) { ATRACE_INT("aaOverRuns", mXRunCount); Loading
media/libaaudio/src/client/AudioStreamInternalPlay.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ aaudio_result_t AudioStreamInternalPlay::processDataNow(void *buffer, int32_t nu } // If the read index passed the write index then consider it an underrun. if (mAudioEndpoint.getFullFramesAvailable() < 0) { // For shared streams, the xRunCount is passed up from the service. if (mAudioEndpoint.isFreeRunning() && mAudioEndpoint.getFullFramesAvailable() < 0) { mXRunCount++; if (ATRACE_ENABLED()) { ATRACE_INT("aaUnderRuns", mXRunCount); Loading
services/oboeservice/AAudioMixer.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ void AAudioMixer::clear() { memset(mOutputBuffer, 0, mBufferSizeInBytes); } bool AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { int32_t AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { WrappingBuffer wrappingBuffer; float *destination = mOutputBuffer; Loading Loading @@ -105,7 +105,7 @@ bool AAudioMixer::mix(int streamIndex, FifoBuffer *fifo, bool allowUnderflow) { ATRACE_END(); #endif /* AAUDIO_MIXER_ATRACE_ENABLED */ return (framesLeft > 0); // did not get all the frames we needed, ie. "underflow" return (framesDesired - framesLeft); // framesRead } void AAudioMixer::mixPart(float *destination, float *source, int32_t numFrames) { Loading