Open xlb767923274 opened 3 years ago
Hi thanks for posting @xlb767923274 We're currently investigating this bug
Hi thanks for posting @xlb767923274 We're currently investigating this bug
other question :
At this file(AndroidSLESMediaQueue.cpp), the ‘m_playedWords’ are not accurate, 1.1. It has Enqueued a silense buffer ( size = 4? ) at first time, this buffer's size hasn't count into the array(m_bufferSizes ); but at callback function by this silense buffer, m_playedWords add a size by 'm_decoder->read()' 1.2. From MSP certification report PlaybackStopped FAIL [INCORRECT_OFFSET_TOO_LOW] 9427(Expected:19809) if fillBuffer() blocked at m_decoder->read() because of network delay, then the queueCallback() will blocked at executor 's task queue, the m_playedWords is smaller than actual value; 1.3. Is it possible to get the offset through GetPosition() from libopenSLES? 1.4. this affects all audioplayer's events to the cloud;
AndroidSLESMediaQueue::fillAllBuffers():
void AndroidSLESMediaQueue::fillAllBuffers(const PlaybackConfiguration& configuration) {
enqueueSilence(configuration); **// Enqueue a buffer**
for (; m_index < m_buffers.size(); ++m_index) { // **// Enqueue m_buffers.size() buffer**
m_executor.submit([this]() { fillBuffer(); });
}
m_index = 0;
}
so at this function, enqueued buffer total size is NUMBER_OF_BUFFERS +1, that may be result in 'SL_RESULT_BUFFER_INSUFFICIENT' when Enqueue(),
_If the maximum number of buffers specified in the
SLDataLocator_BufferQueue structure used as the data source when
creating the media object using the CreateAudioPlayer or
CreateMidiPlayer method has been reached, the buffer is not added to
the buffer queue and SL_RESULT_BUFFER_INSUFFICIENT is returned. At
this point the client should wait until it receives a callback notification
for a buffer completion at which time it can enqueue the buffer._
But the code did not handle the return value of SL_RESULT_BUFFER_INSUFFICIENT, but directly returned "onPlaybackError" to the cloud,
It's Too difficult to pass MSP Certification for alexa android version!! Has any other manufacturer passed the MSP certification in Android version?
IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.
Briefly summarize your issue:
avs-device-sdk/MediaPlayer/AndroidSLESMediaPlayer/src/AndroidSLESMediaQueue.cpp
thread1:
thread2:
m_index is a global var m_buffers.size() = NUMBER_OF_BUFFERS = 4; so, index should be 0 - 3;
but in thread1, m_index's max value is NUMBER_OF_BUFFERS + 1 (possibilities) and at this time, thread2 would get a m_buffers[4], it's a invalid memory;
What is the expected behavior?
What behavior are you observing?
coredump
Provide the steps to reproduce the issue, if applicable:
interaction with alexa in android system
Tell us about your environment:
What version of the AVS Device SDK are you using?
1.22.0
Tell us what hardware you're using:
Tell us about your OS (Type & version):