From d30210153d8f19a0ca825b33f2282b9ae071c6ec Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Sun, 22 Jul 2012 15:24:24 +0200 Subject: jellybeaned --- audio/audio_hw.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'audio/audio_hw.h') diff --git a/audio/audio_hw.h b/audio/audio_hw.h index e264c4a..3cd62db 100644 --- a/audio/audio_hw.h +++ b/audio/audio_hw.h @@ -3,6 +3,7 @@ * Copyright (C) 2012 Wolfson Microelectronics plc * Copyright (C) 2012 The CyanogenMod Project * Daniel Hillenbrand + * Guillaume "XpLoDWilD" Lesniak * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,12 +26,28 @@ #define PORT_BT 2 #define PORT_CAPTURE 3 +#define PCM_WRITE pcm_write + #define PLAYBACK_PERIOD_SIZE 880 #define PLAYBACK_PERIOD_COUNT 8 +#define PLAYBACK_SHORT_PERIOD_COUNT 2 #define CAPTURE_PERIOD_SIZE 1056 #define CAPTURE_PERIOD_COUNT 2 +#define SHORT_PERIOD_SIZE 192 + +// +// deep buffer +// +/* screen on */ +#define DEEP_BUFFER_SHORT_PERIOD_SIZE 1056 +#define PLAYBACK_DEEP_BUFFER_SHORT_PERIOD_COUNT 4 +/* screen off */ +#define DEEP_BUFFER_LONG_PERIOD_SIZE 880 +#define PLAYBACK_DEEP_BUFFER_LONG_PERIOD_COUNT 8 + + /* minimum sleep time in out_write() when write threshold is not reached */ #define MIN_WRITE_SLEEP_US 5000 @@ -38,6 +55,8 @@ #define RESAMPLER_BUFFER_SIZE (4 * RESAMPLER_BUFFER_FRAMES) #define DEFAULT_OUT_SAMPLING_RATE 44100 +#define MM_LOW_POWER_SAMPLING_RATE 44100 +#define MM_FULL_POWER_SAMPLING_RATE 44100 #define DEFAULT_IN_SAMPLING_RATE 44100 /* sampling rate when using VX port for narrow band */ @@ -49,6 +68,35 @@ #define PRODUCT_DEVICE_PROPERTY "ro.product.device" #define PRODUCT_NAME_PROPERTY "ro.product.name" +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + +#define STRING_TO_ENUM(string) { #string, string } + +struct string_to_enum { + const char *name; + uint32_t value; +}; + +const struct string_to_enum out_channels_name_to_enum_table[] = { + STRING_TO_ENUM(AUDIO_CHANNEL_OUT_STEREO), + STRING_TO_ENUM(AUDIO_CHANNEL_OUT_5POINT1), + STRING_TO_ENUM(AUDIO_CHANNEL_OUT_7POINT1), +}; + +enum pcm_type { + PCM_NORMAL = 0, + PCM_SPDIF, + PCM_HDMI, + PCM_TOTAL, +}; + +enum output_type { + OUTPUT_DEEP_BUF, // deep PCM buffers output stream + OUTPUT_LOW_LATENCY, // low latency output stream + OUTPUT_HDMI, + OUTPUT_TOTAL +}; + enum tty_modes { TTY_MODE_OFF, TTY_MODE_VCO, -- cgit v1.1