Blaze AIC AIC3262 SW Release3

= Introduction = This document explains the steps involved in enabling the AIC3262 Audio playback/recording on Blaze Tablet2 platform

Blaze_AIC_Tablet2 = Blaze_Tablet2 + OMAP4 processor card with AIC3262 audio codec

This software release has been developed and verified in the following software and hardware environment.

OS Kernel: Linux® 3.0 Android:  Android IcecreamSandwich 4.0.3 MR1 Toolchain: CodeSourcery compiler version Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux Reference hardware platforms: TI OMAP4 4460 ES1.1 HS blaze_tablet and also TI OMAP4 4460 ES1.1 HS blaze Build Host OS: Ubuntu Daily Build Blaze_Tablet Version: IceCream_Blaze_Tablet_DailyBuild_398 Daily Build Blaze Version: IceCream_Blaze_DailyBuild_404 Reference software release http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Downloading_Release_Software

This document assumes that
 * The user is famillier with Blaze Tablet2 platform. Please refer the info given here http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes.
 * User has access to Blaze Tablet2 platform
 * User has access to "OMAP4 Processor card with AIC3262 audio codec"

Release summary
 * Android GUI : Playback on Headphone and Speakers on Blaze and Blaze Tablet2
 * Android GUI : Record from Headset microphone on Blaze and Blaze Tablet2
 * Android GUI : Record from Main microphone and sub microphone on Blaze
 * Command-line: Playback on Headphone and Speakers on Blaze and Blaze Tablet2
 * Command-line: Record from Headset microphone on Blaze and Blaze Tablet2
 * Command-line: Record from Main microphone and sub microphone on Blaze

=Installation=
 * Hardware
 * Install the Processor card (OMAP4+AIC3262) onto Blaze Tablet2 platform. This platform is referred as Blaze_AIC_Tablet2
 * Install the Processor card (OMAP4+AIC3262) onto Blaze platform. This platform is referred as Blaze_AIC

=Release Content= This release Blaze_AIC_AIC3262_SW_Release2.zip contains three files
 * Patch to be applied on top of the Kernel. Kernel can be pulled from http://omapedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Downloading_Release_Software
 * Patch to be applied on top of Android ICS . ICS can be pulled from http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Downloading_Release_Software
 * Release document (this document) to explain the steps involved to enable AIC3262 Audio playback/recording

Features supported in this release
 * 1) Fully compliant with ALSA
 * 2) Integrated the driver with OMAP4 ABE
 * 3) Tested Multimedia Headphone playback and headset microphone recording
 * 4) Tested Recording from Main Mic and Sub Mic on Blaze_AIC
 * 5) Tested External Speaker on Blaze_AIC_Tablet2 and Blaze_AIC
 * 6) Tested for single I2S
 * 7) Tested Wi-Fi and Bluetooth
 * 8) Tested Firmware loading

=Build Instructions=

Android File System
This section explains how to patch and build the Android File System Unzip Blaze_AIC_AIC3262_sw_release3_Audio_HAL.zip into a temporary directory. $cd mydroid/device/ti/common-open/ patch -p1 < {temporary directory}/Blaze_AIC_AIC3262_sw_release3_Audio_HAL/Blaze_aic3262_audio_hal_sw_release3.patch

Compiling the audio module

$cd mydroid mydroid$source ./build/envsetup.sh mydroid$lunch full_blaze-userdebug mydroid$make clean-audio.primary.blaze mydroid$make audio.primary.blaze for blaze_aic_tablet2 mydroid$make clean-audio.primary.blaze_tablet mydroid$make audio.primary.blaze_tablet

The above steps will create audio.primary.blaze.so (for blaze_aic) and audio.primary.blaze_tablet.so (for blaze_aic_tablet2) Push the .so file in to target as follows ./adb push audio.primary.blaze.so /system/lib/hw/ (for blaze_aic) ./adb push audio.primary.blaze_tablet.so /system/lib/hw/ (for blaze_aic_tablet2)

Tinymix control string enabling

This section explains how to patch and build the tinymix Unzip Blaze_AIC_AIC3262_sw_release3_Audio_HAL.zip into a temporary directory. $cd mydroid/external/tinyalsa/ patch -p1 < {temporary directory}/Blaze_AIC_AIC3262_sw_release3_Audio_HAL/Blaze_aic3262_tinymix_control_sw_release3.patch $cd mydroid make tinymix push through adb in to the target as follows ./adb push tinymix /system/bin/

Follow the build instructions given here: http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Building_Android_Filesystem_.28AFS.29_with_TI_Codecs_enabled under http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Build_Instructions

DSP firmware loading
The DSP firmware file (tlv320aic3262_fw_v1.bin file) need to be loaded to the target as follows ./adb push tlv320aic3262_fw_v1.bin /vendor/firmware/ To load the firmware, issue the following tinymix command tinymix "FIRMWARE LOAD" 0 The firmware consists of modes and configurations. The tinymix command "FIRMWARE SET MODE" sets the required mode and configurations to be used. The value is "{mode_number}<<8|{cfg_number}".

for mode=0 cfg=0 tinymix "FIRMWARE SET MODE" 0 for mode=0 cfg=1 tinymix "FIRMWARE SET MODE" 1 for mode=1 cfg=0 tinymix "FIRMWARE SET MODE" 256 for mode=1 cfg=1 tinymix "FIRMWARE SET MODE" 257 for mode=3 cfg=0 tinymix "FIRMWARE SET MODE" 768 for mode=3 cfg=1 tinymix "FIRMWARE SET MODE" 769

Details of the mode_number and cfg_number supported in the current release are shown in

tinyalsa utils
Build the tinyalsa utils. These utilities are needed for playback and recording wav files. cd  mydroid make tinycap make tinyplay make tinymix

Kernel
This section explains how to patch and build the kernel Unzip Blaze_AIC_AIC3262_sw_release3_kernel.zip into a temporary directory. cd kernel/android-3.0 patch -p1 < {temporary directory}/Blaze_AIC_AIC3262_sw_release3_kernel.patch Follow the build instructions given here:http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Building_Kernel under http://omappedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Build_Instructions

Flashing
Follow the steps given in http://omapedia.org/wiki/L27.IS.2.M1_OMAP4_Icecream_Sandwich_Release_Notes#Flashing_the_OMAP4_Hardware

= AIC3262 Audio = This sections explains the top level audio architecture of Blaze_AIC_Tablet2/Blaze_AIC

ABE
ABE audio routing is shown in this diagram

AIC3262
AIC3262 audio routing is shown in this diagram

Important mixer commands are shown in red color

ASI To DAC
ASI to DAC audio routing is shown in this diagram

ADC To ASI
ADC to ASI audio routing is shown in this diagram

Audio Architecture


= AIC3262 Audio Playback and Recording = Plugin a headset with L,R,M,G connections as shown here

Legacy Mode
tinymix "HPL Output Mixer LDAC Switch" 1 tinymix "HPR Output Mixer RDAC Switch" 1 tinymix "LOR Output Mixer RDAC Switch" 0 tinymix "LOL Output Mixer LDAC Switch" 0 tinymix "HeadPhone Driver Amplifier Volume" 6
 * Playback on heaphones

tinyplay data/ -d 6

tinymix "Speaker Amplifier Volume" 1 tinymix "SPKR Output Mixer LOR Volume" 127 tinymix "SPKL Output Mixer LOL Volume" 127 tinymix "LOR Output Mixer RDAC Switch" 1 tinymix "LOL Output Mixer LDAC Switch" 1 tinymix "HPL Output Mixer LDAC Switch" 0 tinymix "HPR Output Mixer RDAC Switch" 0
 * Playback on External Speaker

to playback on multimedia Front end tinyplay data/ to playback on low power front end tinyplay data/ -d 6

tinymix "MicPGA Volume Control" 60 tinymix "Left Input Mixer CM1L Switch" 1 tinymix "Left Input Mixer IN1L Switch" 1
 * Recording from headset microphone

tinycap data/ -d 6 -c 2 -r 48000 -b 16

tinymix "MicPGA Volume Control" 70 tinymix "Left Input Mixer IN1L Switch" 0 tinymix "Left Input Mixer CM1L Switch" 0 tinymix "Left Input Mixer IN2L Switch" 1 tinymix "Left Input Mixer IN2R Switch" 1
 * Recording from Main microphone on Blaze_AIC

tinycap data/ -d 6 -c 2 -r 48000 -b 16

tinymix "MicPGA Volume Control" 70 tinymix "Left Input Mixer IN1L Switch" 0 tinymix "Left Input Mixer CM1L Switch" 0 tinymix "Left Input Mixer IN2L Switch" 0 tinymix "Left Input Mixer IN2R Switch" 0 tinymix "Right Input Mixer IN3L Switch" 1 tinymix "Right Input Mixer IN3R Switch" 1
 * Recording from Sub microphone on Blaze_AIC

tinycap data/ -d 6 -c 2 -r 48000 -b 16

ABE Mode
tinymix "DL1 Media Playback Volume" 120 tinymix "SDT DL Volume" 120 tinymix "DL1 MM_EXT Switch" 1 tinymix "Sidetone Mixer Playback" 1 tinymix "DL1 Mixer Multimedia" 1 tinymix "HeadPhone Driver Amplifier Volume" 6 tinymix "HPR Output Mixer RDAC Switch" 1 tinymix "HPL Output Mixer LDAC Switch" 1 tinymix "LOR Output Mixer RDAC Switch" 0 tinymix "LOL Output Mixer LDAC Switch" 0
 * Playback on heaphones

to playback on multimedia Front end tinyplay data/ to playback on low power front end tinyplay data/ -d 5

tinymix "Speaker Amplifier Volume" 1 tinymix "SPKR Output Mixer LOR Volume" 127 tinymix "SPKL Output Mixer LOL Volume" 127 tinymix "HPR Output Mixer RDAC Switch" 0 tinymix "HPL Output Mixer LDAC Switch" 0 tinymix "LOR Output Mixer RDAC Switch" 1 tinymix "LOL Output Mixer LDAC Switch" 1
 * Playback on External Speaker

to playback on multimedia Front end tinyplay data/ to playback on low power front end tinyplay data/ -d 5

tinymix "MUX_UL11" 10 tinymix "MUX_UL10" 9 tinymix "MicPGA Volume Control" 60 tinymix "Left Input Mixer CM1L Switch" 1 tinymix "Left Input Mixer IN1L Switch" 1
 * Recording from headset microphone

tinycap data/ -d 1 -c 2 -r 48000 -b 16

tinymix "MUX_UL11" 10 tinymix "MUX_UL10" 9 tinymix "MicPGA Volume Control" 90 tinymix "Left Input Mixer CM1L Switch" 0 tinymix "Left Input Mixer IN1L Switch" 0 tinymix "Left Input Mixer IN2L Switch" 1 tinymix "Right Input Mixer IN2L Switch" 1
 * Recording from Main microphone on Blaze_AIC

tinycap data/ -d 1 -c 2 -r 48000 -b 16

tinymix "MicPGA Volume Control" 90 tinymix "MUX_UL11" 10 tinymix "MUX_UL10" 9 tinymix "Left Input Mixer CM1L Switch" 0 tinymix "Left Input Mixer IN1L Switch" 0 tinymix "Left Input Mixer IN2L Switch" 0 tinymix "Right Input Mixer IN2L Switch" 0 tinymix "Right Input Mixer IN3L Switch" 1 tinymix "Right Input Mixer IN3R Switch" 1
 * Recording from Sub microphone on Blaze_AIC

tinycap data/ -d 1 -c 2 -r 48000 -b 16

=Playback and Recording from ICS GUI on Blaze and Blaze Tablet2=

Push the into the /sdcard directory of ICS filesystem.

Playback on headphone/headset
Plug in the headphone/headset. In ICS GUI select music player application and select the from sdcard to playback the file.

Playback on speakers
Unplug the headphone/headset. In ICS GUI select music player application and select the from sdcard to playback the file.

Recording from headset microphone on Blaze and Blaze Tablet2
Plug in headset. In ICS GUI select Sound Recorder application and select start recording from the Headset Microphone.

Recording from main microphone on Blaze
Unplug the headset. In ICS GUI select Sound Recorder application and select start recording from main microphone.

Recording from sub microphone on Blaze
Unplug the headset. In ICS GUI select Sound Recorder application and select start recording from sub microphone

=Wifi and Bluetooth Enabling from ICS on Blaze_AIC and Blaze_AIC_Tablet2=

Wi-fi Enabling
In ICS GUI menu select settings,select wireless & Networks,select wi-fi,to enable the wi-fi select turn on.It will search for available networks,choose an appropriate network hotspot and then connect to that network.Before enabling wi-fi from GUI,build and calibrate wi-fi drivers for target.Follow the link for build and calibration here http://omappedia.org/wiki/Android_Mac80211#WLAN_Driver_build_instruction http://omappedia.org/wiki/Android_Mac80211#WLAN_Calibration_Instruction

Bluetooth Enabling
The Bluetooth firmware files need to be copied into /system/etc/firmware/ of target,run the firmware file with superuser permissions in target.Follow the link here http://omappedia.org/wiki/Android_Mac80211#WLAN_Calibration_Instruction  for calibration. In ICS GUI menu select settings,select Bluetooth,to enable Bluetooth select turn on.It will search for other Bluetooth devices in the range,selecting a particular bluetooth device will pair both the devices.

Known Issues

 * Release is Tested on Blaze_AIC_Tablet2 and Blaze_AIC
 * Due to non-availability of Modem board, voice call is not tested
 * Headphone output is not optimally configured for performance measurements
 * Multi I2S support is 'not' enabled in this release