espressif / esp-adf

Espressif Audio Development Framework
Other
1.53k stars 672 forks source link

BT-HFP_AG with ADF (AUD-3382) #704

Open skateskate opened 2 years ago

skateskate commented 2 years ago

Hello, I have a LyraT V4.3 and I would like to create a HFP-AG with the audio codec chip support. I saw that there is an example of a HFP-client inside the ADF folder ("pipeline_hfp_stream") with codec support but I couldn't find any AG sample code. Inside the IDF folder there is an example for the AG ("hfp_ag" folder) but with no codec support. What is the best/easiest way to create a HFP-AG with codec support? Is it recommended to start with the IDF AG example and import the audio codec code or do I need to start with the ADF HFP-client example and create a new project for the AG following those guidelines?

skateskate commented 2 years ago

Update: following the HFP client example code located in esp-adf\examples\player\pipeline_hfp_stream I have written the code for the HFP-AG. I have two LyraT V4.3 and I flashed one with the pipeline client example and the other one with my AG code. The menuconfig configuration for both the examples is the default one I found in the pipeline_hfp_stream example, I only changed the Hands-free Profile Role configuration to Audio Gateway for the AG. The audio(SCO) data path is set to HCI, the BR/EDR Sync(SCO/eSCO) default data path is set to PCM and the Wide band speech is checked. If I connect my phone with the pipeline_hfp_stream example, everything works fine, I can hear audio from the jack present on the LyraT. Problems start when I try to connect the two LyraTs, in fact I can't hear any audio from either of the jacks present on the boards.

Here is the log from the AG:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7060
load:0x40078000,len:14308
load:0x40080400,len:3716
entry 0x40080680
I (27) boot: ESP-IDF v4.3.1 2nd stage bootloader
I (27) boot: compile time 14:05:13
I (27) boot: chip revision: 3
I (30) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed      : 40MHz
I (42) boot.esp32: SPI Mode       : DIO
I (46) boot.esp32: SPI Flash Size : 2MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (75) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (82) boot:  2 factory          factory app      00 00 00010000 00124f80
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 3, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2a238h (172600) map
I (172) esp_image: segment 1: paddr=0003a260 vaddr=3ffbdb60 size=03f2ch ( 16172) load
I (178) esp_image: segment 2: paddr=0003e194 vaddr=40080000 size=01e84h (  7812) load
I (182) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a39cch (670156) map
I (428) esp_image: segment 4: paddr=000e39f4 vaddr=40081e84 size=16bcch ( 93132) load
I (467) esp_image: segment 5: paddr=000fa5c8 vaddr=50000000 size=00010h (    16) load
I (479) boot: Loaded app from partition at offset 0x10000
I (479) boot: Disabling RNG early entropy source...
I (491) cpu_start: Pro cpu up.
I (491) cpu_start: Starting app cpu, entry point is 0x400813c4
I (0) cpu_start: App cpu up.
I (507) cpu_start: Pro cpu start user code
I (507) cpu_start: cpu freq: 160000000
I (508) cpu_start: Application information:
I (512) cpu_start: Project name:     pipeline_hfp_stream_example
I (519) cpu_start: App version:      1
I (523) cpu_start: Compile time:     Oct 23 2021 14:06:57
I (529) cpu_start: ELF file SHA256:  341184e4ce8136ad...
I (535) cpu_start: ESP-IDF:          v4.3.1
I (540) heap_init: Initializing. RAM available for dynamic allocation:
I (547) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (553) heap_init: At 3FFB7468 len 00000B98 (2 KiB): DRAM
I (559) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (565) heap_init: At 3FFC9518 len 00016AE8 (90 KiB): DRAM
I (572) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (578) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (584) heap_init: At 40098A50 len 000075B0 (29 KiB): IRAM
I (592) spi_flash: detected chip: generic
I (595) spi_flash: flash io: dio
W (599) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (614) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (682) NIC_HFP_MAIN: [ 1 ] init Bluetooth
I (682) BTDM_INIT: BT controller compile version [bfbbe1e]
I (682) system_api: Base MAC address is not set
I (682) system_api: read default base MAC address from EFUSE
I (692) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
E (1412) BT_BTC: btc_hf_cb_handler: Invalid index -1
I (1412) NIC_HFP_MAIN: [ 2 ] Start codec chip
I (1422) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
I (1442) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1442) ES8388_DRIVER: init,out:02, in:00
I (1452) AUDIO_HAL: Codec mode is 3, Ctrl:1
I (1452) NIC_HFP_MAIN: [ 3 ] Create audio pipeline for playback
I (1452) NIC_HFP_MAIN: [3.1] Create i2s stream to write data to codec chip and read data from codec chip
I (1462) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (1472) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (1502) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0
I (1502) LYRAT_V4_3: I2S0, MCLK output by GPIO0
W (1512) I2S: I2S driver already installed
I (1512) LYRAT_V4_3: I2S0, MCLK output by GPIO0
I (1522) NIC_HFP_MAIN: [3.2] Get hfp stream
I (1522) NIC_HFP_STREAM_AG: outgoing stream init
I (1532) NIC_HFP_STREAM_AG: incoming stream init
I (1532) NIC_HFP_MAIN: [3.2] Register all elements to audio pipeline
I (1542) NIC_HFP_MAIN: [3.3] Link it together [Bluetooth]-->hfp_in_stream-->i2s_stream_writer-->[codec_chip]
I (1552) AUDIO_PIPELINE: link el->rb, el:0x3ffd6fc0, tag:incoming, rb:0x3ffd7364
I (1562) AUDIO_PIPELINE: link el->rb, el:0x3ffd4720, tag:i2s_reader, rb:0x3ffd94ac
I (1572) NIC_HFP_MAIN: [ 4 ] Initialize peripherals
E (1572) gpio: gpio_install_isr_service(460): GPIO isr service already installed
I (1582) NIC_HFP_MAIN: [ 5 ] Set up  event listener
I (1592) NIC_HFP_MAIN: [5.1] Listening event from all elements of pipeline
I (1602) NIC_HFP_MAIN: [5.2] Listening event from peripherals
I (1602) NIC_HFP_MAIN: [ 6 ] Start audio_pipeline
I (1612) AUDIO_ELEMENT: [incoming-0x3ffd6fc0] Element task created
I (1612) AUDIO_ELEMENT: [i2s_writer-0x3ffd692c] Element task created
I (1622) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:139208 Bytes

I (1632) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_RESUME,state:1
I (1642) I2S_STREAM: AUDIO_STREAM_WRITER
I (1642) AUDIO_PIPELINE: Pipeline started
I (1642) NIC_HFP_MAIN: [ 7 ] Listen for all pipeline events
W (2982) BT_APPL: new conn_srvc id:5, app_id:0
I (2982) NIC_HFP_STREAM_AG: APP HFP event: CONNECTION_STATE_EVT
I (2982) NIC_HFP_STREAM_AG: --connection state CONNECTED, peer feats 0x0, chld_feats 0x0
E (3022) BT_BTC: btc_hf_cb_handler: Invalid index 11876
I (3072) NIC_HFP_STREAM_AG: APP HFP event: CIND_RESPONSE_EVT
I (3072) NIC_HFP_STREAM_AG: --CIND Start.
I (3112) NIC_HFP_STREAM_AG: APP HFP event: CONNECTION_STATE_EVT
I (3112) NIC_HFP_STREAM_AG: --connection state SLC_CONNECTED, peer feats 0xff, chld_feats 0x4013
I (7672) NIC_HFP_STREAM_AG: APP HFP event: AUDIO_STATE_EVT
I (7672) NIC_HFP_STREAM_AG: --Audio State connecting
I (7722) NIC_HFP_STREAM_AG: APP HFP event: BCS_EVT
I (7722) NIC_HFP_STREAM_AG: --Consequence of codec negotiation: Use MSBC
E (7752) BT_BTM: btm_sco_connected, handle 181
I (7752) NIC_HFP_STREAM_AG: APP HFP event: AUDIO_STATE_EVT
I (7752) NIC_HFP_STREAM_AG: --Audio State connected_msbc
I (7752) NIC_HFP_MAIN: bt_app_hf_client_audio_open type = 1
I (7792) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
W (7792) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7802) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7802) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7812) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7822) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7822) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7832) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7842) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7842) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7852) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7862) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7872) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7872) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7882) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7892) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7902) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7902) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7912) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7922) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7932) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7932) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7942) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7952) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7962) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7962) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7972) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7982) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7992) BT_APPL: bta_ag_sco_read_cback: status(2)
W (7992) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8002) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8012) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8012) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_PAUSE
W (8022) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8022) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8032) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8042) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8042) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
W (8052) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8052) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_RESUME,state:4
I (8062) I2S_STREAM: AUDIO_STREAM_WRITER
W (8062) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8072) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8072) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8082) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8092) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8092) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8102) AUDIO_ELEMENT: [i2s_reader-0x3ffd4720] Element task created
W (8102) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8112) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8112) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8122) AUDIO_ELEMENT: [outgoing-0x3ffd6c6c] Element task created
W (8122) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8132) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8142) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8142) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8152) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:128568 Bytes

W (8152) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8162) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8172) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8172) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8182) AUDIO_ELEMENT: [i2s_reader] AEL_MSG_CMD_RESUME,state:1
I (8192) I2S_STREAM: AUDIO_STREAM_READER,Rate:16000,ch:1
W (8192) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8202) BT_APPL: bta_ag_sco_read_cback: status(2)
I (8232) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
W (8232) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8242) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8242) BT_APPL: bta_ag_sco_read_cback: status(2)
W (8252) BT_APPL: bta_ag_sco_read_cback: status(2)

and here is the log for the client:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7060
load:0x40078000,len:14308
load:0x40080400,len:3716
entry 0x40080680
I (27) boot: ESP-IDF v4.3.1 2nd stage bootloader
I (27) boot: compile time 13:36:23
I (27) boot: chip revision: 3
I (30) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed      : 40MHz
I (42) boot.esp32: SPI Mode       : DIO
I (46) boot.esp32: SPI Flash Size : 2MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (75) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (82) boot:  2 factory          factory app      00 00 00010000 00124f80
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 3, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2a200h (172544) map
I (172) esp_image: segment 1: paddr=0003a228 vaddr=3ffbdb60 size=03f7ch ( 16252) load
I (178) esp_image: segment 2: paddr=0003e1ac vaddr=40080000 size=01e6ch (  7788) load
I (182) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a1c9ch (662684) map
I (426) esp_image: segment 4: paddr=000e1cc4 vaddr=40081e6c size=16be4h ( 93156) load
I (464) esp_image: segment 5: paddr=000f88b0 vaddr=50000000 size=00010h (    16) load
I (476) boot: Loaded app from partition at offset 0x10000
I (477) boot: Disabling RNG early entropy source...
I (488) cpu_start: Pro cpu up.
I (488) cpu_start: Starting app cpu, entry point is 0x400813c4
I (0) cpu_start: App cpu up.
I (505) cpu_start: Pro cpu start user code
I (505) cpu_start: cpu freq: 160000000
I (505) cpu_start: Application information:
I (509) cpu_start: Project name:     pipeline_hfp_stream_example
I (516) cpu_start: App version:      1
I (520) cpu_start: Compile time:     Oct 23 2021 13:46:31
I (526) cpu_start: ELF file SHA256:  6e6341779e11e60c...
I (532) cpu_start: ESP-IDF:          v4.3.1
I (538) heap_init: Initializing. RAM available for dynamic allocation:
I (545) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (551) heap_init: At 3FFB7468 len 00000B98 (2 KiB): DRAM
I (557) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (563) heap_init: At 3FFCA328 len 00015CD8 (87 KiB): DRAM
I (569) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (575) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (582) heap_init: At 40098A50 len 000075B0 (29 KiB): IRAM
I (589) spi_flash: detected chip: generic
I (593) spi_flash: flash io: dio
W (597) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (611) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (680) HFP_EXAMPLE: [ 1 ] init Bluetooth
I (680) BTDM_INIT: BT controller compile version [bfbbe1e]
I (680) system_api: Base MAC address is not set
I (680) system_api: read default base MAC address from EFUSE
I (690) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1420) HFP_EXAMPLE: [ 2 ] Start codec chip
I (1420) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
I (1440) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1440) ES8388_DRIVER: init,out:02, in:00
I (1450) AUDIO_HAL: Codec mode is 3, Ctrl:1
I (1460) HFP_EXAMPLE: [ 3 ] Create audio pipeline for playback
I (1460) HFP_EXAMPLE: [3.1] Create i2s stream to write data to codec chip and read data from codec chip
I (1470) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (1480) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (1510) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 11289597.000, SCLK: 1411199.625000, diva: 1, divb: 0
I (1510) LYRAT_V4_3: I2S0, MCLK output by GPIO0
W (1520) I2S: I2S driver already installed
I (1520) LYRAT_V4_3: I2S0, MCLK output by GPIO0
I (1530) HFP_EXAMPLE: [3.2] Get hfp stream
I (1530) HFP_STREAM: outgoing stream init
I (1540) HFP_STREAM: incoming stream init
I (1540) HFP_EXAMPLE: [3.2] Register all elements to audio pipeline
I (1550) HFP_EXAMPLE: [3.3] Link it together [Bluetooth]-->hfp_in_stream-->i2s_stream_writer-->[codec_chip]
I (1560) AUDIO_PIPELINE: link el->rb, el:0x3ffd852c, tag:incoming, rb:0x3ffd88d0
I (1570) AUDIO_PIPELINE: link el->rb, el:0x3ffd7aec, tag:i2s_reader, rb:0x3ffdaa18
I (1570) HFP_EXAMPLE: [ 4 ] Initialize peripherals
E (1580) gpio: gpio_install_isr_service(460): GPIO isr service already installed
I (1590) HFP_EXAMPLE: [ 5 ] Set up  event listener
I (1590) HFP_EXAMPLE: [5.1] Listening event from all elements of pipeline
I (1600) HFP_EXAMPLE: [5.2] Listening event from peripherals
I (1610) HFP_EXAMPLE: [ 6 ] Start audio_pipeline
I (1610) AUDIO_ELEMENT: [incoming-0x3ffd852c] Element task created
I (1620) AUDIO_ELEMENT: [i2s_writer-0x3ffd7e88] Element task created
I (1630) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:134032 Bytes

I (1630) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_RESUME,state:1
I (1640) I2S_STREAM: AUDIO_STREAM_WRITER
I (1650) AUDIO_PIPELINE: Pipeline started
I (1650) HFP_EXAMPLE: [ 7 ] Listen for all pipeline events
W (11560) BT_APPL: new conn_srvc id:27, app_id:1
I (11560) HFP_STREAM: APP HFP event: CONNECTION_STATE_EVT
I (11560) HFP_STREAM: --Connection state connected, peer feats 0x0, chld_feats 0x0
I (11680) HFP_STREAM: APP HFP event: CALL_IND_EVT
I (11690) HFP_STREAM: --Call indicator NO call in progress
I (11690) HFP_STREAM: APP HFP event: CALL_SETUP_IND_EVT
I (11690) HFP_STREAM: --Call setup indicator NONE
I (11700) HFP_STREAM: APP HFP event: NETWORK_STATE_EVT
I (11700) HFP_STREAM: --NETWORK state available
I (11710) HFP_STREAM: APP HFP event: SIGNAL_STRENGTH_IND_EVT
I (11720) HFP_STREAM: --Signal strength: 4
I (11720) HFP_STREAM: APP HFP event: ROAMING_STATUS_IND_EVT
I (11730) HFP_STREAM: --ROAMING: inactive
I (11730) HFP_STREAM: APP HFP event: BATTERY_LEVEL_IND_EVT
I (11740) HFP_STREAM: --Battery level 3
I (11740) HFP_STREAM: APP HFP event: CALL_HELD_IND_EVT
I (11750) HFP_STREAM: --Call held indicator NONE held
I (11750) HFP_STREAM: APP HFP event: CONNECTION_STATE_EVT
I (11760) HFP_STREAM: --Connection state slc_connected, peer feats 0x36e, chld_feats 0x0
I (11770) HFP_STREAM: APP HFP event: INBAND_RING_TONE_EVT
I (11770) HFP_STREAM: --Inband ring state Provided
E (16370) BT_BTM: btm_sco_connected, handle 180
I (16370) HFP_STREAM: APP HFP event: AUDIO_STATE_EVT
I (16370) HFP_STREAM: --Audio state connected_msbc
I (16380) HFP_EXAMPLE: bt_app_hf_client_audio_open type = 1
I (16410) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
I (16570) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_PAUSE
I (16600) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
I (16600) AUDIO_ELEMENT: [i2s_writer] AEL_MSG_CMD_RESUME,state:4
I (16610) I2S_STREAM: AUDIO_STREAM_WRITER
I (16620) AUDIO_ELEMENT: [i2s_reader-0x3ffd7aec] Element task created
I (16620) AUDIO_ELEMENT: [outgoing-0x3ffd81d8] Element task created
I (16630) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:123864 Bytes

I (16640) AUDIO_ELEMENT: [i2s_reader] AEL_MSG_CMD_RESUME,state:1
I (16640) I2S_STREAM: AUDIO_STREAM_READER,Rate:16000,ch:1
I (16650) AUDIO_PIPELINE: Pipeline started
I (16710) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 4095996.500, SCLK: 511999.562500, diva: 1, divb: 0
I (16710) AUDIO_ELEMENT: [i2s_reader] AEL_MSG_CMD_RESUME,state:3

First of all, are my audio(SCO) data path and BR/EDR Sync(SCO/eSCO) default data path correct in order to use the on board audio codec chip of the LyraT V4.3? Unfortunately I could not find in the docs any clear explanations on how to configure the audio path. If the configurations are correct, what other could be wrong? Any help would be much appreciated.

skateskate commented 2 years ago

@jason-mao sorry to bother you, could you please look at the issue? After the post in the IDF git I have set the bluetooth configurations correctly (all to HCI) but I can't hear audio from the boards. If I disable Wide band speech the audio link between the two boards works at 8 kHz, so the AG part I wrote should be correct. With Wide band speech-->ON instead the audio is completely silent. What could be wrong? I need to know if I can use your board for my project and I don't have too much time left.

APBeck3rd commented 2 years ago

@skateskate - I'm also trying to get the pipeline_hfp_stream to work as an HFP_AG source. Can you share the modifications you've made to the code?

skateskate commented 2 years ago

@APBeck3rd in the end I did not use the esp-adf to create the HFP_AG, I couldn't find the problem and the library doesn't have support. I used the esp-idf library instead, since there is an example of the AG in the example folder and there is a lot more support here on github,.

APBeck3rd commented 2 years ago

Okay, thanks.


From: skateskate @.> Sent: 12/23/21 12:09 AM To: espressif/esp-adf @.> Cc: Andy Beck @.>, Mention @.> Subject: Re: [espressif/esp-adf] HFP_AG with ADF (AUD-3382) (Issue #704)

@APBeck3rd in the end I did not use the esp-adf to create the HFP_AG, I couldn't find the problem and the library doesn't have support. I used the esp-idf library instead, since there is an example of the AG in the example folder and there is a lot more support here on github,.

Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

shridattdudhat commented 2 years ago

@skateskate

@APBeck3rd in the end I did not use the esp-adf to create the HFP_AG, I couldn't find the problem and the library doesn't have support. I used the esp-idf library instead, since there is an example of the AG in the example folder and there is a lot more support here on github,.

Hi, I am trying similar kind of use case. Can you tell us does your modifications worked ??

832 I created this issue for the same kind of application

skateskate commented 2 years ago

Hi @shridattdudhat, using the esp-idf I was able to have a good communication between two Lyrat. I remember that I had to port the codec initialization part from the adf example to the idf ones. I had to include also all the I2S communication in the idf examples (you can find some code of this part on this issue I opened). Hope this helps!

fyoung123 commented 1 year ago

Recently I also meet the same problem. Thank you for your advice.