MI_AO manages the audio output settings such as volume and mute state. It is capable of handling different audio channels and provides a command interface for setting audio parameters.
- Only one instance of AO can be spawned at any given time!
- If your app is going to spawn one, you'll need to kill audioserver before getting started!
- You can do this by running `. /mnt/SDCARD/.tmp_update/script/stop_audioserver.sh`
set_ao_mute [ON/on/1, OFF/off/0]; Enable/Disable AO mute.
set_ao_volume [ChnID] [-60 ~ 30dB]; Set AO volume.
set_ao_src_volume [ChnID] [-60 ~ 30dB]; Set AO Src volume.
dump [Path] [FrameCount]; Dump pcm data.
/proc/mi_modules/mi_ao # cat ./mi_ao0
-----------------------------------------Common info for mi_ao-----------------------------------------
ChnNum EnChnNum PassNum InPortNum OutPortNum CollectSize
0 0 1 0 0 0
----------------------CMDQ kickoff counter-----------------------
------------------------------Common info formi_ao only dump enabled chn------------------------------
ChnId PassNum EnInPNum EnOutPNum MMAHeapName
-------------------------Input port common info for mi_ao only dump enabled port---------------------
ChnId PassId PortId user_buf_quota UsrInjectQ_cnt BindInQ_cnt TotalPendingBuf_size usrLockedInjectCnt
ChnId PassId PortId newPulseQ_cnt nextTodoPulseQ_cnt curWorkingQ_cnt workingTask_cnt lazzyRewindTask_cnt
ChnId PassId PortId Enable bind_module_id bind_module_name bind_ChnId bind_PortId bind_Type bind_Param enable
ChnId PassId PortId LowLatencyDelayMs LastStaticDelayAveMS
ChnId PassId PortId SrcFrmrate DstFrmrate RealSrcFrmrate FPS FinishCnt RewindCnt
----------------------Output port common info for mi_ao only for enabled port---------------------
ChnId PassId PortId usrDepth BufCntQuota usrLockedCnt totalOutPortInUsed DrvBkRefFifoQ_cnt DrvBkRefFifoQ_size
ChnId PassId PortId RealDstFrmrate FPS UsrGetFifoQ_cnt UsrGetFifoQ_size UsrGetFifoQ_seqnum UsrGetFifoQ_discardnum
ChnId PassId PortId workingTask_cnt finishedTask_cnt
ChnId PassId PortId RealDstFrmrate FPS FinishCnt RewindCnt GetTotalCnt GetOkCnt
----------------------------------------BindPeerInputPortList---------------------------------------
ChnId PassId PortId Enable bind_module_id bind_module_name bind_ChnId bind_PortId bind_Type bind_Param enable
======================================Private AO0 Info ======================================
-----Start AO Dev0 Attr------------------------------------------------------------------------
AoDev SampR BitWidth SondMod PtNumPerFrm bMute VolumeDb bStartPcmOut ChnCnt
LineOut 48000 16bit stereo 768 0 (-10 ,-10 ) 1 2
I2sMode I2sMclk I2sFmt bI2sSync
i2s-mas disable I2S-MSB 0
-----End AO Dev0 Attr--------------------------------------------------------------------------
-----Start AO CHN0 STATUS----------------------------------------------------------------------
AoDev AoChn bReSmp InSampR OutSampR
LineOut 0 0 0 48000
AoDev AoChn TotalFrmCnt TotalSize RunTime
LineOut 0 4266 4359680 1717016419
-----Start AO CHN0 Usr Queue STATUS------------------------------------------------------------
AoDev AoChn MaxSize RemainSize TotalSize RunTime
LineOut 0 51200 0 4359680 1717016419
-----AO CHN0 Vqe STATUS------------------------------------------------------------------------
AoDev AoChn bVqe WorkRate PoiNum
LineOut 0 0 0 0
-----AO CHN0 Anr STATUS------------------------------------------------------------------------
AoDev AoChn bAnr AlgorithmMode Speed Intensity SmoothLevel
LineOut 0 0 0 speed-low 0 0
-----AO CHN0 Eq TATUS--------------------------------------------------------------------------
AoDev AoChn bEq AlgorithmMode
LineOut 0 0 0
EqGainDb:
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
-----AO CHN0 Hpf STATUS------------------------------------------------------------------------
AoDev AoChn bHpf AlgorithmMode HpfFreq
LineOut 0 0 0 0
-----AO CHN0 Agc STATUS------------------------------------------------------------------------
AoDev AoChn bAgc AlgorithmMode AttackTime ReleaseTime DropGainMax
LineOut 0 0 0 0 0 0
Input Compression ratio:
0 0 0 0 0
Output Compression ratio:
0 0 0 0 0
GainInit GainMin GainMax NoiseGateAttenuationDb NoiseGateDb TargetLevelDb
0 0 0 0 0 0
-----AO CHN0 Adec STATUS-----------------------------------------------------------------------
AoDev AoChn bAdec Type SondMod SampR
LineOut 0 0 g711a mono 0
-----End AO Chn0 STATUS------------------------------------------------------------------------
/proc/mi_modules/mi_ao #
Change the volume of channel 0 (-30, 30, etc):
echo "set_ao_volume 0 -20dB" > /proc/mi_modules/mi_ao/mi_ao0
Change the volume of channel 1:
echo "set_ao_volume 1 10dB" > /proc/mi_modules/mi_ao/mi_ao0
Change mute state (0 not muted, 1 muted):
echo "set_ao_mute 1" > /proc/mi_modules/mi_ao/mi_ao0