Hi
We are using IM8XMP Android 13 ;
We have added support for WIFI BT awcm276masur SDIOUART.
We are able to scan and pair BT device
We are able to play sound and hear on BT headphones.
audio/rawWhen we try to record voice using recorder application we are not able to capture voice ; we have captured logcat during this activity
record was trying from audio codec CARD 1 instead of BT
please share method to use Bluetooth microphone.
10-23 12:22:28.188 387 387 I BTAudioSessionAidl: UpdateSourceMetadata - SessionType=A2DP_SOFTWARE_ENCODING_DATAPATH,1 track(s)
10-23 12:22:28.188 387 2160 I BTAudioHalStream: out_write: state=STANDBY first time bytes=0
10-23 12:22:28.188 419 1961 W StagefrightRecorder: stop while neither recording nor paused
10-23 12:22:28.188 387 2160 I BTAudioHalDeviceProxyAIDL: Start: session_type=A2DP_SOFTWARE_ENCODING_DATAPATH, cookie=0x100, state=STANDBY, mono=false request
10-23 12:22:28.188 2000 2060 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3283 btif_av_stream_started_ready: btif_av_stream_started_ready: Peer e4:41:22:88:a0:55 : state=2 flags=0x0(None) ready=0
10-23 12:22:28.188 2000 2060 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3254 btif_av_stream_ready: btif_av_stream_ready: Peer e4:41:22:88:a0:55 : state=2, flags=0x0(None)
10-23 12:22:28.188 2000 2060 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3169 btif_av_stream_start_with_latency: btif_av_stream_start_with_latency
10-23 12:22:28.188 2000 2060 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3178 btif_av_stream_start_with_latency: peer_address=e4:41:22:88:a0:55 event=BTIF_AV_START_STREAM_REQ_EVT(0x1c) use_latency_mode=false
10-23 12:22:28.189 2000 2029 I BluetoothAdapterService: getActiveDevices: A2dp device: E4:41:22:88:A0:55
10-23 12:22:28.189 2000 2029 D A2dpService: getCodecStatus(E4:41:22:88:A0:55)
10-23 12:22:28.189 2000 2055 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:1931 ProcessEvent: virtual bool BtifAvStateMachine::StateOpened::ProcessEvent(uint32_t, void *): Peer e4:41:22:88:a0:55 : event=BTIF_AV_START_STREAM_REQ_EVT(0x1c) flags=0x0(None)
10-23 12:22:28.189 2000 2055 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:1936 ProcessEvent: Stream use_latency_mode=false
10-23 12:22:28.189 2000 2055 I bt_bta_av: packages/modules/Bluetooth/system/bta/av/bta_av_api.cc:222 BTA_AvStart: Starting audio/video stream data transfer bta_handle:65, use_latency_mode:false
10-23 12:22:28.189 2000 2055 I bt_bta_av: packages/modules/Bluetooth/system/bta/av/bta_av_aact.cc:1806 bta_av_do_start: A2dp stream start peer:xx:xx:xx:xx:a0:55 sco_occupied:false av_role:0x0 started:false wait:0x0
10-23 12:22:28.189 2000 2055 I bt_btm_pm: packages/modules/Bluetooth/system/stack/acl/btm_pm.cc:277 BTM_SetPowerMode: Setting power mode for peer:xx:xx:xx:xx:a0:55 current_mode:immediate:sniff[2] new_mode:forced:active[0]
10-23 12:22:28.189 2000 2055 I bt_btm_pm: packages/modules/Bluetooth/system/stack/acl/btm_pm.cc:583 btm_pm_snd_md_req: Switching from immediate:sniff[0x02] to immediate:active[0x00]
10-23 12:22:28.190 2000 2055 I bt_l2cap: packages/modules/Bluetooth/system/stack/l2cap/l2c_api.cc:1054 L2CA_UseLatencyMode: BDA: e4:41:22:88:a0:55, use_latency_mode: false
10-23 12:22:28.190 2000 2055 I bt_bta_av: packages/modules/Bluetooth/system/bta/av/bta_av_aact.cc:1872 bta_av_do_start: bta_av_do_start: peer e4:41:22:88:a0:55 start requested: sco_occupied:false role:0x10 started:false wait:0x0
10-23 12:22:28.190 2000 2060 I btif_av : packages/modules/Bluetooth/system/btif/src/btif_av.cc:3408 btif_av_get_peer_sep: Peer e4:41:22:88:a0:55 SEP is Sink (1)
10-23 12:22:28.190 2000 2060 I bt_stack: [INFO:a2dp_encoding_aidl.cc(98)] StartRequest: accepted
10-23 12:22:28.192 2000 2055 I bt_btm_pm: packages/modules/Bluetooth/system/stack/acl/btm_pm.cc:697 btm_pm_proc_cmd_status: Clearing pending power mode link state:immediate:pending
10-23 12:22:28.192 2000 2055 E bluetooth: packages/modules/Bluetooth/system/bta/dm/bta_dm_pm.cc:1016 bta_dm_pm_btm_status: Received unknown power mode status event:5
10-23 12:22:28.201 419 1961 D MPEG4Writer: PreAllocation enabled
10-23 12:22:28.206 387 387 I audio_hw_primary: refine_input_parameters: enter: sample_rate(8000) channel_mask(0x10) format(0x1)
10-23 12:22:28.206 387 387 I audio_hw_primary: adev_open_input_stream: enter: devices(0x80000004) flags(0), address(bottom)
10-23 12:22:28.206 387 387 W audio_hw_primary: In channels 1, rate 8000, devices 0x80000004
10-23 12:22:28.207 387 387 I audio_hw_primary: refine_input_parameters: enter: sample_rate(8000) channel_mask(0x10) format(0x1)
10-23 12:22:28.207 387 387 W audio_hw_primary: get_input_buffer_size size = 48, channel_count = 1
10-23 12:22:28.208 387 387 I audio_hw_primary: refine_input_parameters: enter: sample_rate(8000) channel_mask(0x10) format(0x1)
10-23 12:22:28.208 387 387 W audio_hw_primary: get_input_buffer_size size = 48, channel_count = 1
10-23 12:22:28.209 415 2573 I AudioFlinger: AudioFlinger's thread 0xb400007910402bb0 tid=2573 ready to run
10-23 12:22:28.212 419 1961 W AudioRecord: createRecord_l(34): Server adjusted notificationFrames from 1024 to 160 for frameCount 2048
10-23 12:22:28.212 415 520 W AudioFlinger: acquireAudioSessionId() unknown client 2498 for session 265
10-23 12:22:28.213 419 1961 D MediaCodecList: codecHandlesFormat: no format, so no extra checks
10-23 12:22:28.214 419 2574 D CCodec : allocate(c2.android.amrnb.encoder)
We see Codec being used instead of BT
10-23 12:22:28.230 419 2574 D CCodec : encoding statistics level = 0
10-23 12:22:28.230 419 2574 D CCodec : setup formats input: AMessage(what = 0x00000000) = {
10-23 12:22:28.230 419 2574 D CCodec : int32_t channel-count = 1
10-23 12:22:28.230 419 2574 D CCodec : int32_t max-input-size = 8192
10-23 12:22:28.230 419 2574 D CCodec : string mime = "audio/raw"
10-23 12:22:28.230 419 2574 D CCodec : int32_t sample-rate = 8000
10-23 12:22:28.230 419 2574 D CCodec : int32_t android._config-pcm-encoding = 2
10-23 12:22:28.230 419 2574 D CCodec : }
10-23 12:22:28.230 419 2574 D CCodec : setup formats output: AMessage(what = 0x00000000) = {
10-23 12:22:28.230 419 2574 D CCodec : int32_t bitrate = 12200
10-23 12:22:28.230 419 2574 D CCodec : int32_t channel-count = 1
10-23 12:22:28.230 419 2574 D CCodec : int32_t max-bitrate = 12200
10-23 12:22:28.230 419 2574 D CCodec : string mime = "audio/3gpp"
10-23 12:22:28.230 419 2574 D CCodec : int32_t sample-rate = 8000
10-23 12:22:28.230 419 2574 D CCodec : }
IMX8MPLUS #android