audio: Move card specfic defines to a header

Change-Id: Iec74ee5c4c0cf93e3a7413901e128b76cf708dbb
tirimbino
Christopher N. Hesse 8 years ago
parent 757ac41a40
commit d23c6b5fcd
  1. 1
      audio/Android.mk
  2. 24
      audio/audio_hw.c
  3. 3
      audio/audio_hw.h
  4. 4
      audio/compress_offload.c
  5. 47
      audio/include/samsung_audio.h

@ -36,6 +36,7 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/include \
external/tinyalsa/include \
external/tinycompress/include \
$(call include-path-for, audio-utils) \

@ -39,6 +39,8 @@
#include <cutils/sched_policy.h>
#include <cutils/properties.h>
#include <samsung_audio.h>
#include <hardware/audio_effect.h>
#include <system/thread_defs.h>
#include <audio_effects/effect_aec.h>
@ -64,7 +66,7 @@ static struct pcm_device_profile pcm_device_playback = {
.avail_min = PLAYBACK_AVAILABLE_MIN,
},
.card = SOUND_CARD,
.id = 9,
.id = SOUND_PLAYBACK_DEVICE,
.type = PCM_PLAYBACK,
.devices = AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|
AUDIO_DEVICE_OUT_SPEAKER,
@ -83,7 +85,7 @@ static struct pcm_device_profile pcm_device_capture = {
.avail_min = 0,
},
.card = SOUND_CARD,
.id = 0,
.id = SOUND_CAPTURE_DEVICE,
.type = PCM_CAPTURE,
.devices = AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC,
};
@ -101,11 +103,12 @@ static struct pcm_device_profile pcm_device_capture_low_latency = {
.avail_min = 0,
},
.card = SOUND_CARD,
.id = 0,
.id = SOUND_CAPTURE_DEVICE,
.type = PCM_CAPTURE_LOW_LATENCY,
.devices = AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC,
};
#ifdef SOUND_CAPTURE_LOOPBACK_AEC_DEVICE
static struct pcm_device_profile pcm_device_capture_loopback_aec = {
.config = {
.channels = CAPTURE_DEFAULT_CHANNEL_COUNT,
@ -119,10 +122,11 @@ static struct pcm_device_profile pcm_device_capture_loopback_aec = {
.avail_min = 0,
},
.card = SOUND_CARD,
.id = 1,
.id = SOUND_CAPTURE_LOOPBACK_AEC_DEVICE,
.type = PCM_CAPTURE,
.devices = SND_DEVICE_IN_LOOPBACK_AEC,
};
#endif
static struct pcm_device_profile pcm_device_playback_sco = {
.config = {
@ -137,7 +141,7 @@ static struct pcm_device_profile pcm_device_playback_sco = {
.avail_min = SCO_AVAILABLE_MIN,
},
.card = SOUND_CARD,
.id = 2,
.id = SOUND_PLAYBACK_SCO_DEVICE,
.type = PCM_PLAYBACK,
.devices =
AUDIO_DEVICE_OUT_BLUETOOTH_SCO|AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET|
@ -157,11 +161,12 @@ static struct pcm_device_profile pcm_device_capture_sco = {
.avail_min = 0,
},
.card = SOUND_CARD,
.id = 2,
.id = SOUND_CAPTURE_SCO_DEVICE,
.type = PCM_CAPTURE,
.devices = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET,
};
#ifdef SOUND_CAPTURE_HOTWORD_DEVICE
static struct pcm_device_profile pcm_device_hotword_streaming = {
.config = {
.channels = 1,
@ -175,10 +180,11 @@ static struct pcm_device_profile pcm_device_hotword_streaming = {
.avail_min = 0,
},
.card = SOUND_CARD,
.id = 0,
.id = SOUND_CAPTURE_HOTWORD_DEVICE,
.type = PCM_HOTWORD_STREAMING,
.devices = AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC
};
#endif
static struct pcm_device_profile * const pcm_devices[] = {
&pcm_device_playback,
@ -186,8 +192,12 @@ static struct pcm_device_profile * const pcm_devices[] = {
&pcm_device_capture_low_latency,
&pcm_device_playback_sco,
&pcm_device_capture_sco,
#ifdef SOUND_CAPTURE_LOOPBACK_AEC_DEVICE
&pcm_device_capture_loopback_aec,
#endif
#ifdef SOUND_CAPTURE_HOTWORD_DEVICE
&pcm_device_hotword_streaming,
#endif
NULL,
};

@ -120,9 +120,6 @@ enum {
};
#define MIXER_CARD 0
#define SOUND_CARD 0
/*
* tinyAlsa library interprets period size as number of frames
* one frame = channel_count * sizeof (pcm sample)

@ -37,8 +37,10 @@
#include <cutils/sched_policy.h>
#include <system/thread_defs.h>
#include "audio_hw.h"
#include <samsung_audio.h>
#include "audio_hw.h"
#include "sound/compress_params.h"
#define MIXER_CTL_COMPRESS_PLAYBACK_VOLUME "Compress Playback Volume"

@ -0,0 +1,47 @@
/*
* Copyright (C) 2017 The LineageOS 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 SAMSUNG_AUDIO_H
#define SAMSUNG_AUDIO_H
/*
* Sound card specific defines.
*
* This is an example configuration for a WolfsonMicro WM1814 sound card.
* Codec: Vegas
*
* If you driver does not support one of the devices, the id should not be
* defined.
*/
#define MIXER_CARD 0
#define SOUND_CARD 0
/* Playback */
#define SOUND_PLAYBACK_DEVICE 4
#define SOUND_PLAYBACK_SCO_DEVICE 2
/* Capture */
#define SOUND_CAPTURE_DEVICE 0
#define SOUND_CAPTURE_SCO_DEVICE 2
/* Unusupported
#define SOUND_CAPTURE_LOOPBACK_AEC_DEVICE 1
#define SOUND_CAPTURE_HOTWORD_DEVICE 0
*/
#endif // SAMSUNG_AUDIO_H
Loading…
Cancel
Save