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

这篇具有很好参考价值的文章主要介绍了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的一些头文件定义:文章来源地址https://www.toymoban.com/news/detail-545155.html

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

到了这里,关于Android音频子系统(十五)------Audio调试经验的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • RK3588 PWM调试记录---linux pwm子系统驱动框架

    RK3588一共有4组PWM,每组有4个通道,共可以产生4*4=16路PWM波形; PWM0 开始地址:0xfd8b0000 PWM1 开始地址:0xfebd0000 PWM2 开始地址:0xfebe0000 PWM3 开始地址:0xfebf0000 即每组PWM的地址空间是(0xfd8b0000-0xfebd0000=0x1000)64KB(0x1000/1024) RK3588的PWM支持捕获、连续和单次触发三种模式。 1.捕获模式

    2024年02月12日
    浏览(55)
  • Android相机-HAL子系统

    应用框架要通过拍照预览摄像获得照片或者视频,就需要向相机子系统发出请求, 一个请求对应一组结果 一次可发起多个请求,并且提交请求是非阻塞的,始终按照接收的顺序以队列的形式先进先出地进行顺序处理 一个请求包含了拍摄和拍照配置的所有信息,以及处理这些的

    2024年02月11日
    浏览(34)
  • 五分钟Win11安装安卓(Android)子系统

    十分钟,完成win11安装安卓子系统 Win+i 进入设置页面,选择 时间和语言 - 语言和区域 - 区域-美国 访问如下连接,install即可 安卓子系统 在开始菜单找到子系统,点开,做如下配置: 打开应用商店,安卓APK安装程序 下载应用宝手机版,APK文件,双击,有什么点什么,即可

    2024年02月02日
    浏览(56)
  • windows11安装Android子系统,安装apk教程。

    系统:windows11TPM2.0 硬件:内存大于8GB 浏览器地址栏输入:“https://store.rg-adguard.net/” 搜索框输入:“https://www.microsoft.com/store/productId/9P3395VX91NR” 然后在右边下拉列表选择“Slow” ,然后点击最后面的“√”。注:不要翻译界面! 找到MicrosoftCorporationII.WindowsSubsystemForAndroid_1

    2024年02月06日
    浏览(52)
  • 【Windows优化系列】Windows11安装Android子系统

    Q:为什么要在Windows安装Android系统?直接在手机使用不好吗? A:在电脑刷酷安不比拿着手机刷酷安爽吗?在电脑版的酷安码字不比手机上码字爽吗?不用打开手机也可以在电脑上点饿了么外卖不方便吗?手机上似乎不能使用tiktok,电脑上就可以使用tiktok。 并且,使用微软的

    2024年02月07日
    浏览(57)
  • Android/Linux 子系统Graphics图形栈入门普法介绍

      由于工作原因,最近在公司做了一个关于Android/Linux 子系统Graphics图形栈入门相关知识的培训介绍,个人感觉对于想要了解入门这块的朋友还是有一定帮助的。由于博客不能直接放入ppt,这里我就将相关的ppt转换成可以博客展示的发表出来,希望能帮助到对这一块感兴趣的

    2024年01月17日
    浏览(41)
  • Windows11安装安卓/Android子系统运行安卓应用程序详细教程

    开启电脑的虚拟化支持,在控制面板-程序和功能-启用和关闭windows功能。选择 Hyper-V 和 虚拟机平台 ,然后重启电脑即可。 访问 https://store.rg-adguard.net/ 搜索 https://www.microsoft.com/store/productId/9P3395VX91NR 下载最大的一个文件,即安卓子系统文件 下载地址: http://tlu.dl.delivery.mp.mi

    2024年02月03日
    浏览(55)
  • 【Windows 11】系统安装修改版 Subsystem for Android 安卓子系统,并用 Magisk Root

    目录 步骤 1. 卸载已安装的Window Subsystem for Android 官方版本 2. 启用\\\"Hyper-V\\\" 和 \\\"虚拟机平台\\\"  3. 查看 CPU 处理器是架构 4. 下载修改版Windows Subsystem Android安卓子系统 5. 解压 WSA .zip 包解压缩,并看到有 “AppxManifest.xml” 的文件路径并复制 6. 安装 WSA 安卓子系统 7. 打 开WSA安卓子系

    2024年02月06日
    浏览(50)
  • 深入Android S (12.0) 探索Framework之输入子系统InputReader的流程

    第一篇 深入Android S (12.0) 探索Framework之输入系统IMS的构成与启动 第二篇 深入Android S (12.0) 探索Framework之输入子系统InputReader的流程 上一篇文章深入探索了 Android Framework 的输入系统 IMS 的构成与启动,对 IMS 的重要成员有了初步的理解,然后通过源码对 IMS 的整个启动流程进行

    2024年01月20日
    浏览(43)
  • Win11提示无法启动适用于android的windows子系统的解决方法

    现在很多用户都在Win11系统上安装了WSA安卓子系统,不过在打开Windows Subsystem for Android的时候,弹出提示框:无法启动适用于Android的Windows子系统,确保在可选的Windows功能中启用虚拟机平台。确保设备在bios中启用了虚拟化。如果有遇到这个问题,可以尝试下面的解决方法。

    2024年02月05日
    浏览(56)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包