Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: chromeos/audio/cras_audio_handler.cc

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...and gfx. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/audio/cras_audio_handler.cc
diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc
index 8ee6009f35c69e6ee1ec3070716b5bf75654fd30..3ce04ad7bea07b74e9fa9eef28d436a7227dcf28 100644
--- a/chromeos/audio/cras_audio_handler.cc
+++ b/chromeos/audio/cras_audio_handler.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
+#include "base/sys_info.h"
#include "chromeos/audio/audio_devices_pref_handler.h"
#include "chromeos/audio/audio_devices_pref_handler_stub.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -864,6 +865,22 @@ void CrasAudioHandler::UpdateDevicesAndSwitchActive(
size_t new_input_device_size = 0;
for (size_t i = 0; i < nodes.size(); ++i) {
AudioDevice device(nodes[i]);
+
+ // TODO(ajm): This is a temporary proof-of-concept hack. These values should
+ // come from the cras configs for each board.
+ if (device.type == AUDIO_TYPE_INTERNAL_MIC) {
+ const std::string& board = base::SysInfo::GetLsbReleaseBoard();
+ if (board.find("nyan_kitty") != std::string::npos) {
+ device.mic_positions = "-0.03 0 0 0.03 0 0";
+ } else if (board.find("peach_pi") != std::string::npos) {
+ device.mic_positions = "-0.025 0 0 0.025 0 0";
+ } else if (board.find("samus") != std::string::npos) {
+ device.mic_positions = "-0.032 0 0 0.032 0 0";
+ } else if (board.find("swanky") != std::string::npos) {
+ device.mic_positions = "-0.026 0 0 0.026 0 0";
+ }
+ }
+
audio_devices_[device.id] = device;
if (!has_alternative_input_ &&

Powered by Google App Engine
This is Rietveld 408576698