Page 1 of 1

ESP32 lyrat mini adf hpf example error

Posted: Thu Dec 26, 2024 8:33 am
by hamzatamer76
In the hfp example, I successfully connect to the phone via Bluetooth. Then, when I make a phone call to use the hands-free feature, I get an error as follows:

-----------------------------------------------------------------------------------------------------------------------------------
I (3609) HFP_EXAMPLE: [ 3 ] Create audio pipeline for playback
I (3619) HFP_EXAMPLE: [3.1] Create i2s stream to write data to codec chip and read data from codec chip
W (3629) I2S_STREAM_IDF5.x: I2S(2) already startup
I (3629) HFP_EXAMPLE: [3.2] Get hfp stream
I (3639) HFP_STREAM: outgoing stream init
I (3639) HFP_STREAM: incoming stream init
I (3639) HFP_EXAMPLE: [3.2] Register all elements to audio pipeline
I (3649) HFP_EXAMPLE: [3.3] Link it together [Bluetooth]-->hfp_in_stream-->i2s_stream_writer-->[codec_chip]
I (3659) AUDIO_PIPELINE: link el->rb, el:0x3ffd83a8, tag:incoming, rb:0x3ffd874c
I (3669) AUDIO_PIPELINE: link el->rb, el:0x3ffd6df0, tag:i2s_reader, rb:0x3ffda89c
I (3679) HFP_EXAMPLE: [ 4 ] Initialize peripherals
E (3679) gpio: gpio_install_isr_service(502): GPIO isr service already installed
I (3689) HFP_EXAMPLE: [ 5 ] Set up event listener
I (3699) HFP_EXAMPLE: [5.1] Listening event from all elements of pipeline
I (3709) HFP_EXAMPLE: [5.2] Listening event from peripherals
I (3709) HFP_EXAMPLE: [ 6 ] Listen for all pipeline events
W (13769) BT_HCI: hcif conn complete: hdl 0x80, st 0x0
W (13799) BT_HCI: hcif link supv_to changed: hdl 0x80, supv_to 8000
W (14169) BT_APPL: new conn_srvc id:27, app_id:1
I (14189) HFP_STREAM: APP HFP event: CONNECTION_STATE_EVT
I (14189) HFP_STREAM: --Connection state connected, peer feats 0x0, chld_feats 0x0
I (14309) HFP_STREAM: APP HFP event: CALL_IND_EVT
I (14309) HFP_STREAM: --Call indicator NO call in progress
I (14309) HFP_STREAM: APP HFP event: CALL_SETUP_IND_EVT
I (14319) HFP_STREAM: --Call setup indicator NONE
I (14319) HFP_STREAM: APP HFP event: NETWORK_STATE_EVT
I (14329) HFP_STREAM: --NETWORK state available
I (14329) HFP_STREAM: APP HFP event: SIGNAL_STRENGTH_IND_EVT
I (14339) HFP_STREAM: --Signal strength: 4
I (14339) HFP_STREAM: APP HFP event: ROAMING_STATUS_IND_EVT
I (14349) HFP_STREAM: --ROAMING: inactive
I (14349) HFP_STREAM: APP HFP event: BATTERY_LEVEL_IND_EVT
I (14359) HFP_STREAM: --Battery level 4
I (14369) HFP_STREAM: APP HFP event: CALL_HELD_IND_EVT
I (14369) HFP_STREAM: --Call held indicator NONE held
I (14389) HFP_STREAM: APP HFP event: CONNECTION_STATE_EVT
I (14389) HFP_STREAM: --Connection state slc_connected, peer feats 0xf6f, chld_feats 0x2b
I (14389) HFP_STREAM: APP HFP event: INBAND_RING_TONE_EVT
I (14399) HFP_STREAM: --Inband ring state Provided
W (21379) BT_HCI: hci cmd send: sniff: hdl 0x80, intv(400 800)
W (21389) BT_HCI: hcif mode change: hdl 0x80, mode 2, intv 800, status 0x0
W (22169) BT_HCI: hcif mode change: hdl 0x80, mode 0, intv 0, status 0x0
I (22189) HFP_STREAM: APP HFP event: CALL_SETUP_IND_EVT
I (22189) HFP_STREAM: --Call setup indicator OUTGOING_DIALING
I (22189) HFP_STREAM: APP HFP event: CALL_SETUP_IND_EVT
I (22189) HFP_STREAM: --Call setup indicator OUTGOING_ALERTING
I (22279) HFP_STREAM: APP HFP event: AUDIO_STATE_EVT
I (22279) HFP_STREAM: --Audio state connected_msbc
I (22279) HFP_EXAMPLE: bt_app_hf_client_audio_open type = 1
I (22289) AUDIO_ELEMENT: [incoming-0x3ffd83a8] Element task created
I (22299) AUDIO_THREAD: The i2s_writer task allocate stack on internal memory
I (22299) AUDIO_ELEMENT: [i2s_writer-0x3ffd7c54] Element task created
I (22309) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:128288 Bytes

I (22319) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_RESUME,state:1
I (22329) AUDIO_PIPELINE: Pipeline started
I (22329) AUDIO_THREAD: The i2s_reader task allocate stack on internal memory
I (22339) AUDIO_ELEMENT: [i2s_reader-0x3ffd6df0] Element task created
I (22349) AUDIO_ELEMENT: [outgoing-0x3ffd8054] Element task created
I (22349) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:120752 Bytes

I (22359) AUDIO_ELEMENT: [i2s_reader] AEL_MSG_CMD_RESUME,state:1
E (22369) AUDIO_ELEMENT: [i2s_reader] Read IO type ringbuf but ringbuf not set
E (22379) AUDIO_ELEMENT: [i2s_reader] ERROR_PROCESS, AEL_IO_FAIL
W (22379) AUDIO_ELEMENT: [i2s_reader] audio_element_on_cmd_error,3
I (22389) AUDIO_PIPELINE: Pipeline started
-----------------------------------------------------------------------------------------------------------------------------------

Re: ESP32 lyrat mini adf hpf example error

Posted: Wed Jan 08, 2025 12:04 pm
by hamzatamer76
In esp32 pipeline hfp example, microphone and speaker are set in i2s settings with this line
#define I2S_STREAM_CFG_DEFAULT() I2S_STREAM_CFG_DEFAULT_WITH_PARA(I2S_NUM_0, 44100, I2S_DATA_BIT_WIDTH_16BIT, AUDIO_STREAM_WRITER)
so i2s set for microphone was not working correctly, that was why ringbuf set error. I fixed it by making it a reader, ringbuf set error is gone but microphone is still not working, my voice is not reaching the other party while talking on the phone