Lines Matching refs:patch
70 status_t AudioFlinger::createAudioPatch(const struct audio_patch *patch, in createAudioPatch() argument
73 status_t status = AudioValidator::validateAudioPatch(*patch); in createAudioPatch()
79 return mPatchPanel.createAudioPatch(patch, handle); in createAudioPatch()
135 status_t AudioFlinger::PatchPanel::createAudioPatch(const struct audio_patch *patch, in createAudioPatch() argument
139 if (handle == NULL || patch == NULL) { in createAudioPatch()
143 __func__, patch->num_sources, patch->num_sinks, *handle); in createAudioPatch()
147 if (!audio_patch_is_valid(patch) || (patch->num_sinks == 0 && patch->num_sources != 2)) { in createAudioPatch()
152 if (patch->num_sources > 2) { in createAudioPatch()
174 (patch->sources[0].type != AUDIO_PORT_TYPE_DEVICE || in createAudioPatch()
176 patch->sources[0].ext.device.hw_module)) { in createAudioPatch()
178 } else if (patch->num_sinks == 0 || in createAudioPatch()
180 (patch->sinks[0].type != AUDIO_PORT_TYPE_DEVICE || in createAudioPatch()
182 patch->sinks[0].ext.device.hw_module))) { in createAudioPatch()
200 Patch newPatch{*patch, endpointPatch}; in createAudioPatch()
203 switch (patch->sources[0].type) { in createAudioPatch()
205 audio_module_handle_t srcModule = patch->sources[0].ext.device.hw_module; in createAudioPatch()
211 for (unsigned int i = 0; i < patch->num_sinks; i++) { in createAudioPatch()
213 if ((patch->sinks[i].type == AUDIO_PORT_TYPE_MIX || in createAudioPatch()
214 (patch->sinks[i].type == AUDIO_PORT_TYPE_DEVICE && in createAudioPatch()
215 patch->sinks[i].ext.device.hw_module != srcModule)) && in createAudioPatch()
216 patch->num_sinks > 1) { in createAudioPatch()
222 if (patch->sinks[i].type != patch->sinks[0].type) { in createAudioPatch()
234 if ((patch->num_sources == 2) || in createAudioPatch()
235 ((patch->sinks[0].type == AUDIO_PORT_TYPE_DEVICE) && in createAudioPatch()
236 ((patch->sinks[0].ext.device.hw_module != srcModule) || in createAudioPatch()
238 audio_devices_t outputDevice = patch->sinks[0].ext.device.type; in createAudioPatch()
239 String8 outputDeviceAddress = String8(patch->sinks[0].ext.device.address); in createAudioPatch()
240 if (patch->num_sources == 2) { in createAudioPatch()
241 if (patch->sources[1].type != AUDIO_PORT_TYPE_MIX || in createAudioPatch()
242 (patch->num_sinks != 0 && patch->sinks[0].ext.device.hw_module != in createAudioPatch()
243 patch->sources[1].ext.mix.hw_module)) { in createAudioPatch()
250 mAudioFlinger.checkPlaybackThread_l(patch->sources[1].ext.mix.handle); in createAudioPatch()
264 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) { in createAudioPatch()
265 config.sample_rate = patch->sinks[0].sample_rate; in createAudioPatch()
267 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) { in createAudioPatch()
268 config.channel_mask = patch->sinks[0].channel_mask; in createAudioPatch()
270 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_FORMAT) { in createAudioPatch()
271 config.format = patch->sinks[0].format; in createAudioPatch()
273 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_FLAGS) { in createAudioPatch()
274 flags = patch->sinks[0].flags.output; in createAudioPatch()
277 patch->sinks[0].ext.device.hw_module, in createAudioPatch()
291 audio_devices_t device = patch->sources[0].ext.device.type; in createAudioPatch()
292 String8 address = String8(patch->sources[0].ext.device.address); in createAudioPatch()
296 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) { in createAudioPatch()
297 config.sample_rate = patch->sources[0].sample_rate; in createAudioPatch()
301 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) { in createAudioPatch()
302 config.channel_mask = patch->sources[0].channel_mask; in createAudioPatch()
307 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_FORMAT) { in createAudioPatch()
308 config.format = patch->sources[0].format; in createAudioPatch()
313 patch->sources[0].config_mask & AUDIO_PORT_CONFIG_FLAGS ? in createAudioPatch()
314 patch->sources[0].flags.input : AUDIO_INPUT_FLAG_NONE; in createAudioPatch()
340 if (patch->sinks[0].type == AUDIO_PORT_TYPE_MIX) { in createAudioPatch()
342 patch->sinks[0].ext.mix.handle); in createAudioPatch()
344 thread = mAudioFlinger.checkMmapThread_l(patch->sinks[0].ext.mix.handle); in createAudioPatch()
347 __func__, patch->sinks[0].ext.mix.handle); in createAudioPatch()
352 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
366 status = hwDevice->createAudioPatch(patch->num_sources, in createAudioPatch()
367 patch->sources, in createAudioPatch()
368 patch->num_sinks, in createAudioPatch()
369 patch->sinks, in createAudioPatch()
376 audio_module_handle_t srcModule = patch->sources[0].ext.mix.hw_module; in createAudioPatch()
385 for (unsigned int i = 0; i < patch->num_sinks; i++) { in createAudioPatch()
386 if (patch->sinks[i].type != AUDIO_PORT_TYPE_DEVICE) { in createAudioPatch()
388 __func__, patch->sinks[i].type); in createAudioPatch()
393 if (patch->sinks[i].ext.device.hw_module != srcModule) { in createAudioPatch()
398 patch->sinks[i].ext.device.type); in createAudioPatch()
399 device->setAddress(patch->sinks[i].ext.device.address); in createAudioPatch()
400 device->applyAudioPortConfig(&patch->sinks[i]); in createAudioPatch()
404 mAudioFlinger.checkPlaybackThread_l(patch->sources[0].ext.mix.handle); in createAudioPatch()
406 thread = mAudioFlinger.checkMmapThread_l(patch->sources[0].ext.mix.handle); in createAudioPatch()
409 __func__, patch->sources[0].ext.mix.handle); in createAudioPatch()
418 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
467 addSink(mRecord.thread(), { .source = AUDIO_SOURCE_MIC }).patch(), in createConnections()
478 PatchBuilder().addSource(mPlayback.thread()).addSink(mAudioPatch.sinks[0]).patch(), in createConnections()
718 const struct audio_patch &patch = removedPatch.mAudioPatch; in releaseAudioPatch() local
720 const struct audio_port_config &src = patch.sources[0]; in releaseAudioPatch()
735 if (patch.sinks[0].type == AUDIO_PORT_TYPE_MIX) { in releaseAudioPatch()
736 audio_io_handle_t ioHandle = patch.sinks[0].ext.mix.handle; in releaseAudioPatch()
800 const Patch &patch = patch_iter->second; in getDownstreamSoftwarePatches() local
802 patch.mPlayback.const_thread()->id(), in getDownstreamSoftwarePatches()
803 patch.mRecord.const_thread()->id()); in getDownstreamSoftwarePatches()
816 AudioHwDevice *audioHwDevice, audio_io_handle_t stream, struct audio_patch *patch) in notifyStreamOpened() argument
820 if (patch != nullptr) { in notifyStreamOpened()
826 *patch = iter->second.mAudioPatch; in notifyStreamOpened()
859 const struct audio_patch *patch) in addSoftwarePatchToInsertedModules() argument
863 mAudioFlinger.updateDownStreamPatches_l(patch, mInsertedModules[module].streams); in addSoftwarePatchToInsertedModules()
901 for (const auto& patch : module.second.sw_patches) { in dump() local
902 moduleDump.appendFormat("%d ", patch); in dump()