Lines Matching defs:output

94     // handle output devices
100 // save a copy of the opened output descriptors before any output is opened or closed
105 // handle output device connection
149 // handle output device disconnection
156 ALOGV("setDeviceConnectionState() disconnecting output device %x", device);
161 // remove device from available output devices
176 // output is suspended before any tracks are moved to it
191 // check again after closing A2DP output to reset mA2dpSuspended if needed
204 // do not force device change on duplicated output because if device is 0, it will
221 } // end if is output device
289 // As the input device list can impact the output device selection, update
408 // via setOutputDevice() on primary output.
425 "updateCallRouting() selected device not in output device list");
435 // request to reuse existing output stream if one is already opened to reach the RX device
438 audio_io_handle_t output = selectOutput(outputs,
441 if (output != AUDIO_IO_HANDLE_NONE) {
442 sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
444 "updateCallRouting() RX device output is duplicated");
479 audio_io_handle_t output = selectOutput(outputs,
482 // request to reuse existing output stream if one is already opened to reach the TX
483 // path output device
484 if (output != AUDIO_IO_HANDLE_NONE) {
485 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
487 "updateCallRouting() RX device output is duplicated");
555 // check for device and output changes triggered by new phone state
566 // latency of any output where either strategy is active.
587 // Note that despite the fact that getNewOutputDevice() is called on the primary output,
588 // the device returned is not necessarily reachable via this output
653 // check for device and output changes triggered by new force usage
700 // Find a direct output profile compatible with the parameters passed, even if the input flags do
701 // not explicitly request a direct output
709 // only retain flags that will drive the direct output profile selection
765 audio_io_handle_t *output,
803 *output = desc->mIoHandle;
804 ALOGV("getOutputForAttr() returns output %d", *output);
839 *output = getOutputForDevice(device, session, *stream,
842 if (*output == AUDIO_IO_HANDLE_NONE) {
860 audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
865 ALOGV("getOutput() test output mCurOutput %d, samplingRate %d, format %d, channelMask %x, mDirectOutput %d",
869 ALOGV("getOutput() opening test output");
905 // open a direct output if required by specified parameters
906 //force direct flag if offload flag is set: offloading implies a direct output stream
921 // use DEEP_BUFFER as default output for music stream type
930 // skip direct output selection if the request can obviously be attached to a mixed output
961 // reuse direct output if currently open by the same client
968 ALOGV("getOutput() reusing direct output %d for session %d",
972 ALOGV("getOutput() do not reuse direct output because current client (%d) "
980 // close direct output if currently open and configured with different parameters
1016 &output,
1023 // only accept an output with the requested parameters
1028 ALOGV("getOutput() failed opening direct output: output %d samplingRate %d %d,"
1029 "format %d %d, channelMask %04x %04x", output, samplingRate,
1032 if (output != AUDIO_IO_HANDLE_NONE) {
1033 mpClientInterface->closeOutput(output);
1035 // fall back to mixer output if possible when the direct output could not be open
1049 addOutput(output, outputDesc);
1051 ALOGV("getOutput() returns new direct output %d", output);
1053 return output;
1058 // A request for HW A/V sync cannot fallback to a mixed output because time
1066 // open a non direct output
1070 // get which output is suitable for the specified stream. The actual
1074 // at this stage we should ignore the DIRECT flag as no direct output could be found earlier
1076 output = selectOutput(outputs, flags, format);
1078 ALOGW_IF((output == 0), "getOutput() could not find output for stream %d, samplingRate %d,"
1081 ALOGV(" getOutputForDevice() returns output %d", output);
1083 return output;
1090 // select one output among several that provide a path to a particular device or set of
1093 // 1: the output with the highest number of requested policy flags
1094 // 2: the output with the bit depth the closest to the requested one
1095 // 3: the primary output
1096 // 4: the first output in the list
1115 // if a valid format is specified, skip output if not compatible
1144 ALOGV("selectOutput() commonFlags for output %d, %04x", outputs[i], commonFlags);
1165 status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
1169 ALOGV("startOutput() output %d, stream %d, session %d",
1170 output, stream, session);
1171 ssize_t index = mOutputs.indexOfKey(output);
1173 ALOGW("startOutput() unknown output %d", output);
1195 checkStrategyRoute(getStrategy(stream), output);
1208 // Automatically enable the remote submix input when output is started on a re routing mix
1231 // cannot start playback of STREAM_TTS if any other output is being used
1247 // force device change if the output is inactive and no audio patch is already present.
1252 // increment usage count for this stream on the requested output:
1253 // NOTE that the usage count is the same for duplicated output and hardware output which is
1254 // necessary for a correct control of hardware output routing by startOutput() and stopOutput()
1262 // starting an output being rerouted?
1275 // force a device change if any other output is:
1281 // change the device currently selected by the other active output.
1310 // update the outputs if starting an output with a stream that can affect notification
1328 status_t AudioPolicyManager::stopOutput(audio_io_handle_t output,
1332 ALOGV("stopOutput() output %d, stream %d, session %d", output, stream, session);
1333 ssize_t index = mOutputs.indexOfKey(output);
1335 ALOGW("stopOutput() unknown output %d", output);
1342 // Automatically disable the remote submix input when output is stopped on a
1381 // decrement usage count of this stream on the output
1396 // one being selected for this output
1429 void AudioPolicyManager::releaseOutput(audio_io_handle_t output,
1433 ALOGV("releaseOutput() %d", output);
1434 ssize_t index = mOutputs.indexOfKey(output);
1436 ALOGW("releaseOutput() releasing unknown output %d", output);
1441 int testIndex = testOutputIndex(output);
1445 mpClientInterface->closeOutput(output);
1446 removeOutput(output);
1459 ALOGW("releaseOutput() invalid open count %d for output %d",
1460 desc->mDirectOpenCount, output);
1464 closeOutput(output);
1918 // automatically enable the remote submix output when input is started if not
1981 // automatically disable the remote submix output when input is stopped if not
2123 // - The requested stream (or a stream matching for volume control) is active on the output
2126 // - For non default requested device, currently selected device on the output is either the
2197 // select one output among several suitable for global effects.
2199 // 1: An offloaded output. If the effect ends up not being offloadable,
2200 // AudioFlinger will invalidate the track and the offloaded output
2201 // will be closed causing the effect to be moved to a PCM output.
2202 // 2: A deep buffer output
2203 // 3: The primary output
2204 // 4: the first output in the list
2214 audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
2217 while (output == AUDIO_IO_HANDLE_NONE) {
2240 output = outputOffloaded;
2242 output = outputDeepBuffer;
2244 output = outputPrimary;
2246 output = outputs[0];
2251 if (output != mMusicEffectOutput) {
2252 mpClientInterface->moveEffects(AUDIO_SESSION_OUTPUT_MIX, mMusicEffectOutput, output);
2253 mMusicEffectOutput = output;
2256 ALOGV("selectOutputForMusicEffects selected output %d", output);
2257 return output;
2311 // When a mix is registered, corresponding input and output profiles are
2317 // appropriate profile and the corresponding input or output stream is opened.
2324 // At this time, the corresponding output remote submix device is also connected
2331 // - 3 if none found, default to device and output selection by policy rules.
2368 if (mPolicyMixes.registerMix(address, mixes[i], 0 /*output desc*/) != NO_ERROR) {
2375 // NOTE: audio flinger mixer does not support mono output: configure remote submix HAL in
2522 snprintf(buffer, SIZE, " Force use for encoded surround output %d\n",
2525 snprintf(buffer, SIZE, " TTS output %s\n", mTtsOutputAvailable ? "available" : "not available");
2532 mAvailableOutputDevices.dump(fd, String8("Available output"));
2748 ALOGV("createAudioPatch() output not found for id %d", patch->sources[0].id);
2751 ALOG_ASSERT(!outputDesc->isDuplicated(),"duplicated output %d in source in ports",
2794 // TODO: reconfigure output format and channels here
2795 ALOGV("createAudioPatch() setting device %08x on output %d",
2846 // TODO: reconfigure output format and channels here
2847 ALOGV("createAudioPatch() setting device %08x on output %d",
2898 // support only one sink device for now to simplify output selection logic
2904 // if the sink device is reachable via an opened output stream, request to go via
2905 // this output stream by adding a second source to the patch description
2906 audio_io_handle_t output = selectOutput(outputs,
2909 if (output != AUDIO_IO_HANDLE_NONE) {
2910 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
2979 ALOGV("releaseAudioPatch() output not found for id %d", patch->sources[0].id);
3047 "setAudioPortConfig() called on duplicated output %d",
3120 // If the default device for this strategy is on another output mix,
3122 // Otherwise select new device on the output mix.
3138 // remove output routes associated with this uid
3262 // create patch between src device and output device
3266 audio_io_handle_t output =
3268 if (output == AUDIO_IO_HANDLE_NONE) {
3269 ALOGV("%s no output for device %08x", __FUNCTION__, sinkDevice);
3272 sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
3274 ALOGV("%s output for device %08x is duplicated", __FUNCTION__, sinkDevice);
3278 // - the second source indicates to PatchPanel through which output mix this patch should
3280 // - the sink is defined by whatever output device is currently selected for the output
3388 // release patch between src device and output device
3391 ALOGW("%s source has neither SW nor HW output", __FUNCTION__);
3398 audio_io_handle_t output, routing_strategy strategy)
3406 if (sourceStrategy == strategy && outputDesc != 0 && outputDesc->mIoHandle == output) {
3509 // open all output streams needed to access attached devices
3518 // open all output streams needed to access attached devices
3519 // except for direct output streams that are only opened when they are actually
3560 audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
3562 &output,
3570 ALOGW("Cannot open output stream for device %08x on hw module %s",
3589 addOutput(output, outputDesc);
3690 ALOGE_IF((mPrimaryOutput == 0), "Failed to open primary output");
3859 ALOGE("Failed to reopen hardware output stream, "
3891 int AudioPolicyManager::testOutputIndex(audio_io_handle_t output)
3894 if (output == mTestOutputs[i]) return i;
3902 void AudioPolicyManager::addOutput(audio_io_handle_t output, const sp<SwAudioOutputDescriptor>& outputDesc)
3904 outputDesc->setIoHandle(output);
3905 mOutputs.add(output, outputDesc);
3906 updateMono(output); // update mono status when adding to output list
3911 void AudioPolicyManager::removeOutput(audio_io_handle_t output)
3913 mOutputs.removeItem(output);
3931 ALOGV("findIoHandlesByAddress(): adding opened output %d on same address %s",
3956 ALOGV("checkOutputsForDevice(): adding opened output %d", mOutputs.keyAt(i));
3964 // then look for output profiles that can be routed to this device
3987 ALOGW("checkOutputsForDevice(): No output available for device %04x", device);
3996 // nothing to do if one output is already opened for this profile
4013 ALOGV("opening output for device %08x with params %s profile %p",
4024 audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
4026 &output,
4040 mpClientInterface->setParameters(output, String8(param));
4043 updateAudioProfiles(device, output, profile->getAudioProfiles());
4046 mpClientInterface->closeOutput(output);
4047 output = AUDIO_IO_HANDLE_NONE;
4049 mpClientInterface->closeOutput(output);
4050 output = AUDIO_IO_HANDLE_NONE;
4056 &output,
4067 output = AUDIO_IO_HANDLE_NONE;
4071 if (output != AUDIO_IO_HANDLE_NONE) {
4072 addOutput(output, desc);
4084 // no duplicated output for direct outputs and
4091 //TODO: configure audio effect output stage here
4093 // open a duplicating output thread for the new output and the primary output
4095 mpClientInterface->openDuplicateOutput(output,
4098 // add duplicated output descriptor
4110 ALOGW("checkOutputsForDevice() could not open dup output for %d and %d",
4111 mPrimaryOutput->mIoHandle, output);
4112 mpClientInterface->closeOutput(output);
4113 removeOutput(output);
4115 output = AUDIO_IO_HANDLE_NONE;
4120 output = AUDIO_IO_HANDLE_NONE;
4122 if (output == AUDIO_IO_HANDLE_NONE) {
4123 ALOGW("checkOutputsForDevice() could not open output for device %x", device);
4127 outputs.add(output);
4139 ALOGV("checkOutputsForDevice(): adding output %d", output);
4144 ALOGW("checkOutputsForDevice(): No output available for device %04x", device);
4148 // check if one opened output is not needed any more after disconnecting one device
4157 ALOGV("checkOutputsForDevice(): disconnecting adding output %d",
4174 "clearing direct output profile %zu on module %zu", j, i);
4343 void AudioPolicyManager::closeOutput(audio_io_handle_t output)
4345 ALOGV("closeOutput(%d)", output);
4347 sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
4349 ALOGW("closeOutput() unknown output %d", output);
4354 // look for duplicated outputs connected to the output being removed.
4366 // As all active tracks on duplicated output will be deleted,
4367 // and as they were also referenced on the other output, the reference
4369 // the other output.
4375 ALOGV("closeOutput() closing also duplicated output %d", duplicatedOutput);
4394 mpClientInterface->setParameters(output, param.toString());
4396 mpClientInterface->closeOutput(output);
4397 removeOutput(output);
4433 ALOGVV("output %zu isDuplicated=%d device=%04x",
4437 ALOGVV("getOutputsForDevice() found output %d", openOutputs.keyAt(i));
4466 // associated with policies in the "before" and "after" output vectors
4484 ALOGV("checkOutputForStrategy() strategy %d, moving from output %d to output %d",
4486 // mute strategy while moving tracks from one output to another
4500 // Move effects associated to this strategy from previous output to new output
4504 // Move tracks associated to this strategy from previous output to new output
4541 // if suspended, restore A2DP output if:
4546 // if not suspended, suspend A2DP output if:
4594 // 1: the strategy enforced audible is active and enforced on the output:
4596 // 2: we are in call or the strategy phone is active on the output:
4598 // 3: the strategy for enforced audible is active but not enforced on the output:
4600 // 4: the strategy sonification is active on the output:
4602 // 5: the strategy accessibility is active on the output:
4604 // 6: the strategy "respectful" sonification is active on the output:
4606 // 7: the strategy media is active on the output:
4608 // 8: the strategy DTMF is active on the output:
4610 // 9: the strategy for beacon, a.k.a. "transmitted through speaker" is active on the output:
4738 // skip beacon mute management if a dedicated TTS output is available
4860 // skip output if it does not share any device with current output
4872 // between now and the next time the audioflinger thread for this output
4884 // temporary mute output if device selection changes to avoid volume bursts due to
4905 // wait for the PCM output buffers to empty before proceeding with the rest of the command
4931 // output profile
4937 // filter devices according to output selected
4953 // AND the output is connected by a valid audio patch.
5363 ALOGVV("setStrategyMute() strategy %d, mute %d, output ID %d",
5422 // many times as there are active tracks on the output