4AI.1.5 OMAP4 ICS Blaze AIC AIC3262 SW Release3c

From OMAPpedia

Jump to: navigation, search

Contents

[edit] 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.4(MR1.1)
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: 4AI.x_44XX_T2_DEV_DB70
Daily Build Blaze Version: 4AI.x_44XX_Blaze_DEV_DB8
Reference software release http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes

This document assumes that


Release summary

[edit] Installation

Blaze_AIC_Tablet2
Blaze_AIC

[edit] Release Content

This release Blaze_AIC_AIC3262_SW_Release3c.zip contains three files

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 Voip call and SIP call on Blaze_AIC
  8. Tested Firmware loading
  9. Headset / Headphone distinction
  10. Headset / Headphone pop reduction
  11. Headset half insertion detection
  12. Verbose debug levels support
  13. Runtime coefficients updates
  14. Switching firmware modes based on use-case

[edit] Build Instructions

[edit] Android File System

Follow instructions to download the Android File system by http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Downloading_Release_Software

This section explains how to download the Android ICS HAL release and ICS Tinyalsa release for Blaze AIC3262 SW Release3c


Unzip Blaze_AIC3262_Release3c_Audio_HAL.zip into a temporary directory.
$cd mydroid/device/ti/common-open/
patch -p1 < {temporary directory}/Blaze_AIC3262_Release3c_Audio_HAL/Blaze_AIC3262_sw_release3c_Audio_HAL.patch
Compiling the audio module 
 
$cd mydroid
$cd device/ti/common-open/
mydroid$source ./build/envsetup.sh
mydroid$lunch full_blaze-userdebug
mydroid$make clean-audio.primary.omap4
mydroid$make audio.primary.omap4

For Blaze tablet build
$cd mydroid
$cd device/ti/common-open/
mydroid$source ./build/envsetup.sh
mydroid$lunch blaze-tablet_userdebug
mydroid$make clean-audio.primary.omap4
mydroid$make audio.primary.omap4

The above steps will create audio.primary.omap4.so for both blaze_aic and blaze_aic_tablet2 in their respective out-product directories.
Push the .so file in to target as follows
$./adb push audio.primary.omap4.so /system/lib/hw/

Tinymix control string enabling

This section explains how to patch and build the tinymix
Unzip Blaze_AIC3262_Release3c_Audio_HAL.zip into a temporary directory.
$cd mydroid/external/tinyalsa/
$patch -p1 < {temporary directory}/Blaze_AIC3262_Release3c_Audio_HAL/BLAZE_AIC3262_tinymix_control_sw_release3c.patch
$cd mydroid
$source build/envsetup.sh
$lunch full_blaze-userdebug 
         or
$lunch blaze-tablet_userdebug
$make tinymix
$push through adb in to the target as follows
$./adb push tinymix /system/bin/

Note: tinymix, tinyplay and tinycap pre-built binaries are provided along with the release package

Follow the build instructions given here: http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Building_Android_Filesystem_.28AFS.29_with_TI_Codecs_enabled under http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Build_Instructions

[edit] Kernel

This section explains how to patch and build the kernel


Unzip Blaze_AIC3262_sw_release3c_kernel.zip into a temporary directory.
$cd kernel
patch -p1 < {temporary directory}/Blaze_AIC3262_sw_release3c_kernel.patch

Follow the build instructions given here:http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Building_Kernel under http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Build_Instructions

[edit] Flashing

Follow the steps given in http://omappedia.org/wiki/4AI.1.5_OMAP4_Icecream_Sandwich_Release_Notes#Flashing_the_OMAP4_Hardware

[edit] 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/
./adb reboot

The firmware consists of modes and configurations. The tinymix control "Codec Firmware Setmode" sets the required mode automatically according to use-case for instance Music speaker. Music Headphone, Record OnboardMic, Record HeadsetMic. The firmware binary tlv320aic3262_fw_v1.bin is part of release. Example firmware binary Release3b example firmware binary.PNG

[edit] Build and Usage of Firmware tools and Utils

http://omappedia.org/wiki/AIC3262/Firmware_Release_Notes

[edit] Enabling and Disabling Verbose debug levels for AIC3262

This section is provided for the purpose of debugging. Using this, user can control different levels of debug messages or prints. Different levels of debugging are available, every debug level enum corresponds to respective verbosity level.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!  #    Debug level enum         Verbosity level                     !
! ------------------------------------------------------------------ !
!  0	AIC3XXX_NO_PRINT        No debug prints                      !
!  1	AIC3XXX_ALERT		for Init functions                   !
!  2	AIC3XXX_CRIT		for warning messages                 !
!  3	AIC3XXX_ERR		at if/else/switch case decisions     !
!  4 	AIC3XXX_WARNING	        for function entry/exit              !
!  5	AIC3XXX_NOTICE		upper level for codec read/write     !
!  6	AIC3XXX_INFO		low level for i2c read/write         !
!  7	AIC3XXX_DEBUG		verbose level for bottom halves      !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
path for debug_level on target file system to change at run time

#cd /sys/devices/platform/soc-audio/subsystem/devices/tlv320aic3262-codec/
#cat debug_level         ----- Checking the default debug level
#echo 3 > debug_level    ----- Setting the required debug level   

[edit] Tinyalsa utils

Build the tinyalsa utils. These utilities are needed for playback and recording wav files without GUI.

cd   mydroid
make tinycap
make tinyplay
make tinymix

[edit] AIC3262 Audio

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

[edit] ABE

ABE audio routing is shown in this diagram
OMAP4_ABE

[edit] AIC3262

AIC3262 audio routing is shown in this diagram
AIC3262_Routing

Important mixer commands are shown in red color

[edit] ASI To DAC

ASI to DAC audio routing is shown in this diagram
Asi_to_Dac Routing

[edit] ADC To ASI

ADC to ASI audio routing is shown in this diagram
Adc_to_Asi Routing

[edit] Audio Architecture

OMAP4_AIC3262_Audio_system_architecture

[edit] AIC3262 Audio Playback and Recording

Plugin a headset with L,R,M,G connections as shown here
Headset_L_R_M_G

[edit] Playback and Recording on Command Line

[edit] 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

tinyplay data/<wav file> -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

 to playback on multimedia Front end
tinyplay data/<wav file>
 to playback on low power front end
tinyplay data/<wav file> -d 6
tinymix "MicPGA Volume Control" 60
tinymix "Left Input Mixer CM1L Switch" 1
tinymix "Left Input Mixer IN1L Switch" 1

tinycap data/<wav file> -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" 1
tinymix "Left Input Mixer IN2L Switch" 1
tinymix "Left Input Mixer IN2R Switch" 1

tinycap data/<wav file> -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" 1
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

tinycap data/<wav file> -d 6 -c 2 -r 48000 -b 16

[edit] 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

 to playback on multimedia Front end
tinyplay data/<wav file>
 to playback on low power front end
tinyplay data/<wav file> -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

 to playback on multimedia Front end
tinyplay data/<wav file>
 to playback on low power front end
tinyplay data/<wav file> -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

tinycap data/<wav file> -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" 1
tinymix "Left Input Mixer IN1L Switch" 0
tinymix "Left Input Mixer IN2L Switch" 1
tinymix "Right Input Mixer IN2L Switch" 1

tinycap data/<wav file> -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" 1
tinymix "Left Input Mixer IN1L Switch" 0
tinymix "Right Input Mixer IN1L Switch" 0
tinymix "Left Input Mixer IN2L Switch" 0
tinymix "Right Input Mixer IN2L Switch" 0
tinymix "Left Input Mixer IN3L Switch" 1
tinymix "Right Input Mixer IN3L Switch" 1

tinycap data/<wav file> -d 1 -c 2 -r 48000 -b 16

[edit] Playback and Recording from ICS GUI on Blaze and Blaze Tablet2

Push the <media file> into the /sdcard directory of ICS filesystem.

[edit] Playback on headphone/headset

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

[edit] Playback on speakers

Unplug the headphone/headset. In ICS GUI select music player application and select the <media file> from sdcard to playback the file.

[edit] 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.

[edit] Recording from main microphone on Blaze

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

[edit] Recording from sub microphone on Blaze

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

[edit] Wifi and Bluetooth Enabling from ICS on Blaze_AIC and Blaze_AIC_Tablet2

[edit] 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

[edit] 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.

[edit] Known Issues

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox