blob: 50d00f60c766a00eddc6aac22190a9559c5c077a [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module provides cras audio configs."""
INTERNAL_MIC_GAIN_100DB = {
'chell': 500,
'auron_yuna': -1000,
'kevin': 0,
}
def get_proper_internal_mic_gain(board):
"""Return a proper internal mic gain.
@param board: Board name.
@returns: A number in 100 dB. E.g., 1000 is 10dB. This is in the same unit
as cras_utils set_capture_gain. Returns None if there is no such
entry.
"""
return INTERNAL_MIC_GAIN_100DB.get(board, None)
INTERNAL_MIC_NODE = {
('nami', 'vayne'): 'FRONT_MIC',
}
def get_internal_mic_node(board, model, num_mics):
"""Return the expected internal microphone node for given board name and
model name.
@param board: board name of the DUT.
@param model: model name of the DUT.
@param mic_num: number of internal mics.
@returns: The name of the expected internal microphone nodes.
"""
if num_mics == 2:
return 'FRONT_MIC'
return INTERNAL_MIC_NODE.get((board, model), 'INTERNAL_MIC')
INTERNAL_MIC_NODES = {
('nami', 'vayne'): ['FRONT_MIC'],
}
def get_plugged_internal_mics(board, model, num_mics):
"""Return a list of all the plugged internal microphone nodes for given
board name and model name.
@param board: board name of the DUT.
@param model: model name of the DUT.
@param mic_num: number of internal mics.
@returns: A list of all the plugged internal microphone nodes.
"""
if num_mics == 2:
return ['FRONT_MIC', 'REAR_MIC']
return INTERNAL_MIC_NODES.get((board, model), ['INTERNAL_MIC'])