2013-05-14 22:27:20 +00:00
|
|
|
/*
|
2015-03-12 20:02:10 +00:00
|
|
|
* Copyright (c) 2013, 2016 The Linux Foundation. All rights reserved.
|
2013-10-01 22:49:05 +00:00
|
|
|
* Not a contribution.
|
|
|
|
*
|
2013-05-14 22:27:20 +00:00
|
|
|
* Copyright (C) 2013 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QCOM_AUDIO_PLATFORM_H
|
|
|
|
#define QCOM_AUDIO_PLATFORM_H
|
|
|
|
|
2013-10-07 22:23:41 +00:00
|
|
|
enum {
|
|
|
|
FLUENCE_NONE,
|
|
|
|
FLUENCE_DUAL_MIC,
|
|
|
|
FLUENCE_QUAD_MIC
|
|
|
|
};
|
|
|
|
|
2013-05-14 22:27:20 +00:00
|
|
|
/*
|
|
|
|
* Below are the devices for which is back end is same, SLIMBUS_0_RX.
|
|
|
|
* All these devices are handled by the internal HW codec. We can
|
|
|
|
* enable any one of these devices at any time
|
|
|
|
*/
|
|
|
|
#define AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND \
|
|
|
|
(AUDIO_DEVICE_OUT_EARPIECE | AUDIO_DEVICE_OUT_SPEAKER | \
|
|
|
|
AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE)
|
|
|
|
|
2015-07-09 02:38:38 +00:00
|
|
|
/*
|
|
|
|
* Below are the input devices for which back end is same, SLIMBUS_0_TX.
|
|
|
|
* All these devices are handled by the internal HW codec. We can
|
|
|
|
* enable any one of these devices at any time
|
|
|
|
*/
|
|
|
|
#define AUDIO_DEVICE_IN_ALL_CODEC_BACKEND \
|
|
|
|
(AUDIO_DEVICE_IN_BUILTIN_MIC | AUDIO_DEVICE_IN_BACK_MIC | \
|
|
|
|
AUDIO_DEVICE_IN_WIRED_HEADSET | AUDIO_DEVICE_IN_VOICE_CALL) & ~AUDIO_DEVICE_BIT_IN
|
|
|
|
|
2013-05-14 22:27:20 +00:00
|
|
|
/* Sound devices specific to the platform
|
|
|
|
* The DEVICE_OUT_* and DEVICE_IN_* should be mapped to these sound
|
|
|
|
* devices to enable corresponding mixer paths
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
SND_DEVICE_NONE = 0,
|
|
|
|
|
|
|
|
/* Playback devices */
|
|
|
|
SND_DEVICE_MIN,
|
|
|
|
SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN,
|
|
|
|
SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN,
|
|
|
|
SND_DEVICE_OUT_SPEAKER,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_REVERSE,
|
|
|
|
SND_DEVICE_OUT_HEADPHONES,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
|
|
|
|
SND_DEVICE_OUT_VOICE_SPEAKER,
|
|
|
|
SND_DEVICE_OUT_VOICE_HEADPHONES,
|
|
|
|
SND_DEVICE_OUT_HDMI,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_AND_HDMI,
|
2016-09-03 21:13:26 +00:00
|
|
|
SND_DEVICE_OUT_DISPLAY_PORT,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_AND_DISPLAY_PORT,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_OUT_BT_SCO,
|
2015-03-12 20:02:10 +00:00
|
|
|
SND_DEVICE_OUT_BT_A2DP,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP,
|
2014-09-05 23:14:17 +00:00
|
|
|
SND_DEVICE_OUT_BT_SCO_WB,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
|
|
|
|
SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
|
|
|
|
SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET,
|
2014-09-05 23:14:17 +00:00
|
|
|
SND_DEVICE_OUT_USB_HEADSET,
|
|
|
|
SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_OUT_END,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note: IN_BEGIN should be same as OUT_END because total number of devices
|
|
|
|
* SND_DEVICES_MAX should not exceed MAX_RX + MAX_TX devices.
|
|
|
|
*/
|
|
|
|
/* Capture devices */
|
|
|
|
SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END,
|
|
|
|
SND_DEVICE_IN_HANDSET_MIC = SND_DEVICE_IN_BEGIN,
|
|
|
|
SND_DEVICE_IN_SPEAKER_MIC,
|
|
|
|
SND_DEVICE_IN_HEADSET_MIC,
|
|
|
|
SND_DEVICE_IN_HANDSET_MIC_AEC,
|
|
|
|
SND_DEVICE_IN_SPEAKER_MIC_AEC,
|
|
|
|
SND_DEVICE_IN_HEADSET_MIC_AEC,
|
|
|
|
SND_DEVICE_IN_VOICE_SPEAKER_MIC,
|
|
|
|
SND_DEVICE_IN_VOICE_HEADSET_MIC,
|
|
|
|
SND_DEVICE_IN_HDMI_MIC,
|
|
|
|
SND_DEVICE_IN_BT_SCO_MIC,
|
2014-09-05 23:14:17 +00:00
|
|
|
SND_DEVICE_IN_BT_SCO_MIC_WB,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_IN_CAMCORDER_MIC,
|
2013-10-07 22:23:41 +00:00
|
|
|
SND_DEVICE_IN_VOICE_DMIC,
|
|
|
|
SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
|
|
|
|
SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
|
|
|
|
SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
|
|
|
|
SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
|
|
|
|
SND_DEVICE_IN_VOICE_REC_MIC,
|
2013-10-07 22:23:41 +00:00
|
|
|
SND_DEVICE_IN_VOICE_REC_DMIC,
|
|
|
|
SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
|
2014-09-05 23:14:17 +00:00
|
|
|
SND_DEVICE_IN_USB_HEADSET_MIC,
|
2013-05-14 22:27:20 +00:00
|
|
|
SND_DEVICE_IN_END,
|
|
|
|
|
|
|
|
SND_DEVICE_MAX = SND_DEVICE_IN_END,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MIXER_CARD 0
|
|
|
|
#define SOUND_CARD 0
|
|
|
|
|
|
|
|
#define DEFAULT_OUTPUT_SAMPLING_RATE 48000
|
2016-07-19 13:03:53 +00:00
|
|
|
#define INPUT_SAMPLING_RATE_DSD64 2822400
|
|
|
|
#define INPUT_SAMPLING_RATE_DSD128 5644800
|
|
|
|
#define OUTPUT_SAMPLING_RATE_DSD64 176400
|
|
|
|
#define OUTPUT_SAMPLING_RATE_DSD128 352800
|
|
|
|
#define DSD_NATIVE_BACKEND 1
|
|
|
|
#define PASSTHROUGH_DSD 3
|
2014-09-05 23:14:17 +00:00
|
|
|
|
|
|
|
#define ALL_SESSION_VSID 0xFFFFFFFF
|
|
|
|
#define DEFAULT_MUTE_RAMP_DURATION_MS 20
|
|
|
|
#define DEFAULT_VOLUME_RAMP_DURATION_MS 20
|
2013-10-01 22:49:05 +00:00
|
|
|
#define MIXER_PATH_MAX_LENGTH 100
|
2014-09-05 23:14:17 +00:00
|
|
|
|
|
|
|
#define MAX_VOL_INDEX 5
|
|
|
|
#define MIN_VOL_INDEX 0
|
|
|
|
#define percent_to_index(val, min, max) \
|
|
|
|
((val) * ((max) - (min)) * 0.01 + (min) + .5)
|
|
|
|
|
2013-05-14 22:27:20 +00:00
|
|
|
/*
|
|
|
|
* tinyAlsa library interprets period size as number of frames
|
|
|
|
* one frame = channel_count * sizeof (pcm sample)
|
|
|
|
* so if format = 16-bit PCM and channels = Stereo, frame size = 2 ch * 2 = 4 bytes
|
|
|
|
* DEEP_BUFFER_OUTPUT_PERIOD_SIZE = 1024 means 1024 * 4 = 4096 bytes
|
|
|
|
* We should take care of returning proper size when AudioFlinger queries for
|
|
|
|
* the buffer size of an input/output stream
|
|
|
|
*/
|
|
|
|
#define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 960
|
2014-09-05 23:14:17 +00:00
|
|
|
#define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 4
|
2013-05-14 22:27:20 +00:00
|
|
|
#define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240
|
|
|
|
#define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2
|
|
|
|
|
|
|
|
#define HDMI_MULTI_PERIOD_SIZE 336
|
|
|
|
#define HDMI_MULTI_PERIOD_COUNT 8
|
|
|
|
#define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
|
|
|
|
#define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2)
|
|
|
|
|
2013-06-11 21:40:01 +00:00
|
|
|
#define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
|
2013-05-14 22:27:20 +00:00
|
|
|
#define AUDIO_CAPTURE_PERIOD_COUNT 2
|
|
|
|
|
2014-09-05 23:14:17 +00:00
|
|
|
#define DEVICE_NAME_MAX_SIZE 128
|
|
|
|
|
2014-04-11 00:59:02 +00:00
|
|
|
/* Define macro for Internal FM volume mixer */
|
|
|
|
#define FM_RX_VOLUME "Internal FM RX Volume"
|
|
|
|
|
2014-09-08 22:59:58 +00:00
|
|
|
#define LOW_LATENCY_CAPTURE_SAMPLE_RATE 48000
|
|
|
|
#define LOW_LATENCY_CAPTURE_PERIOD_SIZE 240
|
|
|
|
#define LOW_LATENCY_CAPTURE_USE_CASE 0
|
|
|
|
|
2014-09-05 20:51:35 +00:00
|
|
|
#define AFE_PROXY_PLAYBACK_PCM_DEVICE 7
|
|
|
|
#define AFE_PROXY_RECORD_PCM_DEVICE 8
|
|
|
|
|
2014-09-09 16:50:01 +00:00
|
|
|
#define DEVICE_NAME_MAX_SIZE 128
|
|
|
|
|
2013-05-14 22:27:20 +00:00
|
|
|
#endif // QCOM_AUDIO_PLATFORM_H
|