blob: 68dcaffe6f2a1cb0da699be1256ce31dc99e1942 [file] [log] [blame]
Phil Burkc0c70e32017-02-09 13:18:38 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eric Laurentcb4dae22017-07-01 19:39:32 -070017#define LOG_TAG "AAudioServiceStreamMMAP"
Phil Burkc0c70e32017-02-09 13:18:38 -080018//#define LOG_NDEBUG 0
19#include <utils/Log.h>
20
21#include <atomic>
22#include <stdint.h>
23
24#include <utils/String16.h>
25#include <media/nbaio/AudioStreamOutSink.h>
26#include <media/MmapStreamInterface.h>
27
28#include "AAudioServiceStreamBase.h"
29#include "AAudioServiceStreamMMAP.h"
30#include "binding/AudioEndpointParcelable.h"
31#include "SharedMemoryProxy.h"
32#include "utility/AAudioUtilities.h"
33
Phil Burke72481c2017-08-08 13:20:45 -070034using android::base::unique_fd;
Phil Burkc0c70e32017-02-09 13:18:38 -080035using namespace android;
36using namespace aaudio;
37
38#define AAUDIO_BUFFER_CAPACITY_MIN 4 * 512
39#define AAUDIO_SAMPLE_RATE_DEFAULT 48000
40
Phil Burk97350f92017-07-21 15:59:44 -070041// This is an estimate of the time difference between the HW and the MMAP time.
42// TODO Get presentation timestamps from the HAL instead of using these estimates.
43#define OUTPUT_ESTIMATED_HARDWARE_OFFSET_NANOS (3 * AAUDIO_NANOS_PER_MILLISECOND)
44#define INPUT_ESTIMATED_HARDWARE_OFFSET_NANOS (-1 * AAUDIO_NANOS_PER_MILLISECOND)
45
Phil Burkc0c70e32017-02-09 13:18:38 -080046/**
Phil Burk11e8d332017-05-24 09:59:02 -070047 * Service Stream that uses an MMAP buffer.
Phil Burkc0c70e32017-02-09 13:18:38 -080048 */
49
Eric Laurentcb4dae22017-07-01 19:39:32 -070050AAudioServiceStreamMMAP::AAudioServiceStreamMMAP(const android::AudioClient& serviceClient,
51 bool inService)
Phil Burkc0c70e32017-02-09 13:18:38 -080052 : AAudioServiceStreamBase()
53 , mMmapStreamCallback(new MyMmapStreamCallback(*this))
54 , mPreviousFrameCounter(0)
Eric Laurentd51329e2017-06-30 16:06:16 -070055 , mMmapStream(nullptr)
Eric Laurentcb4dae22017-07-01 19:39:32 -070056 , mServiceClient(serviceClient)
57 , mInService(inService) {
Phil Burkc0c70e32017-02-09 13:18:38 -080058}
59
Phil Burkc0c70e32017-02-09 13:18:38 -080060aaudio_result_t AAudioServiceStreamMMAP::close() {
Phil Burk98d6d922017-07-06 11:52:45 -070061 if (mState == AAUDIO_STREAM_STATE_CLOSED) {
62 return AAUDIO_OK;
63 }
Eric Laurentcb4dae22017-07-01 19:39:32 -070064 stop();
Phil Burk98d6d922017-07-06 11:52:45 -070065 if (mMmapStream != 0) {
66 mMmapStream.clear(); // TODO review. Is that all we have to do?
67 // Apparently the above close is asynchronous. An attempt to open a new device
68 // right after a close can fail. Also some callbacks may still be in flight!
69 // FIXME Make closing synchronous.
70 AudioClock::sleepForNanos(100 * AAUDIO_NANOS_PER_MILLISECOND);
71 }
Phil Burk71f35bb2017-04-13 16:05:07 -070072
Phil Burkc0c70e32017-02-09 13:18:38 -080073 return AAudioServiceStreamBase::close();
74}
75
76// Open stream on HAL and pass information about the shared memory buffer back to the client.
77aaudio_result_t AAudioServiceStreamMMAP::open(const aaudio::AAudioStreamRequest &request,
78 aaudio::AAudioStreamConfiguration &configurationOutput) {
79 const audio_attributes_t attributes = {
80 .content_type = AUDIO_CONTENT_TYPE_MUSIC,
81 .usage = AUDIO_USAGE_MEDIA,
Phil Burk87c9f642017-05-17 07:22:39 -070082 .source = AUDIO_SOURCE_VOICE_RECOGNITION,
Phil Burkc0c70e32017-02-09 13:18:38 -080083 .flags = AUDIO_FLAG_LOW_LATENCY,
84 .tags = ""
85 };
86 audio_config_base_t config;
87
88 aaudio_result_t result = AAudioServiceStreamBase::open(request, configurationOutput);
89 if (result != AAUDIO_OK) {
90 ALOGE("AAudioServiceStreamBase open returned %d", result);
91 return result;
92 }
93
94 const AAudioStreamConfiguration &configurationInput = request.getConstantConfiguration();
95 audio_port_handle_t deviceId = configurationInput.getDeviceId();
Phil Burkc0c70e32017-02-09 13:18:38 -080096 aaudio_direction_t direction = request.getDirection();
97
98 // Fill in config
jiabin901f65d2017-07-12 17:56:35 -070099 aaudio_format_t aaudioFormat = configurationInput.getFormat();
Phil Burkc0c70e32017-02-09 13:18:38 -0800100 if (aaudioFormat == AAUDIO_UNSPECIFIED || aaudioFormat == AAUDIO_FORMAT_PCM_FLOAT) {
Phil Burkc0c70e32017-02-09 13:18:38 -0800101 aaudioFormat = AAUDIO_FORMAT_PCM_I16;
102 }
103 config.format = AAudioConvert_aaudioToAndroidDataFormat(aaudioFormat);
104
105 int32_t aaudioSampleRate = configurationInput.getSampleRate();
106 if (aaudioSampleRate == AAUDIO_UNSPECIFIED) {
107 aaudioSampleRate = AAUDIO_SAMPLE_RATE_DEFAULT;
108 }
109 config.sample_rate = aaudioSampleRate;
110
111 int32_t aaudioSamplesPerFrame = configurationInput.getSamplesPerFrame();
112
113 if (direction == AAUDIO_DIRECTION_OUTPUT) {
114 config.channel_mask = (aaudioSamplesPerFrame == AAUDIO_UNSPECIFIED)
115 ? AUDIO_CHANNEL_OUT_STEREO
116 : audio_channel_out_mask_from_count(aaudioSamplesPerFrame);
Phil Burk97350f92017-07-21 15:59:44 -0700117 mHardwareTimeOffsetNanos = OUTPUT_ESTIMATED_HARDWARE_OFFSET_NANOS; // frames at DAC later
118
Phil Burkc0c70e32017-02-09 13:18:38 -0800119 } else if (direction == AAUDIO_DIRECTION_INPUT) {
120 config.channel_mask = (aaudioSamplesPerFrame == AAUDIO_UNSPECIFIED)
121 ? AUDIO_CHANNEL_IN_STEREO
122 : audio_channel_in_mask_from_count(aaudioSamplesPerFrame);
Phil Burk97350f92017-07-21 15:59:44 -0700123 mHardwareTimeOffsetNanos = INPUT_ESTIMATED_HARDWARE_OFFSET_NANOS; // frames at ADC earlier
124
Phil Burkc0c70e32017-02-09 13:18:38 -0800125 } else {
126 ALOGE("openMmapStream - invalid direction = %d", direction);
127 return AAUDIO_ERROR_ILLEGAL_ARGUMENT;
128 }
129
Phil Burkc0c70e32017-02-09 13:18:38 -0800130 MmapStreamInterface::stream_direction_t streamDirection = (direction == AAUDIO_DIRECTION_OUTPUT)
131 ? MmapStreamInterface::DIRECTION_OUTPUT : MmapStreamInterface::DIRECTION_INPUT;
132
133 // Open HAL stream.
134 status_t status = MmapStreamInterface::openMmapStream(streamDirection,
135 &attributes,
136 &config,
137 mMmapClient,
138 &deviceId,
139 mMmapStreamCallback,
Eric Laurentcb4dae22017-07-01 19:39:32 -0700140 mMmapStream,
141 &mPortHandle);
Phil Burkc0c70e32017-02-09 13:18:38 -0800142 if (status != OK) {
143 ALOGE("openMmapStream returned status %d", status);
144 return AAUDIO_ERROR_UNAVAILABLE;
145 }
146
Phil Burkec89b2e2017-06-20 15:05:06 -0700147 if (deviceId == AAUDIO_UNSPECIFIED) {
148 ALOGW("AAudioServiceStreamMMAP::open() - openMmapStream() failed to set deviceId");
149 }
150
Phil Burkc0c70e32017-02-09 13:18:38 -0800151 // Create MMAP/NOIRQ buffer.
152 int32_t minSizeFrames = configurationInput.getBufferCapacity();
Phil Burkec89b2e2017-06-20 15:05:06 -0700153 if (minSizeFrames <= 0) { // zero will get rejected
Phil Burkc0c70e32017-02-09 13:18:38 -0800154 minSizeFrames = AAUDIO_BUFFER_CAPACITY_MIN;
155 }
156 status = mMmapStream->createMmapBuffer(minSizeFrames, &mMmapBufferinfo);
157 if (status != OK) {
Phil Burkec89b2e2017-06-20 15:05:06 -0700158 ALOGE("AAudioServiceStreamMMAP::open() - createMmapBuffer() returned status %d",
159 status);
Phil Burkc0c70e32017-02-09 13:18:38 -0800160 return AAUDIO_ERROR_UNAVAILABLE;
161 } else {
Phil Burkfd34a932017-07-19 07:03:52 -0700162 ALOGD("createMmapBuffer status = %d, buffer_size = %d, burst_size %d"
Phil Burkc7abac42017-07-17 11:13:37 -0700163 ", Sharable FD: %s",
164 status,
Eric Laurentd51329e2017-06-30 16:06:16 -0700165 abs(mMmapBufferinfo.buffer_size_frames),
166 mMmapBufferinfo.burst_size_frames,
167 mMmapBufferinfo.buffer_size_frames < 0 ? "Yes" : "No");
168 }
169
170 mCapacityInFrames = mMmapBufferinfo.buffer_size_frames;
171 // FIXME: the audio HAL indicates if the shared memory fd can be shared outside of audioserver
172 // by returning a negative buffer size
173 if (mCapacityInFrames < 0) {
174 // Exclusive mode is possible from any client
175 mCapacityInFrames = -mCapacityInFrames;
176 } else {
177 // exclusive mode is only possible if the final fd destination is inside audioserver
Eric Laurentcb4dae22017-07-01 19:39:32 -0700178 if ((mMmapClient.clientUid != mServiceClient.clientUid) &&
Eric Laurentd51329e2017-06-30 16:06:16 -0700179 configurationInput.getSharingMode() == AAUDIO_SHARING_MODE_EXCLUSIVE) {
180 // Fallback is handled by caller but indicate what is possible in case
181 // this is used in the future
182 configurationOutput.setSharingMode(AAUDIO_SHARING_MODE_SHARED);
183 return AAUDIO_ERROR_UNAVAILABLE;
184 }
Phil Burkc0c70e32017-02-09 13:18:38 -0800185 }
186
187 // Get information about the stream and pass it back to the caller.
188 mSamplesPerFrame = (direction == AAUDIO_DIRECTION_OUTPUT)
189 ? audio_channel_count_from_out_mask(config.channel_mask)
190 : audio_channel_count_from_in_mask(config.channel_mask);
191
Phil Burke72481c2017-08-08 13:20:45 -0700192 // AAudio creates a copy of this FD and retains ownership of the copy.
193 // Assume that AudioFlinger will close the original shared_memory_fd.
194 mAudioDataFileDescriptor.reset(dup(mMmapBufferinfo.shared_memory_fd));
195 if (mAudioDataFileDescriptor.get() == -1) {
196 ALOGE("AAudioServiceStreamMMAP::open() - could not dup shared_memory_fd");
197 return AAUDIO_ERROR_INTERNAL; // TODO review
198 }
Phil Burkc0c70e32017-02-09 13:18:38 -0800199 mFramesPerBurst = mMmapBufferinfo.burst_size_frames;
Phil Burkc0c70e32017-02-09 13:18:38 -0800200 mAudioFormat = AAudioConvert_androidToAAudioDataFormat(config.format);
201 mSampleRate = config.sample_rate;
202
Phil Burkc8f69a02017-05-11 15:53:06 -0700203 // Scale up the burst size to meet the minimum equivalent in microseconds.
204 // This is to avoid waking the CPU too often when the HW burst is very small
205 // or at high sample rates.
206 int32_t burstMinMicros = AAudioProperty_getHardwareBurstMinMicros();
207 int32_t burstMicros = 0;
208 do {
209 if (burstMicros > 0) { // skip first loop
210 mFramesPerBurst *= 2;
211 }
212 burstMicros = mFramesPerBurst * static_cast<int64_t>(1000000) / mSampleRate;
213 } while (burstMicros < burstMinMicros);
214
215 ALOGD("AAudioServiceStreamMMAP::open() original burst = %d, minMicros = %d, final burst = %d\n",
216 mMmapBufferinfo.burst_size_frames, burstMinMicros, mFramesPerBurst);
217
Phil Burkec89b2e2017-06-20 15:05:06 -0700218 ALOGD("AAudioServiceStreamMMAP::open() actual rate = %d, channels = %d, deviceId = %d\n",
219 mSampleRate, mSamplesPerFrame, deviceId);
220
Phil Burkc0c70e32017-02-09 13:18:38 -0800221 // Fill in AAudioStreamConfiguration
222 configurationOutput.setSampleRate(mSampleRate);
223 configurationOutput.setSamplesPerFrame(mSamplesPerFrame);
jiabin901f65d2017-07-12 17:56:35 -0700224 configurationOutput.setFormat(mAudioFormat);
Phil Burkc0c70e32017-02-09 13:18:38 -0800225 configurationOutput.setDeviceId(deviceId);
226
Phil Burk5a26e662017-07-07 12:44:48 -0700227 setState(AAUDIO_STREAM_STATE_OPEN);
Phil Burkc0c70e32017-02-09 13:18:38 -0800228 return AAUDIO_OK;
229}
230
Phil Burkc0c70e32017-02-09 13:18:38 -0800231/**
232 * Start the flow of data.
233 */
234aaudio_result_t AAudioServiceStreamMMAP::start() {
Eric Laurentcb4dae22017-07-01 19:39:32 -0700235 if (isRunning()) {
236 return AAUDIO_OK;
237 }
Phil Burkc0c70e32017-02-09 13:18:38 -0800238 if (mMmapStream == nullptr) return AAUDIO_ERROR_NULL;
Phil Burk87c9f642017-05-17 07:22:39 -0700239 aaudio_result_t result;
Eric Laurentcb4dae22017-07-01 19:39:32 -0700240 status_t status = mMmapStream->start(mServiceClient, &mPortHandle);
Phil Burk87c9f642017-05-17 07:22:39 -0700241 if (status != OK) {
242 ALOGE("AAudioServiceStreamMMAP::start() mMmapStream->start() returned %d", status);
Phil Burk5ef003b2017-06-30 11:43:37 -0700243 disconnect();
Phil Burk87c9f642017-05-17 07:22:39 -0700244 result = AAudioConvert_androidToAAudioResult(status);
Phil Burkc0c70e32017-02-09 13:18:38 -0800245 } else {
246 result = AAudioServiceStreamBase::start();
Eric Laurentcb4dae22017-07-01 19:39:32 -0700247 if (!mInService && result == AAUDIO_OK) {
248 startClient(mMmapClient, &mClientHandle);
249 }
Phil Burkc0c70e32017-02-09 13:18:38 -0800250 }
251 return result;
252}
253
254/**
255 * Stop the flow of data such that start() can resume with loss of data.
256 */
257aaudio_result_t AAudioServiceStreamMMAP::pause() {
Eric Laurentcb4dae22017-07-01 19:39:32 -0700258 if (!isRunning()) {
259 return AAUDIO_OK;
260 }
Phil Burkc0c70e32017-02-09 13:18:38 -0800261 if (mMmapStream == nullptr) return AAUDIO_ERROR_NULL;
Phil Burkc0c70e32017-02-09 13:18:38 -0800262 aaudio_result_t result1 = AAudioServiceStreamBase::pause();
Eric Laurentcb4dae22017-07-01 19:39:32 -0700263 if (!mInService) {
264 stopClient(mClientHandle);
265 }
Phil Burk87c9f642017-05-17 07:22:39 -0700266 status_t status = mMmapStream->stop(mPortHandle);
Phil Burkc0c70e32017-02-09 13:18:38 -0800267 mFramesRead.reset32();
Phil Burk87c9f642017-05-17 07:22:39 -0700268 return (result1 != AAUDIO_OK) ? result1 : AAudioConvert_androidToAAudioResult(status);
Phil Burkc0c70e32017-02-09 13:18:38 -0800269}
270
Phil Burk71f35bb2017-04-13 16:05:07 -0700271aaudio_result_t AAudioServiceStreamMMAP::stop() {
Eric Laurentcb4dae22017-07-01 19:39:32 -0700272 if (!isRunning()) {
273 return AAUDIO_OK;
274 }
Phil Burk71f35bb2017-04-13 16:05:07 -0700275 if (mMmapStream == nullptr) return AAUDIO_ERROR_NULL;
Phil Burk71f35bb2017-04-13 16:05:07 -0700276 aaudio_result_t result1 = AAudioServiceStreamBase::stop();
Eric Laurentcb4dae22017-07-01 19:39:32 -0700277 if (!mInService) {
278 stopClient(mClientHandle);
279 }
Phil Burk87c9f642017-05-17 07:22:39 -0700280 aaudio_result_t status = mMmapStream->stop(mPortHandle);
Phil Burk71f35bb2017-04-13 16:05:07 -0700281 mFramesRead.reset32();
Phil Burk87c9f642017-05-17 07:22:39 -0700282 return (result1 != AAUDIO_OK) ? result1 : AAudioConvert_androidToAAudioResult(status);
Phil Burk71f35bb2017-04-13 16:05:07 -0700283}
284
Phil Burkc0c70e32017-02-09 13:18:38 -0800285/**
286 * Discard any data held by the underlying HAL or Service.
287 */
288aaudio_result_t AAudioServiceStreamMMAP::flush() {
289 if (mMmapStream == nullptr) return AAUDIO_ERROR_NULL;
290 // TODO how do we flush an MMAP/NOIRQ buffer? sync pointers?
Phil Burk71f35bb2017-04-13 16:05:07 -0700291 return AAudioServiceStreamBase::flush();;
Phil Burkc0c70e32017-02-09 13:18:38 -0800292}
293
Eric Laurentcb4dae22017-07-01 19:39:32 -0700294aaudio_result_t AAudioServiceStreamMMAP::startClient(const android::AudioClient& client,
295 audio_port_handle_t *clientHandle) {
296 return AAudioConvert_androidToAAudioResult(mMmapStream->start(client, clientHandle));
297}
298
299aaudio_result_t AAudioServiceStreamMMAP::stopClient(audio_port_handle_t clientHandle) {
300 return AAudioConvert_androidToAAudioResult(mMmapStream->stop(clientHandle));
301}
302
Phil Burk97350f92017-07-21 15:59:44 -0700303// Get free-running DSP or DMA hardware position from the HAL.
Phil Burkc0c70e32017-02-09 13:18:38 -0800304aaudio_result_t AAudioServiceStreamMMAP::getFreeRunningPosition(int64_t *positionFrames,
305 int64_t *timeNanos) {
306 struct audio_mmap_position position;
307 if (mMmapStream == nullptr) {
Phil Burk5ef003b2017-06-30 11:43:37 -0700308 disconnect();
Phil Burkc0c70e32017-02-09 13:18:38 -0800309 return AAUDIO_ERROR_NULL;
310 }
311 status_t status = mMmapStream->getMmapPosition(&position);
Phil Burk940083c2017-07-17 17:00:02 -0700312 aaudio_result_t result = AAudioConvert_androidToAAudioResult(status);
313 if (result == AAUDIO_ERROR_UNAVAILABLE) {
314 ALOGW("sendCurrentTimestamp(): getMmapPosition() has no position data yet");
315 } else if (result != AAUDIO_OK) {
316 ALOGE("sendCurrentTimestamp(): getMmapPosition() returned status %d", status);
Phil Burk5ef003b2017-06-30 11:43:37 -0700317 disconnect();
Phil Burkc0c70e32017-02-09 13:18:38 -0800318 } else {
319 mFramesRead.update32(position.position_frames);
Phil Burk97350f92017-07-21 15:59:44 -0700320
321 Timestamp timestamp(mFramesRead.get(), position.time_nanoseconds);
322 mAtomicTimestamp.write(timestamp);
323 *positionFrames = timestamp.getPosition();
324 *timeNanos = timestamp.getNanoseconds();
Phil Burkc0c70e32017-02-09 13:18:38 -0800325 }
Phil Burk940083c2017-07-17 17:00:02 -0700326 return result;
Phil Burkc0c70e32017-02-09 13:18:38 -0800327}
328
Phil Burk97350f92017-07-21 15:59:44 -0700329// Get timestamp that was written by getFreeRunningPosition()
330aaudio_result_t AAudioServiceStreamMMAP::getHardwareTimestamp(int64_t *positionFrames,
331 int64_t *timeNanos) {
332 // TODO Get presentation timestamp from the HAL
333 if (mAtomicTimestamp.isValid()) {
334 Timestamp timestamp = mAtomicTimestamp.read();
335 *positionFrames = timestamp.getPosition();
336 *timeNanos = timestamp.getNanoseconds() + mHardwareTimeOffsetNanos;
337 return AAUDIO_OK;
338 } else {
339 return AAUDIO_ERROR_UNAVAILABLE;
340 }
341}
342
Phil Burkc0c70e32017-02-09 13:18:38 -0800343void AAudioServiceStreamMMAP::onTearDown() {
Phil Burk5ef003b2017-06-30 11:43:37 -0700344 ALOGD("AAudioServiceStreamMMAP::onTearDown() called");
345 disconnect();
Phil Burkc0c70e32017-02-09 13:18:38 -0800346};
347
348void AAudioServiceStreamMMAP::onVolumeChanged(audio_channel_mask_t channels,
349 android::Vector<float> values) {
350 // TODO do we really need a different volume for each channel?
351 float volume = values[0];
352 ALOGD("AAudioServiceStreamMMAP::onVolumeChanged() volume[0] = %f", volume);
353 sendServiceEvent(AAUDIO_SERVICE_EVENT_VOLUME, volume);
354};
355
356void AAudioServiceStreamMMAP::onRoutingChanged(audio_port_handle_t deviceId) {
357 ALOGD("AAudioServiceStreamMMAP::onRoutingChanged() called with %d, old = %d",
Eric Laurentcb4dae22017-07-01 19:39:32 -0700358 deviceId, mDeviceId);
359 if (mDeviceId != AUDIO_PORT_HANDLE_NONE && mDeviceId != deviceId) {
Phil Burk5ef003b2017-06-30 11:43:37 -0700360 disconnect();
Phil Burkc0c70e32017-02-09 13:18:38 -0800361 }
Eric Laurentcb4dae22017-07-01 19:39:32 -0700362 mDeviceId = deviceId;
Phil Burkc0c70e32017-02-09 13:18:38 -0800363};
364
365/**
366 * Get an immutable description of the data queue from the HAL.
367 */
368aaudio_result_t AAudioServiceStreamMMAP::getDownDataDescription(AudioEndpointParcelable &parcelable)
369{
370 // Gather information on the data queue based on HAL info.
371 int32_t bytesPerFrame = calculateBytesPerFrame();
372 int32_t capacityInBytes = mCapacityInFrames * bytesPerFrame;
373 int fdIndex = parcelable.addFileDescriptor(mAudioDataFileDescriptor, capacityInBytes);
374 parcelable.mDownDataQueueParcelable.setupMemory(fdIndex, 0, capacityInBytes);
375 parcelable.mDownDataQueueParcelable.setBytesPerFrame(bytesPerFrame);
376 parcelable.mDownDataQueueParcelable.setFramesPerBurst(mFramesPerBurst);
377 parcelable.mDownDataQueueParcelable.setCapacityInFrames(mCapacityInFrames);
378 return AAUDIO_OK;
Phil Burkec89b2e2017-06-20 15:05:06 -0700379}