Lines Matching refs:devices
197 static void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode);
198 static char *getUCMDevice(uint32_t devices, int input, char *rxDevice);
392 void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode) in switchDevice() argument
401 ALOGD("%s: device %d mode:%d", __FUNCTION__, devices, mode); in switchDevice()
404 if ((devices & AudioSystem::DEVICE_OUT_WIRED_HEADSET) || in switchDevice()
405 (devices & AudioSystem::DEVICE_IN_WIRED_HEADSET)) { in switchDevice()
406 devices = devices | (AudioSystem::DEVICE_OUT_WIRED_HEADSET | in switchDevice()
408 } else if (devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) { in switchDevice()
409 devices = devices | (AudioSystem::DEVICE_OUT_WIRED_HEADPHONE | in switchDevice()
411 } else if (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) { in switchDevice()
413 devices |= AudioSystem::DEVICE_OUT_EARPIECE; in switchDevice()
416 devices &= ~AudioSystem::DEVICE_IN_BUILTIN_MIC; in switchDevice()
417 devices |= AudioSystem::DEVICE_IN_BACK_MIC; in switchDevice()
420 } else if (devices & AudioSystem::DEVICE_OUT_EARPIECE) { in switchDevice()
421 devices = devices | AudioSystem::DEVICE_IN_BUILTIN_MIC; in switchDevice()
422 } else if (devices & AudioSystem::DEVICE_OUT_SPEAKER) { in switchDevice()
423 devices = devices | (AudioSystem::DEVICE_IN_BACK_MIC | in switchDevice()
425 } else if ((devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO) || in switchDevice()
426 (devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET) || in switchDevice()
427 (devices & AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET)) { in switchDevice()
428 devices = devices | (AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET | in switchDevice()
431 } else if ((devices & AudioSystem::DEVICE_OUT_ANC_HEADSET) || in switchDevice()
432 (devices & AudioSystem::DEVICE_IN_ANC_HEADSET)) { in switchDevice()
433 devices = devices | (AudioSystem::DEVICE_OUT_ANC_HEADSET | in switchDevice()
435 } else if (devices & AudioSystem::DEVICE_OUT_ANC_HEADPHONE) { in switchDevice()
436 devices = devices | (AudioSystem::DEVICE_OUT_ANC_HEADPHONE | in switchDevice()
439 } else if (devices & AudioSystem::DEVICE_OUT_AUX_DIGITAL) { in switchDevice()
441 devices = devices | (AudioSystem::DEVICE_IN_BACK_MIC | in switchDevice()
444 devices = devices | (AudioSystem::DEVICE_OUT_AUX_DIGITAL | in switchDevice()
447 } else if ((devices & AudioSystem::DEVICE_OUT_PROXY) || in switchDevice()
448 (devices & AudioSystem::DEVICE_IN_PROXY)) { in switchDevice()
449 devices = devices | (AudioSystem::DEVICE_OUT_PROXY | in switchDevice()
455 if ((devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) && ( 6 == handle->channels)) { in switchDevice()
464 rxDevice = getUCMDevice(devices & AudioSystem::DEVICE_OUT_ALL, 0, NULL); in switchDevice()
465 txDevice = getUCMDevice(devices & AudioSystem::DEVICE_IN_ALL, 1, rxDevice); in switchDevice()
551 if (devices & AudioSystem::DEVICE_OUT_FM) in switchDevice()
635 if(handle->devices & AudioSystem::DEVICE_OUT_AUX_DIGITAL) { in s_open()
1182 static status_t s_route(alsa_handle_t *handle, uint32_t devices, int mode) in s_route() argument
1186 ALOGD("s_route: devices 0x%x in mode %d", devices, mode); in s_route()
1188 switchDevice(handle, devices, mode); in s_route()
1310 char *getUCMDevice(uint32_t devices, int input, char *rxDevice) in getUCMDevice() argument
1317 ((devices & AudioSystem::DEVICE_OUT_WIRED_HEADSET) || in getUCMDevice()
1318 (devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE))) { in getUCMDevice()
1321 (devices & AudioSystem::DEVICE_OUT_ANC_HEADSET) || in getUCMDevice()
1322 (devices & AudioSystem::DEVICE_OUT_ANC_HEADPHONE))) { in getUCMDevice()
1331 }else if ((devices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET) || in getUCMDevice()
1332 (devices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET)) { in getUCMDevice()
1334 } else if ((devices & AudioSystem::DEVICE_OUT_SPEAKER) && in getUCMDevice()
1335 ((devices & AudioSystem::DEVICE_OUT_WIRED_HEADSET) || in getUCMDevice()
1336 (devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE))) { in getUCMDevice()
1342 } else if ((devices & AudioSystem::DEVICE_OUT_SPEAKER) && in getUCMDevice()
1343 ((devices & AudioSystem::DEVICE_OUT_AUX_DIGITAL))) { in getUCMDevice()
1346 } else if ((devices & AudioSystem::DEVICE_OUT_SPEAKER) && in getUCMDevice()
1347 ((devices & AudioSystem::DEVICE_OUT_ANC_HEADSET) || in getUCMDevice()
1348 (devices & AudioSystem::DEVICE_OUT_ANC_HEADPHONE))) { in getUCMDevice()
1350 } else if ((devices & AudioSystem::DEVICE_OUT_SPEAKER) && in getUCMDevice()
1351 (devices & AudioSystem::DEVICE_OUT_FM_TX)) { in getUCMDevice()
1354 } else if (devices & AudioSystem::DEVICE_OUT_EARPIECE) { in getUCMDevice()
1362 } else if (devices & AudioSystem::DEVICE_OUT_SPEAKER) { in getUCMDevice()
1367 } else if ((devices & AudioSystem::DEVICE_OUT_WIRED_HEADSET) || in getUCMDevice()
1368 (devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) { in getUCMDevice()
1381 } else if ((devices & AudioSystem::DEVICE_OUT_ANC_HEADSET) || in getUCMDevice()
1382 (devices & AudioSystem::DEVICE_OUT_ANC_HEADPHONE)) { in getUCMDevice()
1388 } else if ((devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO) || in getUCMDevice()
1389 (devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET) || in getUCMDevice()
1390 (devices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT)) { in getUCMDevice()
1395 } else if ((devices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP) || in getUCMDevice()
1396 (devices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES) || in getUCMDevice()
1398 (devices & AudioSystem::DEVICE_OUT_DIRECTOUTPUT) || in getUCMDevice()
1400 (devices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER)) { in getUCMDevice()
1405 } else if (devices & AudioSystem::DEVICE_OUT_AUX_DIGITAL) { in getUCMDevice()
1408 } else if (devices & AudioSystem::DEVICE_OUT_PROXY) { in getUCMDevice()
1412 } else if (devices & AudioSystem::DEVICE_OUT_FM_TX) { in getUCMDevice()
1415 } else if (devices & AudioSystem::DEVICE_OUT_DEFAULT) { in getUCMDevice()
1421 ALOGD("No valid output device: %u", devices); in getUCMDevice()
1426 ((devices & AudioSystem::DEVICE_IN_WIRED_HEADSET) in getUCMDevice()
1428 || (devices & AudioSystem::DEVICE_IN_ANC_HEADSET) in getUCMDevice()
1442 } else if (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) { in getUCMDevice()
1500 ALOGV("return SSRQMIC_FLAG: 0x%x devices:0x%x",mDevSettingsFlag,devices); in getUCMDevice()
1514 } else if (devices & AudioSystem::DEVICE_IN_AUX_DIGITAL) { in getUCMDevice()
1517 } else if (devices & AudioSystem::DEVICE_IN_ANC_HEADSET) { in getUCMDevice()
1520 } else if (devices & AudioSystem::DEVICE_IN_WIRED_HEADSET) { in getUCMDevice()
1525 } else if (devices & AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET) { in getUCMDevice()
1531 } else if ((devices & AudioSystem::DEVICE_IN_ANLG_DOCK_HEADSET) || in getUCMDevice()
1532 (devices & AudioSystem::DEVICE_IN_PROXY)) { in getUCMDevice()
1535 } else if ((devices & AudioSystem::DEVICE_IN_COMMUNICATION) || in getUCMDevice()
1536 (devices & AudioSystem::DEVICE_IN_VOICE_CALL)) { in getUCMDevice()
1542 } else if ((devices & AudioSystem::DEVICE_IN_FM_RX) || in getUCMDevice()
1543 (devices & AudioSystem::DEVICE_IN_FM_RX_A2DP)) { in getUCMDevice()
1551 } else if ((devices & AudioSystem::DEVICE_IN_AMBIENT) || in getUCMDevice()
1552 (devices & AudioSystem::DEVICE_IN_BACK_MIC)) { in getUCMDevice()
1567 ALOGD("No valid input device: %u", devices); in getUCMDevice()