您现在的位置是:首页 >学无止境 >Android音频子系统(十五)------Audio调试经验网站首页学无止境

Android音频子系统(十五)------Audio调试经验

风筝丶 2024-06-17 10:24:58
简介Android音频子系统(十五)------Audio调试经验

你好!这里是风筝的博客,

欢迎和我一起交流。


两年前,我初来手机厂,还不会怎么分析log,当时刚从珠海芯片厂出来,遇到问题都是接上串口线,然后自己手动复现问题,然后对着串口查看下打出来的log分析异常。
但是来到手机厂之后一切的都变了,之前的方式已经不适用了。
原因有两个:

  • 手机都是整机,不会专门接出串口线。
  • 问题可能是概率的,不一定能复现,而且时间宝贵,自己一般不会去复现。

所以,过去的经验和分析模式已经用不上啦,时代变了。。。。。。

现在都是测试开启反馈工具箱,复现问题然后抓取log,开发就对着大量log(本质还是logcat和dmesg等)查找自己需要的信息。

所以现在出问题一般我都不会花自己时间去复现一遍,除非问题不好处理需要自己验证一些东西。

一开始我还天真的问,log信息里面那么多还杂,如何去分析我们自己audio模块。到现在,我也只能说,无它,唯手熟尔(熟练得让人心疼)…

一般出现问题的时候测试会通过截图的方式标记时间戳,开发通过搜索"takescreenshot"可以找到问题时间戳。
如果没有截图,也可以通过测试描述的场景自行找到问题时间点。

一开始我都会过滤出audio的log,避免其他模块的干扰,通过正则表达式可以筛选多个条件:

^(?=.*audio).*$

不过到后期我都懒得筛了,其他模块有时也有报错信息可以一并瞄一下…

针对我目前使用的MTK平台,不同的场景会打出不同的log,通过这些log可以快速找到问题点。

插入模拟耳机:


	I UsbPortManager: USB port changed: port=UsbPort{id=port0, supportedModes=dualsupportedContaminantProtectionModes=1supportsEnableContaminantPresenceProtection=falsesupportsEnableContaminantPresenceDetection=false, status=UsbPortStatus{connected=true, currentMode=audio_acc, currentPowerRole=sink, currentDataRole=device, supportedRoleCombinations=[source:host, sink:device], contaminantDetectionStatus=2, contaminantProtectionStatus=0}, canChangeMode=true, canChangePowerRole=false, canChangeDataRole=false, connectedAtMillis=7325896, lastConnectDurationMillis=0
	I UsbDeviceManager: updateHostState UsbPort{id=port0, supportedModes=dualsupportedContaminantProtectionModes=1supportsEnableContaminantPresenceProtection=falsesupportsEnableContaminantPresenceDetection=false status=UsbPortStatus{connected=true, currentMode=audio_acc, currentPowerRole=sink, currentDataRole=device, supportedRoleCombinations=[source:host, sink:device], contaminantDetectionStatus=2, contaminantProtectionStatus=0}
	D AudioManager: setWiredDeviceConnectionState type=4 state=1 address= name=
	D AudioManager: setWiredDeviceConnectionState type=-2147483632 state=1 address= name=
	V AudioPolicyIntefaceImpl: setDeviceConnectionState()
	D APM_AudioPolicyManager: [MTK_APM_Route]setDeviceConnectionStateInt() +++ device: 0x4, state 1, name  format 0x0
	D AudioSystem: +setParameters(): connect=4 
	D AudioFlingerExtImpl: AudioFlingerExtImpl oplusSetParameters: keyvalue connect=4
	D AudioALSAHardware: +setParameters(): connect=4

拔出模拟耳机:

	D AudioManager: setWiredDeviceConnectionState type=4 state=0 address= name=
	I AS.AudioDeviceInventory: dropping ACTION_AUDIO_BECOMING_NOISY
	D AudioManager: setWiredDeviceConnectionState type=-2147483632 state=0 address= name=
	V AudioPolicyIntefaceImpl: setDeviceConnectionState()
	D APM_AudioPolicyManager: [MTK_APM_Route]setDeviceConnectionStateInt() +++ device: 0x4, state 0, name  format 0x0
	D AudioSystem: +setParameters(): disconnect=4 
	D AudioFlingerExtImpl: AudioFlingerExtImpl oplusSetParameters: keyvalue disconnect=4
	D AudioALSAHardware: +setParameters(): disconnect=4

插入数字耳机:


	D UsbDeviceManager: broadcasting Intent { act=android.hardware.usb.action.USB_STATE flg=0x31100000 (has extras) } extras: Bundle[{host_connected=true, audio_source=true, connected=false, unlocked=false, adb=true, configured=false}]
	D UsbHostManager: USB device attached: vidpid 001f:0b21 mfg/product/ver/serial Anlya.cn������������������������������/AB13X USB Audio������������������������������������������/1.00/08613544166500 hasAudio/HID/Storage: true/true/false
	D UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=31,mProductId=2849,mClass=0,mSubclass=0,mProtocol=0,mManufacturerName=Anlya.cn������������������������������,mProductName=AB13X USB Audio������������������������������������������,mVersion=1.00,mSerialNumberReader=com.android.server.usb.UsbSerialReader@a9fdc62, mHasAudioPlayback=true, mHasAudioCapture=true, mHasMidi=false, mHasVideoCapture=false, mHasVideoPlayback=false, mConfigurations=[
	V AudioPolicyIntefaceImpl: setDeviceConnectionState()
	D APM_AudioPolicyManager: [MTK_APM_Route]setDeviceConnectionStateInt() +++ device: 0x4000000, state 1, name  format 0x0
	D AudioSystem: +setParameters(): card=2;connect=67108864;device=0 
	D AudioFlingerExtImpl: AudioFlingerExtImpl oplusSetParameters: keyvalue card=2;connect=67108864;device=0
	D AudioALSAHardware: +setParameters(): card=2;connect=67108864;device=0
	D AudioUSBCenter: setUSBOutConnectionState(), devices 0x4000000, connect 1, card 2, device 0

拔出数字耳机:

	I EventHub: Removing device Anlya.cn AB13X USB Audio due to epoll hang-up event.
	I EventHub: Removed device: path=/dev/input/event5 name=Anlya.cn AB13X USB Audio id=6 fd=1054 classes=KEYBOARD | EXTERNAL
	I InputReader: Device removed: id=5, eventHubId=6, name='Anlya.cn AB13X USB Audio', descriptor='904ec98e6cdb23900457df203f474550f3a37957', sources=0x00000101
	D UsbHostManager: Removed device at /dev/bus/usb/001/002: AB13X USB Audio������������������������������������������
	I UsbAlsaManager: USB Audio Device Removed: UsbAlsaDevice: [card: 2, device: 0, name: USB-Audio - AB13X USB Audio, hasOutput: true, hasInput: true]
	V AudioPolicyIntefaceImpl: setDeviceConnectionState()
	D APM_AudioPolicyManager: [MTK_APM_Route]setDeviceConnectionStateInt() +++ device: 0x4000000, state 0, name  format 0x0
	D AudioSystem: +setParameters(): card=2;device=0;disconnect=67108864 
	D AudioFlingerExtImpl: AudioFlingerExtImpl oplusSetParameters: keyvalue card=2;device=0;disconnect=67108864
	D AudioALSAHardware: +setParameters(): card=2;device=0;disconnect=67108864

拨打电话

	I CallsManager: UPDATECALLSTATE: setCallState CONNECTING -> DIALING, call: [Call id=TC@154, state=CONNECTING, tpac=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, cmgr=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, handle=***, vidst=A, childs(0), has_parent(false), cap=[ sup_hld mut !v2a], prop=[ m_volte]], voip=false
	I CallsManager: UPDATECALLSTATE: setCallState DIALING -> DIALING, call: [Call id=TC@154, state=DIALING, tpac=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, cmgr=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, handle=***, vidst=A, childs(0), has_parent(false), cap=[ sup_hld mut !v2a], prop=[ m_volte]], voip=false
	I CallsManager: UPDATECALLSTATE: setCallState DIALING -> ACTIVE, call: [Call id=TC@154, state=DIALING, tpac=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, cmgr=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, handle=***, vidst=A, childs(0), has_parent(false), cap=[ sup_hld mut VTlrx VTltx VTlbi VTrrx VTrtx VTrbi paus_VT], prop=[ m_volte]], voip=false
	I CallsManager: UPDATECALLSTATE: setCallState ACTIVE -> DISCONNECTED, call: [Call id=TC@154, state=DISCONNECTING, tpac=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, cmgr=ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, 11, UserHandle{0}, handle=***, vidst=A, childs(0), has_parent(false), cap=[ hld sup_hld mut VTlrx VTltx VTlbi VTrrx VTrtx VTrbi paus_VT add_participant], prop=[ m_volte]], voip=false

调节音量:

    AudioSystem: +setParameters(): volumeDevice=1;volumeIndex=0;volumeStreamType=0
	APM::AudioOutputDescriptor: setVolume output 93 for volumeSource 6, volume -15.000000, delay 0 stream=AUDIO_STREAM_MUSIC
	AudioALSAStreamManager: setVolumeIndex() stream= 3, device= 2, index=
	AudioMTKGainController: setVoiceVolume(), index = 
	custom_info vol_level=
	查看当前音量:adb shell dumpsys audio | grep STREAM_MUSIC: -A 7

切换设备:

	APM_AudioPolicyManager: setOutputDevice()
	APM_AudioPolicyManager: setDeviceConnectionStateInt()

设置输出流:

	APM_AudioPolicyManager: startOutput() output 37, stream 0, session 2697
	APM_AudioPolicyManager: setOutputDevice() output 37 device {type:0x4,@:}
	
	output 13(primary) 21(deepbuffer) 37(voip)29 (fast)

耳机按键:

Kernel log:
	MediaSessionService: Sending KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_HEADSETHOOK,
	MediaSessionService: Sending KeyEvent { action=ACTION_UP, keyCode=KEYCODE_HEADSETHOOK,
	accdet_get_auxadc() vol_val:4 offset:-2 real vol:6 mv!
	accdet_work_callback cancel_delayed_work_sync fb_delaywork
	Accdet EINTx support,MODE_2 regs:
	accdet (0x268a)=0x1 (0x268c)=0x67 (0x26a9)=0x0 (0x26ab)=0x7(0x26ad)=0x0 (0x26b1)=0x0
	accdet (0x26b3)=0x0 (0x26b6)=0x0(0x26b8)=0x1 (0x26bc)=0x0 (0x26c0)=0x23 (0x26b6)=0x0

	accdet cur cable type:[Headset_mic], status switch:[Headset_plug_in]->[Hook_switch]
Hal log:
	//上层input接收到按键按下,第一次按下
	InputLog: PhoneWindowManagerExtImpl : interceptKeyBeforeDispatching key: win=Window{77f7b0b u0 com.spotify.music/com.spotify.music.MainActivity}  event = KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_HEADSETHOOK, 

	//上层input接收到按键弹起,第一次点击完成
	InputLog: PhoneWindowManagerExtImpl : interceptKeyBeforeDispatching key: win=Window{77f7b0b u0 com.spotify.music/com.spotify.music.MainActivity}  event = KeyEvent { action=ACTION_UP, keyCode=KEYCODE_HEADSETHOOK

基本通过这些关键词,就可以初步定位解决一些audio的问题了,之后的复杂问题,只能说,道阻且长…


附录,Android Audio的一些头文件定义:

static CONST_ARRAY audio_devices_t AUDIO_DEVICE_OUT_ALL_ARRAY[] = {//system/media/audio/include/system/audio-base-utils.h
	AUDIO_DEVICE_OUT_EARPIECE,                  // 0x00000001u
	AUDIO_DEVICE_OUT_SPEAKER,                   // 0x00000002u
	AUDIO_DEVICE_OUT_WIRED_HEADSET,             // 0x00000004u
	AUDIO_DEVICE_OUT_WIRED_HEADPHONE,           // 0x00000008u
	AUDIO_DEVICE_OUT_BLUETOOTH_SCO,             // 0x00000010u
	AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET,     // 0x00000020u
	AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT,      // 0x00000040u
	AUDIO_DEVICE_OUT_BLUETOOTH_A2DP,            // 0x00000080u
	AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES, // 0x00000100u
	AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER,    // 0x00000200u
	AUDIO_DEVICE_OUT_HDMI,                      // 0x00000400u, OUT_AUX_DIGITAL
	AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET,         // 0x00000800u
	AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET,         // 0x00001000u
	AUDIO_DEVICE_OUT_USB_ACCESSORY,             // 0x00002000u
	AUDIO_DEVICE_OUT_USB_DEVICE,                // 0x00004000u
	AUDIO_DEVICE_OUT_REMOTE_SUBMIX,             // 0x00008000u
	AUDIO_DEVICE_OUT_TELEPHONY_TX,              // 0x00010000u
	AUDIO_DEVICE_OUT_LINE,                      // 0x00020000u
	AUDIO_DEVICE_OUT_HDMI_ARC,                  // 0x00040000u
	AUDIO_DEVICE_OUT_HDMI_EARC,                 // 0x00040001u,
	AUDIO_DEVICE_OUT_SPDIF,                     // 0x00080000u
	AUDIO_DEVICE_OUT_FM,                        // 0x00100000u
	AUDIO_DEVICE_OUT_AUX_LINE,                  // 0x00200000u
	AUDIO_DEVICE_OUT_SPEAKER_SAFE,              // 0x00400000u
	AUDIO_DEVICE_OUT_IP,                        // 0x00800000u
	AUDIO_DEVICE_OUT_BUS,                       // 0x01000000u
	AUDIO_DEVICE_OUT_PROXY,                     // 0x02000000u
	AUDIO_DEVICE_OUT_USB_HEADSET,               // 0x04000000u
	AUDIO_DEVICE_OUT_HEARING_AID,               // 0x08000000u
	AUDIO_DEVICE_OUT_ECHO_CANCELLER,            // 0x10000000u
	AUDIO_DEVICE_OUT_BLE_HEADSET,               // 0x20000000u
	AUDIO_DEVICE_OUT_BLE_SPEAKER,               // 0x20000001u
	AUDIO_DEVICE_OUT_DEFAULT,                   // 0x40000000u, BIT_DEFAULT
};
static CONST_ARRAY audio_devices_t AUDIO_DEVICE_IN_ALL_ARRAY[] = {
    AUDIO_DEVICE_IN_COMMUNICATION,              // 0x80000001u
    AUDIO_DEVICE_IN_AMBIENT,                    // 0x80000002u
    AUDIO_DEVICE_IN_BUILTIN_MIC,                // 0x80000004u
    AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET,      // 0x80000008u
    AUDIO_DEVICE_IN_WIRED_HEADSET,              // 0x80000010u
    AUDIO_DEVICE_IN_HDMI,                       // 0x80000020u, IN_AUX_DIGITAL
    AUDIO_DEVICE_IN_TELEPHONY_RX,               // 0x80000040u, IN_VOICE_CALL
    AUDIO_DEVICE_IN_BACK_MIC,                   // 0x80000080u
    AUDIO_DEVICE_IN_REMOTE_SUBMIX,              // 0x80000100u
    AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET,          // 0x80000200u
    AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET,          // 0x80000400u
    AUDIO_DEVICE_IN_USB_ACCESSORY,              // 0x80000800u
    AUDIO_DEVICE_IN_USB_DEVICE,                 // 0x80001000u
    AUDIO_DEVICE_IN_FM_TUNER,                   // 0x80002000u
    AUDIO_DEVICE_IN_TV_TUNER,                   // 0x80004000u
    AUDIO_DEVICE_IN_LINE,                       // 0x80008000u
    AUDIO_DEVICE_IN_SPDIF,                      // 0x80010000u
    AUDIO_DEVICE_IN_BLUETOOTH_A2DP,             // 0x80020000u
    AUDIO_DEVICE_IN_LOOPBACK,                   // 0x80040000u
    AUDIO_DEVICE_IN_IP,                         // 0x80080000u
    AUDIO_DEVICE_IN_BUS,                        // 0x80100000u
    AUDIO_DEVICE_IN_PROXY,                      // 0x81000000u
    AUDIO_DEVICE_IN_USB_HEADSET,                // 0x82000000u
    AUDIO_DEVICE_IN_BLUETOOTH_BLE,              // 0x84000000u
    AUDIO_DEVICE_IN_HDMI_ARC,                   // 0x88000000u
    AUDIO_DEVICE_IN_HDMI_EARC,                  // 0x88000001u
    AUDIO_DEVICE_IN_ECHO_REFERENCE,             // 0x90000000u
    AUDIO_DEVICE_IN_BLE_HEADSET,                // 0xA0000000u
    AUDIO_DEVICE_IN_DEFAULT,                    // 0xC0000000u
};

typedef enum { /* audio_output_flags_t */
    AUDIO_OUTPUT_FLAG_NONE             = 0x0,
    AUDIO_OUTPUT_FLAG_DIRECT           = 0x1,
    AUDIO_OUTPUT_FLAG_PRIMARY          = 0x2,
    AUDIO_OUTPUT_FLAG_FAST             = 0x4,
    AUDIO_OUTPUT_FLAG_DEEP_BUFFER      = 0x8,
    AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD = 0x10,
    AUDIO_OUTPUT_FLAG_NON_BLOCKING     = 0x20,
    AUDIO_OUTPUT_FLAG_HW_AV_SYNC       = 0x40,
    AUDIO_OUTPUT_FLAG_TTS              = 0x80,
    AUDIO_OUTPUT_FLAG_RAW              = 0x100,
    AUDIO_OUTPUT_FLAG_SYNC             = 0x200,
    AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO  = 0x400,
    AUDIO_OUTPUT_FLAG_DIRECT_PCM       = 0x2000,
    AUDIO_OUTPUT_FLAG_MMAP_NOIRQ       = 0x4000,
    AUDIO_OUTPUT_FLAG_VOIP_RX          = 0x8000,
    AUDIO_OUTPUT_FLAG_INCALL_MUSIC     = 0x10000,
    AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD  = 0x20000,
} audio_output_flags_t;

/* Audio stream types */
typedef enum {
    /* These values must kept in sync with
     * frameworks/base/media/java/android/media/AudioSystem.java
     */
	AUDIO_STREAM_DEFAULT = -1, // (-1)
	AUDIO_STREAM_MIN = 0,
	AUDIO_STREAM_VOICE_CALL = 0,
	AUDIO_STREAM_SYSTEM = 1,
	AUDIO_STREAM_RING = 2,//铃声
	AUDIO_STREAM_MUSIC = 3,
	AUDIO_STREAM_ALARM = 4,
	AUDIO_STREAM_NOTIFICATION = 5,
	AUDIO_STREAM_BLUETOOTH_SCO = 6,
	AUDIO_STREAM_ENFORCED_AUDIBLE = 7,
	AUDIO_STREAM_DTMF = 8,//拨号
	AUDIO_STREAM_TTS = 9,
	AUDIO_STREAM_ACCESSIBILITY = 10,
	AUDIO_STREAM_ASSISTANT = 11,
	AUDIO_STREAM_REROUTING = 12,
	AUDIO_STREAM_PATCH = 13,
	AUDIO_STREAM_CALL_ASSISTANT = 14,
} audio_stream_type_t;

enum audio_mode {
    MODE_INVALID = -2,
    MODE_CURRENT = -1,
    MODE_NORMAL = 0,
    MODE_RINGTONE,
    MODE_IN_CALL,
    MODE_IN_COMMUNICATION,
    NUM_MODES  // not a valid entry, denotes end-of-list
};

typedef enum {
    AUDIO_SOURCE_DEFAULT = 0,
    AUDIO_SOURCE_MIC = 1,
    AUDIO_SOURCE_VOICE_UPLINK = 2,
    AUDIO_SOURCE_VOICE_DOWNLINK = 3,
    AUDIO_SOURCE_VOICE_CALL = 4,
    AUDIO_SOURCE_CAMCORDER = 5,
    AUDIO_SOURCE_VOICE_RECOGNITION = 6,//语音识别
    AUDIO_SOURCE_VOICE_COMMUNICATION = 7,//语音通信
    AUDIO_SOURCE_REMOTE_SUBMIX = 8,
    AUDIO_SOURCE_UNPROCESSED = 9,
    AUDIO_SOURCE_VOICE_PERFORMANCE = 10,
    AUDIO_SOURCE_ECHO_REFERENCE = 1997,
    AUDIO_SOURCE_FM_TUNER = 1998,
#ifndef AUDIO_NO_SYSTEM_DECLARATIONS
    /**
     * A low-priority, preemptible audio source for for background software
     * hotword detection. Same tuning as VOICE_RECOGNITION.
     * Used only internally by the framework.
     */
    AUDIO_SOURCE_HOTWORD = 1999,
#endif // AUDIO_NO_SYSTEM_DECLARATIONS
} audio_source_t;

typedef enum {
#ifndef AUDIO_NO_SYSTEM_DECLARATIONS
    AUDIO_MODE_INVALID = -2, // (-2)
    AUDIO_MODE_CURRENT = -1, // (-1)
#endif // AUDIO_NO_SYSTEM_DECLARATIONS
    AUDIO_MODE_NORMAL = 0,
    AUDIO_MODE_RINGTONE = 1,
    AUDIO_MODE_IN_CALL = 2,//通话
    AUDIO_MODE_IN_COMMUNICATION = 3,//语音?
    AUDIO_MODE_CALL_SCREEN = 4,
} audio_mode_t;


typedef enum {
    AUDIO_OUTPUT_FLAG_NONE             = 0x0,
    AUDIO_OUTPUT_FLAG_DIRECT           = 0x1,
    AUDIO_OUTPUT_FLAG_PRIMARY          = 0x2,
    AUDIO_OUTPUT_FLAG_FAST             = 0x4,
    AUDIO_OUTPUT_FLAG_DEEP_BUFFER      = 0x8,
    AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD = 0x10,
    AUDIO_OUTPUT_FLAG_NON_BLOCKING     = 0x20,
    AUDIO_OUTPUT_FLAG_HW_AV_SYNC       = 0x40,
    AUDIO_OUTPUT_FLAG_TTS              = 0x80,
    AUDIO_OUTPUT_FLAG_RAW              = 0x100,
    AUDIO_OUTPUT_FLAG_SYNC             = 0x200,
    AUDIO_OUTPUT_FLAG_IEC958_NONAUDIO  = 0x400,
    AUDIO_OUTPUT_FLAG_DIRECT_PCM       = 0x2000,
    AUDIO_OUTPUT_FLAG_MMAP_NOIRQ       = 0x4000,
    AUDIO_OUTPUT_FLAG_VOIP_RX          = 0x8000,
    AUDIO_OUTPUT_FLAG_INCALL_MUSIC     = 0x10000,
} audio_output_flags_t;

typedef enum {
    AUDIO_INPUT_FLAG_NONE       = 0x0,
    AUDIO_INPUT_FLAG_FAST       = 0x1,
    AUDIO_INPUT_FLAG_HW_HOTWORD = 0x2,
    AUDIO_INPUT_FLAG_RAW        = 0x4,
    AUDIO_INPUT_FLAG_SYNC       = 0x8,
    AUDIO_INPUT_FLAG_MMAP_NOIRQ = 0x10,
    AUDIO_INPUT_FLAG_VOIP_TX    = 0x20,
    AUDIO_INPUT_FLAG_HW_AV_SYNC = 0x40,
    AUDIO_INPUT_FLAG_DIRECT     = 0x80,
} audio_input_flags_t;


//Aurisys

enum {
    /* scene for library */
    TASK_SCENE_PHONE_CALL           = 0,
    TASK_SCENE_VOICE_ULTRASOUND     = 1,
    TASK_SCENE_PLAYBACK_MP3         = 2,
    TASK_SCENE_RECORD               = 3,
    TASK_SCENE_VOIP                 = 4,
    TASK_SCENE_SPEAKER_PROTECTION   = 5,
    TASK_SCENE_VOW                  = 6,
    TASK_SCENE_PRIMARY              = 7,
    TASK_SCENE_DEEPBUFFER           = 8,
    TASK_SCENE_AUDPLAYBACK          = 9,
    TASK_SCENE_CAPTURE_UL1          = 10,
    TASK_SCENE_A2DP                 = 11,
    TASK_SCENE_DATAPROVIDER         = 12,
    TASK_SCENE_MUSIC                = 13,
    TASK_SCENE_CALL_FINAL           = 14,
    TASK_SCENE_FAST                 = 15,
    TASK_SCENE_KTV                  = 16,
    TASK_SCENE_CAPTURE_RAW          = 17,
    TASK_SCENE_FM_ADSP              = 18,
    TASK_SCENE_PHONE_CALL_SUB       = 19,
    TASK_SCENE_BLEDL                = 20,
    TASK_SCENE_BLEUL                = 21,
    TASK_SCENE_BLEDEC               = 22,
    TASK_SCENE_BLEENC               = 23,
    TASK_SCENE_BLECALLDL            = 24,
    TASK_SCENE_BLECALLUL            = 25,

    /* control for driver */
    TASK_SCENE_AUDIO_CONTROLLER_HIFI3_A,
    TASK_SCENE_AUDIO_CONTROLLER_HIFI3_B,
    TASK_SCENE_AUD_DAEMON_A,
    TASK_SCENE_AUD_DAEMON_B,
    TASK_SCENE_AUDIO_CONTROLLER_CM4,
    TASK_SCENE_SIZE,
    TASK_SCENE_INVALID
};
struct ipi_msg_t *p_ipi_msg->task_scene >= TASK_SCENE_SIZE
struct arsi_task_config_t *p_arsi_task_config->task_scene = TASK_SCENE_CALL_FINAL;

enum {
    /* playback */
    AURISYS_SCENARIO_PLAYBACK_NORMAL,
    AURISYS_SCENARIO_PLAYBACK_LOW_LATENCY,

    /* record */
    AURISYS_SCENARIO_RECORD_LOW_LATENCY,
    AURISYS_SCENARIO_RECORD_WITHOUT_AEC,
    AURISYS_SCENARIO_RECORD_WITH_AEC,
    AURISYS_SCENARIO_RECORD_IEM,

    /* voip */
    AURISYS_SCENARIO_VOIP,
    AURISYS_SCENARIO_VOIP_WITHOUT_AEC,

    /* call */
    AURISYS_SCENARIO_PHONE_CALL,

    /* smart pa */
    AURISYS_SCENARIO_PLAYBACK_SMARTPA,

    /* hdr record */
    AURISYS_SCENARIO_HDR_RECORD,

    /* control */
    AURISYS_SCENARIO_SIZE,
    AURISYS_SCENARIO_ALL,

    AURISYS_SCENARIO_INVALID = 0xFFFFFFFF
};
mManagerConfig->aurisys_scenario = GetAurisysScenario();//AURISYS_SCENARIO_PLAYBACK_SMARTPA
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。