Skip to content
Browse files

Merge remote-tracking branch 'pershoot/jellybean' into ics

Conflicts:
	init.p3.rc
	overlay/frameworks/base/core/res/res/values/config.xml
	p4-common.mk
	vold.fstab

Signed-off-by: KhasMek <Boushh@gmail.com>
  • Loading branch information...
2 parents 45a3219 + 0216b46 commit 9bf537554bee675c28a848b1bae0bc43ac243a03 @KhasMek KhasMek committed
View
3 BoardConfigCommon.mk
@@ -17,6 +17,7 @@
# This variable is set first, so it can be overridden
# by BoardConfigVendor.mk
BOARD_USES_GENERIC_AUDIO := false
+BOARD_USES_LIBSECRIL_STUB := true
USE_CAMERA_STUB := false
TARGET_OTA_ASSERT_SKIP := true
@@ -47,8 +48,6 @@ BOARD_EGL_CFG := device/samsung/p4-common/egl.cfg
#BOARD_USES_OVERLAY := true
USE_OPENGL_RENDERER := true
-BOARD_USES_AUDIO_LEGACY := true
-
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
#TARGET_RECOVERY_UI_LIB := librecovery_ui_ventana
View
9 camera/nvcamera.conf
@@ -0,0 +1,9 @@
+# format, cameraName=device,direction,orientation,type
+# type can be 'stereo' for stereo capable, 'mono' for not stereo capable,
+# 'usb' to enable searching for a usb device and where to put it in the list
+# if found. Lines must be shorter then 256 characters
+version=1
+camera0=/dev/s5k5ccgx,back,0,mono
+camera1=/dev/s5k5bbgx,front,0,mono
+#camera1=/dev/ov2710,front,0,mono
+#camera4=/dev/ov5650,back,0,stereo // virtual stereo device once supported
View
10 fstab.p3
@@ -0,0 +1,10 @@
+# Android fstab file.
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
+
+
+/dev/block/mmcblk0p4 /system ext4 ro wait
+/dev/block/mmcblk0p1 /efs ext4 noatime,nosuid,nodev wait
+/dev/block/mmcblk0p5 /cache ext4 noatime,nosuid,nodev wait,check
+/dev/block/mmcblk0p8 /data ext4 noatime,nosuid,nodev wait,check
View
56 init.p3.rc
@@ -4,13 +4,15 @@ on early-init
mount debugfs debugfs /sys/kernel/debug
write /sys/class/firmware/timeout 5
- export EXTERNAL_STORAGE /mnt/sdcard
- mkdir /mnt/sdcard 0000 system system
+ export EXTERNAL_STORAGE /storage/sdcard0
+ mkdir /storage 0050 system sdcard_r
+ mkdir /storage/sdcard0 0000 system system
# for backwards compatibility
- symlink /mnt/sdcard /sdcard
+ symlink /storage/sdcard0 /sdcard
+ symlink /storage/sdcard0 /mnt/sdcard
# create directory for mounting usb drives
- mkdir /mnt/usbdrive 0666 system system
+ mkdir /mnt/usbdrive 0664 system system
symlink /mnt/usbdrive /usbdrive
mkdir /efs 0771 system system
@@ -27,16 +29,14 @@ on init
mkdir /dev/pipes 0771 shell shell
on fs
- mount ext4 /dev/block/mmcblk0p4 /system wait ro
- setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000
- mount ext4 /dev/block/mmcblk0p5 /cache wait noatime nosuid nodev
- exec check_filesystem /dev/block/mmcblk0p8 ext4
- mount ext4 /dev/block/mmcblk0p8 /data wait noatime nosuid nodev discard,noauto_da_alloc
-
- # mound EFS partition
- mount ext4 /dev/block/mmcblk0p1 /efs wait noatime nosuid nodev
+ mount_all /fstab.p3
+ setprop ro.crypto.fuse_sdcard true
on post-fs-data
+ # we will remap this as /storage/sdcard0 with the sdcard fuse tool
+ mkdir /data/media 0770 media_rw media_rw
+ chown media_rw media_rw /data/media
+
chown radio system /efs
chmod 0771 /efs
chmod 0775 /efs/bluetooth
@@ -88,10 +88,6 @@ on post-fs-data
mkdir /data/log 0777 root root
chmod 0777 /data/log
- # we will remap this as /mnt/sdcard with the sdcard fuse tool
- mkdir /data/media 0775 media_rw media_rw
- chown media_rw media_rw /data/media
-
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
@@ -185,6 +181,11 @@ on boot
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
+# Enable KSM
+ write /sys/kernel/mm/ksm/sleep_millisecs 1400
+ write /sys/kernel/mm/ksm/pages_to_scan 200
+ write /sys/kernel/mm/ksm/run 1
+
# HSIC control
chown radio system /sys/devices/platform/tegra-ehci.1/ehci_power
@@ -255,6 +256,21 @@ service drm /system/bin/drmserver
user drm
group system root inet sdcard_rw
+# create virtual SD card at /storage/sdcard0, based on the /data/media directory
+# daemon will drop to user/group system/media_rw after initializing
+# underlying files in /data/media wil be created with user and group media_rw (1023)
+service sdcard /system/bin/sdcard /data/media 1023 1023
+ class late_start
+
+service p2p_supplicant /system/bin/wpa_supplicant \
+ -ieth0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
+ -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
+ -e/data/misc/wifi/entropy.bin
+ class main
+ socket wpa_eth0 dgram 660 wifi wifi
+ disabled
+ oneshot
+
service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -ieth0 \
-c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
class main
@@ -262,7 +278,7 @@ service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -ieth0 \
disabled
oneshot
-service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
+service dhcpcd_eth0 /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
@@ -298,12 +314,6 @@ service gpsd /system/bin/gpsd -c /system/etc/gps.xml
user gps
group system inet
-# create virtual SD card at /mnt/sdcard, based on the /data/media directory
-# daemon will drop to user/group system/media_rw after initializing
-# underlying files in /data/media wil be created with user and group media_rw (1023)
-service sdcard /system/bin/sdcard /data/media 1023 1023
- class late_start
-
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes \
--use_baudrate_for_download --baudrate 3000000 --patchram /etc/firmware/bcm4330B1.hcd /dev/ttyHS2
class main
View
38 init.p3.usb.rc
@@ -1,79 +1,79 @@
on init
- write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung
write /sys/class/android_usb/android0/f_rndis/vendorID 04e8
write /sys/class/android_usb/android0/f_rndis/wceis 1
on boot
- write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
- write /sys/class/android_usb/android0/iProduct $ro.product.model
+ write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
+ write /sys/class/android_usb/android0/iProduct ${ro.product.model}
on property:sys.usb.config=mtp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 685c
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6863
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 224
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6864
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 224
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6865
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6866
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,dm
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6862
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
View
20 keylayout/Vendor_04e8_Product_7021.kl
@@ -119,7 +119,7 @@ key 96 NUMPAD_ENTER
key 97 CTRL_RIGHT
key 98 NUMPAD_DIVIDE
key 99 SYSRQ
-key 100 ALT_GR
+key 100 ALT_RIGHT
# key 101 "KEY_LINEFEED"
key 102 MOVE_HOME
key 103 DPAD_UP
@@ -175,7 +175,7 @@ key 150 EXPLORER
key 152 POWER WAKE
# key 153 "KEY_DIRECTION"
# key 154 "KEY_CYCLEWINDOWS"
-key 155 EMAIL
+key 155 ENVELOPE
key 156 BOOKMARK
# key 157 "KEY_COMPUTER"
key 158 BACK WAKE_DROPPED
@@ -244,8 +244,8 @@ key 217 SEARCH
# key 221 "KEY_SHOP"
# key 222 "KEY_ALTERASE"
# key 223 "KEY_CANCEL"
-key 224 BRIGHTNESS_DOWN
-key 225 BRIGHTNESS_UP
+#key 224 BRIGHTNESS_DOWN
+#key 225 BRIGHTNESS_UP
key 226 HEADSETHOOK
key 227 STAR
key 228 POUND
@@ -297,7 +297,7 @@ key 362 GUIDE
key 366 DVR
# key 367 "KEY_MHP"
# key 368 "KEY_LANGUAGE"
-key 368 LANG
+#key 368 LANG
# key 369 "KEY_TITLE"
# key 370 "KEY_SUBTITLE"
# key 371 "KEY_ANGLE"
@@ -386,8 +386,8 @@ key 484 B FUNCTION
# key 504 KEY_BRL_DOT8
-key 704 RECENTAPPS
-key 705 APPLICATION
-key 706 SIP_ON_OFF
-key 707 VOICESEARCH
-key 708 QPANEL_ON_OFF
+key 704 APP_SWITCH
+#key 705 APPLICATION
+#key 706 SIP_ON_OFF
+#key 707 VOICESEARCH
+#key 708 QPANEL_ON_OFF
View
22 keylayout/sec_keyboard.kl
@@ -1,11 +1,11 @@
key 158 BACK WAKE_DROPPED
key 359 HOME WAKE_DROPPED
-key 61 RECENTAPPS WAKE_DROPPED
+key 61 APP_SWITCH WAKE_DROPPED
key 150 EXPLORER WAKE_DROPPED
-key 215 EMAIL WAKE_DROPPED
+key 215 ENVELOPE WAKE_DROPPED
key 152 POWER WAKE_DROPPED
-key 224 BRIGHTNESS_DOWN WAKE_DROPPED
-key 225 BRIGHTNESS_UP WAKE_DROPPED
+#key 224 BRIGHTNESS_DOWN WAKE_DROPPED
+#key 225 BRIGHTNESS_UP WAKE_DROPPED
key 113 MUTE WAKE_DROPPED
key 114 VOLUME_DOWN WAKE_DROPPED
key 115 VOLUME_UP WAKE_DROPPED
@@ -14,7 +14,7 @@ key 168 MEDIA_REWIND WAKE_DROPPED
key 208 MEDIA_FAST_FORWARD WAKE_DROPPED
key 163 MEDIA_NEXT WAKE_DROPPED
key 165 MEDIA_PREVIOUS WAKE_DROPPED
-key 185 APPLICATION WAKE_DROPPED
+#key 185 APPLICATION WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 111 FORWARD_DEL WAKE_DROPPED
@@ -48,7 +48,7 @@ key 26 LEFT_BRACKET WAKE_DROPPED
key 27 RIGHT_BRACKET WAKE_DROPPED
key 43 BACKSLASH WAKE_DROPPED
-key 58 CAPSLOCK WAKE_DROPPED
+key 58 CAPS_LOCK WAKE_DROPPED
key 30 A WAKE_DROPPED
key 31 S WAKE_DROPPED
key 32 D WAKE_DROPPED
@@ -77,13 +77,13 @@ key 53 SLASH WAKE_DROPPED
key 54 SHIFT_RIGHT WAKE_DROPPED
key 29 CTRL_LEFT WAKE_DROPPED
-key 187 SIP_ON_OFF WAKE_DROPPED
+#key 187 SIP_ON_OFF WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
-key 190 VOICESEARCH WAKE_DROPPED
+#key 190 VOICESEARCH WAKE_DROPPED
key 57 SPACE WAKE_DROPPED
-key 191 LANG WAKE_DROPPED
-key 192 QPANEL_ON_OFF WAKE_DROPPED
-key 100 ALT_GR WAKE_DROPPED
+#key 191 LANG WAKE_DROPPED
+#key 192 QPANEL_ON_OFF WAKE_DROPPED
+key 100 ALT_RIGHT WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
View
37 libaudio/Android.mk
@@ -0,0 +1,37 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES:= \
+ AudioHardware.cpp
+
+LOCAL_MODULE := audio.primary.p3
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_STATIC_LIBRARIES:= libmedia_helper
+LOCAL_SHARED_LIBRARIES:= \
+ libutils \
+ libhardware_legacy \
+ libtinyalsa \
+ libaudioutils
+
+LOCAL_WHOLE_STATIC_LIBRARIES := libaudiohw_legacy
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES += libdl
+LOCAL_C_INCLUDES += \
+ external/tinyalsa/include \
+ $(call include-path-for, audio-effects) \
+ $(call include-path-for, audio-utils)
+
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := AudioPolicyManager.cpp
+LOCAL_SHARED_LIBRARIES := libcutils libutils
+LOCAL_STATIC_LIBRARIES := libmedia_helper
+LOCAL_WHOLE_STATIC_LIBRARIES := libaudiopolicy_legacy
+LOCAL_MODULE := audio_policy.p3
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
View
2,233 libaudio/AudioHardware.cpp
2,233 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
378 libaudio/AudioHardware.h
@@ -0,0 +1,378 @@
+/*
+** Copyright 2008, 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 ANDROID_AUDIO_HARDWARE_H
+#define ANDROID_AUDIO_HARDWARE_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <utils/threads.h>
+#include <utils/SortedVector.h>
+
+#include <hardware_legacy/AudioHardwareBase.h>
+#include <hardware/audio_effect.h>
+
+#include "secril-client.h"
+
+#include <audio_utils/resampler.h>
+#include <audio_utils/echo_reference.h>
+
+extern "C" {
+ struct pcm;
+ struct mixer;
+ struct mixer_ctl;
+};
+
+namespace android_audio_legacy {
+ using android::AutoMutex;
+ using android::Mutex;
+ using android::RefBase;
+ using android::SortedVector;
+ using android::sp;
+ using android::String16;
+ using android::Vector;
+
+// TODO: determine actual audio DSP and hardware latency
+// Additional latency introduced by audio DSP and hardware in ms
+#define AUDIO_HW_OUT_LATENCY_MS 0
+// Default audio output sample rate
+#define AUDIO_HW_OUT_SAMPLERATE 44100
+// Default audio output channel mask
+#define AUDIO_HW_OUT_CHANNELS (AudioSystem::CHANNEL_OUT_STEREO)
+// Default audio output sample format
+#define AUDIO_HW_OUT_FORMAT (AudioSystem::PCM_16_BIT)
+// Kernel pcm out buffer size in frames at 44.1kHz
+#define AUDIO_HW_OUT_PERIOD_SZ 1024
+#define AUDIO_HW_OUT_PERIOD_CNT 4
+// Default audio output buffer size in bytes
+#define AUDIO_HW_OUT_PERIOD_BYTES (AUDIO_HW_OUT_PERIOD_SZ * 2 * sizeof(int16_t))
+
+// Default audio input sample rate
+#define AUDIO_HW_IN_SAMPLERATE 44100
+// Default audio input channel mask
+#define AUDIO_HW_IN_CHANNELS (AudioSystem::CHANNEL_IN_MONO)
+// Default audio input sample format
+#define AUDIO_HW_IN_FORMAT (AudioSystem::PCM_16_BIT)
+// Kernel pcm in buffer size in frames at 44.1kHz (before resampling)
+#define AUDIO_HW_IN_PERIOD_SZ 1024
+#define AUDIO_HW_IN_PERIOD_CNT 4
+// Default audio input buffer size in bytes (8kHz mono)
+#define AUDIO_HW_IN_PERIOD_BYTES ((AUDIO_HW_IN_PERIOD_SZ*sizeof(int16_t))/8)
+
+
+class AudioHardware : public AudioHardwareBase
+{
+ class AudioStreamOutALSA;
+ class AudioStreamInALSA;
+
+public:
+
+ // input path names used to translate from input sources to driver paths
+ static const char *inputPathNameDefault;
+ static const char *inputPathNameCamcorder;
+ static const char *inputPathNameVoiceRecognition;
+ static const char *inputPathNameVoiceCommunication;
+
+ AudioHardware();
+ virtual ~AudioHardware();
+ virtual status_t initCheck();
+
+ virtual status_t setVoiceVolume(float volume);
+ virtual status_t setMasterVolume(float volume);
+
+ virtual status_t setMode(int mode);
+
+ virtual status_t setMicMute(bool state);
+ virtual status_t getMicMute(bool* state);
+
+ virtual status_t setParameters(const String8& keyValuePairs);
+ virtual String8 getParameters(const String8& keys);
+
+ virtual AudioStreamOut* openOutputStream(
+ uint32_t devices, int *format=0, uint32_t *channels=0,
+ uint32_t *sampleRate=0, status_t *status=0);
+
+ virtual AudioStreamIn* openInputStream(
+ uint32_t devices, int *format, uint32_t *channels,
+ uint32_t *sampleRate, status_t *status,
+ AudioSystem::audio_in_acoustics acoustics);
+
+ virtual void closeOutputStream(AudioStreamOut* out);
+ virtual void closeInputStream(AudioStreamIn* in);
+
+ virtual size_t getInputBufferSize(
+ uint32_t sampleRate, int format, int channelCount);
+
+ int mode() { return mMode; }
+ const char *getOutputRouteFromDevice(uint32_t device);
+ const char *getInputRouteFromDevice(uint32_t device);
+ const char *getVoiceRouteFromDevice(uint32_t device);
+
+ status_t setIncallPath_l(uint32_t device);
+
+ status_t setInputSource_l(audio_source source);
+
+ void setVoiceVolume_l(float volume);
+
+ static uint32_t getInputSampleRate(uint32_t sampleRate);
+ sp <AudioStreamInALSA> getActiveInput_l();
+
+ Mutex& lock() { return mLock; }
+
+ struct pcm *openPcmOut_l();
+ void closePcmOut_l();
+
+ struct mixer *openMixer_l();
+ void closeMixer_l();
+
+ sp <AudioStreamOutALSA> output() { return mOutput; }
+
+ struct echo_reference_itfe *getEchoReference(audio_format_t format,
+ uint32_t channelCount,
+ uint32_t samplingRate);
+ void releaseEchoReference(struct echo_reference_itfe *reference);
+
+protected:
+ virtual status_t dump(int fd, const Vector<String16>& args);
+
+private:
+
+ enum tty_modes {
+ TTY_MODE_OFF,
+ TTY_MODE_VCO,
+ TTY_MODE_HCO,
+ TTY_MODE_FULL
+ };
+
+ bool mInit;
+ bool mMicMute;
+ sp <AudioStreamOutALSA> mOutput;
+ SortedVector < sp<AudioStreamInALSA> > mInputs;
+ Mutex mLock;
+ struct pcm* mPcm;
+ struct mixer* mMixer;
+ uint32_t mPcmOpenCnt;
+ uint32_t mMixerOpenCnt;
+ bool mInCallAudioMode;
+ float mVoiceVol;
+
+ audio_source mInputSource;
+ bool mBluetoothNrec;
+ int mTTYMode;
+
+ void* mSecRilLibHandle;
+ HRilClient mRilClient;
+ bool mActivatedCP;
+ HRilClient (*openClientRILD) (void);
+ int (*disconnectRILD) (HRilClient);
+ int (*closeClientRILD) (HRilClient);
+ int (*isConnectedRILD) (HRilClient);
+ int (*connectRILD) (HRilClient);
+ int (*setCallVolume) (HRilClient, SoundType, int);
+ int (*setCallAudioPath)(HRilClient, AudioPath);
+ int (*setCallClockSync)(HRilClient, SoundClockCondition);
+ void loadRILD(void);
+ status_t connectRILDIfRequired(void);
+ struct echo_reference_itfe *mEchoReference;
+
+ // trace driver operations for dump
+ int mDriverOp;
+
+ static uint32_t checkInputSampleRate(uint32_t sampleRate);
+
+ // column index in inputConfigTable[][]
+ enum {
+ INPUT_CONFIG_SAMPLE_RATE,
+ INPUT_CONFIG_BUFFER_RATIO,
+ INPUT_CONFIG_CNT
+ };
+
+ // contains the list of valid sampling rates for input streams as well as the ratio
+ // between the kernel buffer size and audio hal buffer size for each sampling rate
+ static const uint32_t inputConfigTable[][INPUT_CONFIG_CNT];
+
+ class AudioStreamOutALSA : public AudioStreamOut, public RefBase
+ {
+ public:
+ AudioStreamOutALSA();
+ virtual ~AudioStreamOutALSA();
+ status_t set(AudioHardware* mHardware,
+ uint32_t devices,
+ int *pFormat,
+ uint32_t *pChannels,
+ uint32_t *pRate);
+ virtual uint32_t sampleRate()
+ const { return mSampleRate; }
+ virtual size_t bufferSize()
+ const { return mBufferSize; }
+ virtual uint32_t channels()
+ const { return mChannels; }
+ virtual int format()
+ const { return AUDIO_HW_OUT_FORMAT; }
+ virtual uint32_t latency()
+ const { return (1000 * AUDIO_HW_OUT_PERIOD_CNT *
+ (bufferSize()/frameSize()))/sampleRate() +
+ AUDIO_HW_OUT_LATENCY_MS; }
+ virtual status_t setVolume(float left, float right)
+ { return INVALID_OPERATION; }
+ virtual ssize_t write(const void* buffer, size_t bytes);
+ virtual status_t standby();
+ bool checkStandby();
+
+ virtual status_t dump(int fd, const Vector<String16>& args);
+ virtual status_t setParameters(const String8& keyValuePairs);
+ virtual String8 getParameters(const String8& keys);
+ uint32_t device() { return mDevices; }
+ virtual status_t getRenderPosition(uint32_t *dspFrames);
+
+ void doStandby_l();
+ void close_l();
+ status_t open_l();
+ int standbyCnt() { return mStandbyCnt; }
+
+ int prepareLock();
+ void lock();
+ void unlock();
+
+ void addEchoReference(struct echo_reference_itfe *reference);
+ void removeEchoReference(struct echo_reference_itfe *reference);
+
+ private:
+
+ int computeEchoReferenceDelay(size_t frames, struct timespec *echoRefRenderTime);
+ int getPlaybackDelay(size_t frames, struct echo_reference_buffer *buffer);
+
+ Mutex mLock;
+ AudioHardware* mHardware;
+ struct pcm *mPcm;
+ struct mixer *mMixer;
+ struct mixer_ctl *mRouteCtl;
+ const char *next_route;
+ bool mStandby;
+ uint32_t mDevices;
+ uint32_t mChannels;
+ uint32_t mSampleRate;
+ size_t mBufferSize;
+ // trace driver operations for dump
+ int mDriverOp;
+ int mStandbyCnt;
+ bool mSleepReq;
+ struct echo_reference_itfe *mEchoReference;
+ };
+
+ class AudioStreamInALSA : public AudioStreamIn, public RefBase
+ {
+
+ public:
+ AudioStreamInALSA();
+ virtual ~AudioStreamInALSA();
+ status_t set(AudioHardware* hw,
+ uint32_t devices,
+ int *pFormat,
+ uint32_t *pChannels,
+ uint32_t *pRate,
+ AudioSystem::audio_in_acoustics acoustics);
+ virtual size_t bufferSize() const { return mBufferSize; }
+ virtual uint32_t channels() const { return mChannels; }
+ virtual int format() const { return AUDIO_HW_IN_FORMAT; }
+ virtual uint32_t sampleRate() const { return mSampleRate; }
+ virtual status_t setGain(float gain) { return INVALID_OPERATION; }
+ virtual ssize_t read(void* buffer, ssize_t bytes);
+ virtual status_t dump(int fd, const Vector<String16>& args);
+ virtual status_t standby();
+ bool checkStandby();
+ virtual status_t setParameters(const String8& keyValuePairs);
+ virtual String8 getParameters(const String8& keys);
+ virtual unsigned int getInputFramesLost() const { return 0; }
+ virtual status_t addAudioEffect(effect_handle_t effect);
+ virtual status_t removeAudioEffect(effect_handle_t effect);
+
+ uint32_t device() { return mDevices; }
+ void doStandby_l();
+ void close_l();
+ status_t open_l();
+ int standbyCnt() { return mStandbyCnt; }
+
+ static size_t getBufferSize(uint32_t sampleRate, int channelCount);
+
+ // resampler_buffer_provider
+ static int getNextBufferStatic(struct resampler_buffer_provider *provider,
+ struct resampler_buffer* buffer);
+ static void releaseBufferStatic(struct resampler_buffer_provider *provider,
+ struct resampler_buffer* buffer);
+
+ int prepareLock();
+ void lock();
+ void unlock();
+
+ private:
+
+ struct ResamplerBufferProvider {
+ struct resampler_buffer_provider mProvider;
+ AudioStreamInALSA *mInputStream;
+ };
+
+ ssize_t readFrames(void* buffer, ssize_t frames);
+ ssize_t processFrames(void* buffer, ssize_t frames);
+ int32_t updateEchoReference(size_t frames);
+ void pushEchoReference(size_t frames);
+ void updateEchoDelay(size_t frames, struct timespec *echoRefRenderTime);
+ void getCaptureDelay(size_t frames, struct echo_reference_buffer *buffer);
+ status_t setPreProcessorEchoDelay(effect_handle_t handle, int32_t delayUs);
+ status_t setPreprocessorParam(effect_handle_t handle, effect_param_t *param);
+
+ // BufferProvider
+ status_t getNextBuffer(struct resampler_buffer* buffer);
+ void releaseBuffer(struct resampler_buffer* buffer);
+
+ Mutex mLock;
+ AudioHardware* mHardware;
+ struct pcm *mPcm;
+ struct mixer *mMixer;
+ struct mixer_ctl *mRouteCtl;
+ const char *next_route;
+ bool mStandby;
+ uint32_t mDevices;
+ uint32_t mChannels;
+ uint32_t mChannelCount;
+ uint32_t mSampleRate;
+ size_t mBufferSize;
+ struct resampler_itfe *mDownSampler;
+ struct ResamplerBufferProvider mBufferProvider;
+ status_t mReadStatus;
+ size_t mInputFramesIn;
+ int16_t *mInputBuf;
+ // trace driver operations for dump
+ int mDriverOp;
+ int mStandbyCnt;
+ bool mSleepReq;
+ SortedVector<effect_handle_t> mPreprocessors;
+ int16_t *mProcBuf;
+ size_t mProcBufSize;
+ size_t mProcFramesIn;
+ int16_t *mRefBuf;
+ size_t mRefBufSize;
+ size_t mRefFramesIn;
+ struct echo_reference_itfe *mEchoReference;
+ bool mNeedEchoReference;
+ };
+
+};
+
+}; // namespace android
+
+#endif
View
45 libaudio/AudioPolicyManager.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+#define LOG_TAG "AudioPolicyManager"
+//#define LOG_NDEBUG 0
+#include <utils/Log.h>
+#include "AudioPolicyManager.h"
+
+namespace android_audio_legacy {
+
+
+
+// ----------------------------------------------------------------------------
+// AudioPolicyManager for crespo platform
+// Common audio policy manager code is implemented in AudioPolicyManagerBase class
+// ----------------------------------------------------------------------------
+
+// --- class factory
+
+
+extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface)
+{
+ return new AudioPolicyManager(clientInterface);
+}
+
+extern "C" void destroyAudioPolicyManager(AudioPolicyInterface *interface)
+{
+ delete interface;
+}
+
+
+}; // namespace android
View
38 libaudio/AudioPolicyManager.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <utils/Timers.h>
+#include <utils/Errors.h>
+#include <utils/KeyedVector.h>
+#include <hardware_legacy/AudioPolicyManagerBase.h>
+
+
+namespace android_audio_legacy {
+
+class AudioPolicyManager: public AudioPolicyManagerBase
+{
+
+public:
+ AudioPolicyManager(AudioPolicyClientInterface *clientInterface)
+ : AudioPolicyManagerBase(clientInterface) {}
+
+ virtual ~AudioPolicyManager() {}
+
+};
+};
View
68 libaudio/audio_policy.conf
@@ -0,0 +1,68 @@
+# Global configuration section: lists input and output devices always present on the device
+# as well as the output device selected by default.
+# Devices are designated by a string that corresponds to the enum in audio.h
+
+global_configuration {
+ attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER
+ default_output_device AUDIO_DEVICE_OUT_SPEAKER
+ attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC
+}
+
+# audio hardware module section: contains descriptors for all audio hw modules present on the
+# device. Each hw module node is named after the corresponding hw module library base name.
+# For instance, "primary" corresponds to audio.primary.<device>.so.
+# The "primary" module is mandatory and must include at least one output with
+# AUDIO_OUTPUT_FLAG_PRIMARY flag.
+# Each module descriptor contains one or more output profile descriptors and zero or more
+# input profile descriptors. Each profile lists all the parameters supported by a given output
+# or input stream category.
+# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
+# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
+
+audio_hw_modules {
+ primary {
+ outputs {
+ primary {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
+ flags AUDIO_OUTPUT_FLAG_PRIMARY
+ }
+ }
+ inputs {
+ primary {
+ sampling_rates 8000|11025|16000|22050|32000|44100
+ channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET
+ }
+ }
+ }
+ a2dp {
+ outputs {
+ a2dp {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_ALL_A2DP
+ }
+ }
+ }
+ usb {
+ outputs {
+ usb_accessory {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_USB_ACCESSORY
+ }
+ usb_device {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_USB_DEVICE
+ }
+ }
+ }
+}
View
1,237 libaudio/libasound.conf
@@ -0,0 +1,1237 @@
+# Android ALSA configuration file for the WM8994 audio.
+
+
+##################################################################################################################################
+#
+# {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+# # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+# # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+# {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear MIC 2:BT MIC
+# {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+# {name "Voice Call Recording" value 1} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+# {name "Voip Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+#
+##################################################################################################################################
+
+##
+## Mixer Devices
+##
+
+ctl.AndroidPlayback {
+ type hw
+ card 0
+}
+
+ctl.AndroidRecord {
+ type hw
+ card 0
+}
+
+
+##
+## Playback Devices
+##
+
+pcm.AndroidPlayback {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Earpiece {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 2}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 3}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headphone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 4}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 5}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Earpiece_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 1}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 2}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 3}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headphone_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 4}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 5}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headset_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 6}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headphone_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 6}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+pcm.AndroidPlayback_Speaker_LineOut_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 2}
+ {name "Playback Path" value 11}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_LineOut_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 2}
+ {name "Playback Path" value 11}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_LineOut_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 11}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+
+pcm.AndroidPlayback_Hdmi_TVOut_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 13}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Hdmi_TVOut_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 14}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Hdmi_TVOut_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 15}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Earpiece_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 6}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 10}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 8}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 5}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headset_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 10}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headphone_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Playback Path" value 10}
+ # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT 6:SPK_HP 7:RING_SPK
+ # 8:RING_HP 9:RING_HP_NO_MIC 10:RING_SPK_HP 11:EXTRA_DOCK_SPEAKER
+ # 12:TV_OUT 13:HDMI_TV_OUT 14:HDMI_SPK 15:HDMI_DUAL
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Earpiece_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headphone_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headset_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+
+#
+# FMRadio
+#
+pcm.AndroidPlayback_Speaker_fmradio {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 1} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_fmradio {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 2} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headset_fmradio {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 5} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX 5:DUAL MIX
+ ]
+ }
+}
+#
+# FM Radio + AP Play
+#
+pcm.AndroidPlayback_Speaker_dualinput {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 3} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_dualinput {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 4} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_Headset_dualinput {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "FM Radio Path" value 5} # 0:OFF 1:SPK 2:HP 3:SPK_MIX 4:HP_MIX 5:SPK_HP_MIX
+ ]
+ }
+}
+
+#
+# Video Call - Output stream
+#
+pcm.AndroidPlayback_Earpiece_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headphone_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+
+##
+## Capture device
+##
+
+pcm.AndroidRecord {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Microphone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Earpiece_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Sub MIC
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headset_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Bluetooth_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 2} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_Headset_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headset_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headphone_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_Headset_ringtone {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear Mic 2:BT Mic 3:OFF
+ ]
+ }
+}
+
+pcm.AndroidRecord_Earpiece_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 1} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 1} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headset_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 2} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headphone_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 1} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+pcm.AndroidRecord_Bluetooth_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 0} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_Headset_incall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "Voice Call Recording" value 0} # 0:CALL_RECORDING_OFF 1:CALL_RECORDING_MAIN 2:CALL_RECORDING_SUB
+ ]
+ }
+}
+
+#
+# Video Call - Input stream
+#
+pcm.AndroidRecord_Earpiece_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ # Already called codec path by Video call outputstream
+ ]
+ }
+}
+
+pcm.AndroidRecord_Speaker_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ # Already called codec path by Video call outputstream
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headset_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ # Already called codec path by Video call outputstream
+ ]
+ }
+}
+
+pcm.AndroidRecord_Headphone_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ # Already called codec path by Video call outputstream
+ ]
+ }
+}
+
+pcm.AndroidRecord_Bluetooth_videocall {
+ type hooks
+ slave.pcm {
+ type hw
+ card 1
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ # Already called codec path by Video call outputstream
+ #{name "Voice Call Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP3P 4:HP4P 5:BT
+ ]
+ }
+}
+
+
+#
+# ATV - Input stream (LTN_ATV)
+#
+pcm.AndroidRecord_Atv_normal {
+ type hooks
+ slave.pcm {
+ type hw
+ card 2
+ device 0 # Must be of type "digital audio capture"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ ]
+ }
+}
+
+
+## FEATURE_SEC_KOREA_MM_AUDIO
+##
+## Playback VOIP Call Devices
+##
+
+pcm.AndroidPlayback_Earpiece_voip {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "VoIP Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Speaker_voip {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "VoIP Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headset_voip {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "VoIP Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Headphone_voip {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ # Enable audio output from the DSP
+ {name "VoIP Call Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
+
+pcm.AndroidPlayback_Bluetooth_voip {
+ type hooks
+ slave.pcm {
+ type hw
+ card 0
+ device 0 # Must be of type "digital audio playback"
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {name "VoIP Call Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT
+ ]
+ }
+}
View
175 libaudio/secril-client.h
@@ -0,0 +1,175 @@
+/*
+ * Copyright (C) 2010 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 __SECRIL_CLIENT_H__
+#define __SECRIL_CLIENT_H__
+
+#include <sys/types.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct RilClient {
+ void *prv;
+};
+
+typedef struct RilClient * HRilClient;
+
+
+//---------------------------------------------------------------------------
+// Defines
+//---------------------------------------------------------------------------
+#define RIL_CLIENT_ERR_SUCCESS 0
+#define RIL_CLIENT_ERR_AGAIN 1
+#define RIL_CLIENT_ERR_INIT 2 // Client is not initialized
+#define RIL_CLIENT_ERR_INVAL 3 // Invalid value
+#define RIL_CLIENT_ERR_CONNECT 4 // Connection error
+#define RIL_CLIENT_ERR_IO 5 // IO error
+#define RIL_CLIENT_ERR_RESOURCE 6 // Resource not available
+#define RIL_CLIENT_ERR_UNKNOWN 7
+
+
+//---------------------------------------------------------------------------
+// Type definitions
+//---------------------------------------------------------------------------
+
+typedef int (*RilOnComplete)(HRilClient handle, const void *data, size_t datalen);
+
+typedef int (*RilOnUnsolicited)(HRilClient handle, const void *data, size_t datalen);
+
+typedef int (*RilOnError)(void *data, int error);
+
+
+//---------------------------------------------------------------------------
+// Client APIs
+//---------------------------------------------------------------------------
+
+/**
+ * Open RILD multi-client.
+ * Return is client handle, NULL on error.
+ */
+HRilClient OpenClient_RILD(void);
+
+/**
+ * Stop RILD multi-client. If client socket was connected,
+ * it will be disconnected.
+ */
+int CloseClient_RILD(HRilClient client);
+
+/**
+ * Connect to RIL deamon. One client task starts.
+ * Return is 0 or error code.
+ */
+int Connect_RILD(HRilClient client);
+
+/**
+ * check whether RILD is connected
+ * Returns 0 or 1
+ */
+int isConnected_RILD(HRilClient client);
+
+/**
+ * Disconnect connection to RIL deamon(socket close).
+ * Return is 0 or error code.
+ */
+int Disconnect_RILD(HRilClient client);
+
+/**
+ * Register unsolicited response handler. If handler is NULL,
+ * the handler for the request ID is unregistered.
+ * The response handler is invoked in the client task context.
+ * Return is 0 or error code.
+ */
+int RegisterUnsolicitedHandler(HRilClient client, uint32_t id, RilOnUnsolicited handler);
+
+/**
+ * Register solicited response handler. If handler is NULL,
+ * the handler for the ID is unregistered.
+ * The response handler is invoked in the client task context.
+ * Return is 0 or error code.
+ */
+int RegisterRequestCompleteHandler(HRilClient client, uint32_t id, RilOnComplete handler);
+
+/**
+ * Register error callback. If handler is NULL,
+ * the callback is unregistered.
+ * The response handler is invoked in the client task context.
+ * Return is 0 or error code.
+ */
+int RegisterErrorCallback(HRilClient client, RilOnError cb, void *data);
+
+/**
+ * Invoke OEM request. Request ID is RIL_REQUEST_OEM_HOOK_RAW.
+ * Return is 0 or error code. For RIL_CLIENT_ERR_AGAIN caller should retry.
+ */
+int InvokeOemRequestHookRaw(HRilClient client, char *data, size_t len);
+
+/**
+ * Sound device types.
+ */
+typedef enum _SoundType {
+ SOUND_TYPE_VOICE,
+ SOUND_TYPE_SPEAKER,
+ SOUND_TYPE_HEADSET,
+ SOUND_TYPE_BTVOICE
+} SoundType;
+
+/**
+ * External sound device path.
+ */
+typedef enum _AudioPath {
+ SOUND_AUDIO_PATH_HANDSET,
+ SOUND_AUDIO_PATH_HEADSET,
+ SOUND_AUDIO_PATH_SPEAKER,
+ SOUND_AUDIO_PATH_BLUETOOTH,
+ SOUND_AUDIO_PATH_BLUETOOTH_NO_NR,
+ SOUND_AUDIO_PATH_HEADPHONE
+} AudioPath;
+
+/**
+ * Clock adjustment parameters.
+ */
+typedef enum _SoundClockCondition {
+ SOUND_CLOCK_STOP,
+ SOUND_CLOCK_START
+} SoundClockCondition;
+
+/**
+ * Set in-call volume.
+ */
+int SetCallVolume(HRilClient client, SoundType type, int vol_level);
+
+/**
+ * Set external sound device path for noise reduction.
+ */
+int SetCallAudioPath(HRilClient client, AudioPath path);
+
+/**
+ * Set modem clock to master or slave.
+ */
+int SetCallClockSync(HRilClient client, SoundClockCondition condition);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif // __SECRIL_CLIENT_H__
+
+// end of file
+
View
110 media_codecs.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright (C) 2012 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.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT MediaCodecs (Decoders,Encoders)>
+<!ELEMENT Decoders (MediaCodec*)>
+<!ELEMENT Encoders (MediaCodec*)>
+<!ELEMENT MediaCodec (Type*,Quirk*)>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+ <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+ <MediaCodec name="OMX.foo.bar" >
+ <Type name="something/interesting" />
+ <Type name="something/else" />
+ ...
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="output-buffers-are-unreadable" />
+ </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+ must be advertised if the component does not properly support specification
+ of input buffers using the OMX_UseBuffer(...) API but instead requires
+ OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+ must be advertised if the component does not properly support specification
+ of output buffers using the OMX_UseBuffer(...) API but instead requires
+ OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+ must be advertised if the emitted output buffers of a decoder component
+ are not readable, i.e. use a custom format even though abusing one of
+ the official OMX colorspace constants.
+ Clients of such decoders will not be able to access the decoded data,
+ naturally making the component much less useful. The only use for
+ a component with this quirk is to render the output to the screen.
+ Audio decoders MUST NOT advertise this quirk.
+ Video decoders that advertise this quirk must be accompanied by a
+ corresponding color space converter for thumbnail extraction,
+ matching surfaceflinger support that can render the custom format to
+ a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+-->
+
+<MediaCodecs>
+ <Decoders>
+ <MediaCodec name="OMX.Nvidia.mp4.decode" type="video/mp4v-es" />
+ <MediaCodec name="OMX.Nvidia.h263.decode" type="video/3gpp" />
+ <MediaCodec name="OMX.Nvidia.h264.decode" type="video/avc" />
+ <MediaCodec name="OMX.Nvidia.mpeg2v.decode" type="video/mpeg2" />
+ <MediaCodec name="OMX.Nvidia.mp2.decoder" type="audio/mpeg-L2" />
+
+ <MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />
+ <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
+ <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
+ <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
+ <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
+ <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
+ <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
+
+ <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
+ <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
+ <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
+ <MediaCodec name="OMX.google.vpx.decoder" type="video/x-vnd.on2.vp8" />
+ </Decoders>
+
+ <Encoders>
+ <MediaCodec name="OMX.Nvidia.mp4.encoder" type="video/mp4v-es" />
+ <MediaCodec name="OMX.Nvidia.h263.encoder" type="video/3gpp" />
+ <MediaCodec name="OMX.Nvidia.h264.encoder" type="video/avc" />
+
+ <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
+ <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
+ <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
+ <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />
+ </Encoders>
+</MediaCodecs>
View
29 overlay/frameworks/base/core/res/res/values/config.xml
@@ -115,6 +115,30 @@
<item>0</item>
</integer-array>
+ <!-- Array of output values for keyboard backlight corresponding to the LUX values
+ in the config_autoBrightnessLevels array. This array should have size one greater
+ than the size of the config_autoBrightnessLevels array.
+ This must be overridden in platform specific overlays -->
+ <integer-array name="config_autoBrightnessKeyboardBacklightValues">
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ </integer-array>
+
<!-- Minimum screen brightness allowed by the power manager. -->
<integer name="config_screenBrightnessDim">10</integer>
@@ -131,8 +155,9 @@
<!-- Boolean indicating whether the wifi chipset has background scan support -->
<bool translatable="false" name="config_wifi_background_scan_support">true</bool>
- <string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
+ <string name="config_networkLocationProviderPackageName">com.google.android.location</string>
- <string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
+ <string name="config_geocodeProviderPackageName">com.google.android.location</string>
+ <bool name="config_forceDisableHardwareKeyboard">true</bool>
</resources>
View
7 overlay/frameworks/base/core/res/res/xml/storage_list.xml
@@ -33,9 +33,14 @@
-->
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
- <storage android:mountPoint="/mnt/sdcard"
+ <storage android:mountPoint="/storage/sdcard0"
android:storageDescription="@string/storage_internal"
android:primary="true"
android:emulated="true"
android:mtpReserve="100" />
+
+ <storage android:mountPoint="/mnt/usbdrive"
+ android:storageDescription="@string/storage_usb"
+ android:primary="false"
+ android:removable="true" />
</StorageList>
View
20 overlay/packages/apps/Settings/res/values/bools.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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