-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32: Unable to connect to handsfree [hsp_ag_demo] & [hfp_ag_demo] #82
Comments
hi! in the log, your handsfree unit disconnects the SDP connection right after BTstack sends the last configure response. Looking at this closely, BTstack did sent an incorrect value. I don't know if this causes the disconnect, but it could be. I've fixed this incorrect value on the 'develop' branch. Could you switch to the develop branch, git pull, ./integrate_btstack.sh and try again? unrelated: we didn't try SCO packets (used for HFP/HSP) yet, let see how this turns out. What do you want to do if you could send/receive audio data? |
Hi Matthias, It connected like a charm using the develop branch btstack! I have tested the call simulation and it works, however it fails to establish an audio connection. Below is the log : [00:04:51.858] LOG -- hfp_ag_demo.c.193: USER:'b' I am trying to make a bluetooth audio gateway between a walkie talkie module (VHF band) and a regular bluetooth headset. using the esp32 and an external audio codec which will send communicate with the esp32 via I2S. Because I need 2 way audio communication, the only profile that works for me is HFP/HSP. Please feel free to give suggestions on any better way to achieve this. |
Just to add on, I was using the hfp_ag_demo in the previous post. I tried out hsp_ag_demo subsequently and was able to establish an audio connection, but I dont hear anything from the headset, instead I get the following : Establish audio connection Then until some point in time..... [00:10:52.025] SCO => 80 01 30 61 9D EE 93 30 8C 45 86 45 82 42 80 42 80 45 82 45 86 30 8C EE 93 61 9D 61 A8 C4 B4 56 C2 E2 D0 2B E0 F5 EF 00 00 0B 10 D5 1F 1E 2F AA 3D 3C 4B Backtrace: 0x40087fd0:0x3ffc02c0 0x4008809b:0x3ffc02e0 0x40081e0d:0x3ffc0300 0x40081f2d:0x3ffc0330 0x400d2ada:0x3ffc0350 0x400d2b35:0x3ffc0390 0x400e0c8e:0x3ffc03b0 0x400e0c9f:0x3ffc03d0 0x400ea8d9:0x3ffc0400 0x400e878a:0x3ffc0420 0x4001791d:0x3ffc0440 0x400e8c2e:0x3ffc0460 0x400e8dba:0x3ffc04a0 0x400188f5:0x3ffc04d0 0x40055fca:0x3ffc0510 0x40082f2a:0x3ffc0530 0x40032ae6:0x3ffc0550 0x40034a99:0x3ffc0590 0x4003a85e:0x3ffc05b0 0x400554a1:0x3ffc05d0 0x40084273:0x3ffc05f0 0x4008179d:0x3ffc0610 0x4008809b: abort at /Users/haoye/esp/esp-idf/components/esp32/./panic.c:546 0x40081e0d: lock_acquire_generic at /Users/haoye/esp/esp-idf/components/newlib/./locks.c:141 0x40081f2d: _lock_acquire_recursive at /Users/haoye/esp/esp-idf/components/newlib/./locks.c:169 0x400d2ada: _puts_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/puts.c:98 (discriminator 2) 0x400d2b35: puts at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/puts.c:138 0x400e0c8e: report_recv_called_from_isr at /Users/haoye/esp/esp-idf/components/btstack/./main.c:96 0x400e0c9f: host_recv_pkt_cb at /Users/haoye/esp/esp-idf/components/btstack/./main.c:120 0x400ea8d9: vhci_send at ??:? 0x400e878a: r_eif_send at ??:? 0x400e8c2e: hci_tx_start at hci_tl.c:? 0x400e8dba: r_hci_tl_send at ??:? 0x40082f2a: r_assert_err at ??:? 0x40084273: r_rwbtdm_isr_wrapper at intc.c:? 0x4008179d: _xt_lowint1 at xtensa_vectors.o:? |
hi. I'll verify the hfp_ag mode later. The hsp looks good. it could be that the crash is caused by logging too much. You could try to skipping logging SCO packets in src/hci_dump.c Ideally, you should hear a sine wave in the handsfree in hfp_ag and hsp_ag demos. |
well, actually, an assert is triggered: the callback should not be called from an ISR, but it is. Still, it might be related to the SCO logging, so please try without logging the SCO packets. |
Hi Matthias! I've tried to comment out all the logging and printing while transmitting SCO packets, I still do not hear a sine wave. Instead, I can hear some very minute noise from time to time, and I get the following results in the log : Establish audio connection Also, the application seem to be stuck somewhere, I could not disconnect or do anything else once I establish the audio connection. Thanks. |
Thanks for the update. I'll try to reproduce this and file an issue on the esp-idf repository after trying to understand it better. |
Hi. I've tried HFP HF with an iPhone and HFP AG with a Bluetooth loudspeaker. I didn't seem to receive any packets, and only did hear a bit of noise on the speaker. I've posted on the esp-idf issue list: espressif/esp-idf#1118 Let's see what's the status on this. |
Thank you so much for the help ! Really appreciate it |
FWIW, HFP works on ESP32 since a while. |
Hi, I realized that I am unable to connect to my handsfree using either HFP or HSP. They both give the same error : "Service not found, status 129". Below is the console log for your reference.
Connect to 30:21:98:00:40:CC
[00:10:04.450] LOG -- hsp_ag.c.472: Start SDP query 30:21:98:00:40:CC, 0x1108
[00:10:04.450] LOG -- l2cap.c.1684: L2CAP_CREATE_CHANNEL addr 30:21:98:00:40:CC psm 0x1 mtu 1691 -> local mtu 1691
[00:10:04.458] LOG -- l2cap.c.1706: l2cap_create_channel, hci connection already exists
[00:10:04.466] LOG -- l2cap.c.1594: l2cap_handle_connection_complete expected state
[00:10:04.473] LOG -- l2cap.c.1622: l2cap received remote supported features, sec_level_0_allowed for psm 1 = 1
[00:10:04.483] ACL => 81 00 0C 00 08 00 01 00 02 03 04 00 01 00 42 00
[00:10:04.489] LOG -- l2cap.c.963: l2cap_stop_rtx for local cid 0x42
[00:10:04.495] LOG -- l2cap.c.969: l2cap_start_rtx for local cid 0x42
[00:10:04.502] EVT <= 6E 00
[00:10:04.504] EVT <= 13 05 01 81 00 01 00
[00:10:04.521] ACL <= 81 20 10 00 0C 00 01 00 03 03 08 00 46 00 42 00 00 00 00 00
[00:10:04.522] LOG -- l2cap.c.2275: L2CAP signaling handler code 3, state 10
[00:10:04.525] LOG -- l2cap.c.963: l2cap_stop_rtx for local cid 0x42
[00:10:04.531] ACL => 81 00 10 00 0C 00 01 00 04 04 08 00 46 00 00 00 01 02 9B 06
[00:10:04.538] LOG -- l2cap.c.963: l2cap_stop_rtx for local cid 0x42
[00:10:04.544] LOG -- l2cap.c.969: l2cap_start_rtx for local cid 0x42
[00:10:04.550] EVT <= 13 05 01 81 00 01 00
[00:10:04.554] EVT <= 6E 00
[00:10:04.569] ACL <= 81 20 11 00 0E 00 01 00 05 04 0A 00 42 00 00 00 00 00 01 02 A0
[00:10:04.572] ACL <= 81 10 01 00 02
[00:10:04.573] LOG -- l2cap.c.2275: L2CAP signaling handler code 5, state 11
[00:10:04.577] LOG -- l2cap.c.963: l2cap_stop_rtx for local cid 0x42
[00:10:04.583] LOG -- l2cap.c.2209: l2cap_signaling_handle_configure_response
[00:10:04.590] ACL <= 81 20 10 00 0C 00 01 00 04 0E 08 00 42 00 00 00 01 02 A0 02
[00:10:04.597] LOG -- l2cap.c.2275: L2CAP signaling handler code 4, state 11
[00:10:04.604] LOG -- l2cap.c.2140: Remote MTU 672
[00:10:04.608] ACL => 81 00 12 00 0E 00 01 00 05 0E 0A 00 46 00 00 00 00 00 01 02 9B 06
[00:10:04.616] LOG -- l2cap.c.838: L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr 30:21:98:00:40:CC handle 0x81 psm 0x1 local_cid 0x42 remote_cid 0x46 local_mtu 1691, remote_mtu 672, flush_timeout 0
[00:10:04.633] EVT <= 70 16 00 CC 40 00 98 21 30 81 00 01 00 42 00 46 00 9B 06 A0 02 00 00 00
[00:10:04.641] EVT <= 13 05 01 81 00 01 00
[00:10:04.645] EVT <= 6E 00
[00:10:04.648] EVT <= 78 02 42 00
[00:10:04.651] ACL => 81 00 18 00 14 00 46 00 06 00 02 00 0F 35 03 19 11 08 06 9B 35 05 0A 00 01 01 00 00
[00:10:04.660] ACL <= 81 20 0C 00 08 00 01 00 06 0F 04 00 42 00 46 00
[00:10:04.667] LOG -- l2cap.c.2275: L2CAP signaling handler code 6, state 12
[00:10:04.673] EVT <= 13 05 01 81 00 01 00
[00:10:04.677] EVT <= 6E 00
[00:10:04.680] ACL => 81 00 0C 00 08 00 01 00 07 0F 04 00 42 00 46 00
[00:10:04.686] LOG -- l2cap.c.857: L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x42
[00:10:04.693] EVT <= 71 02 42 00
[00:10:04.696] LOG -- sdp_client.c.478: SDP Client disconnected.
[00:10:04.702] LOG -- hsp_ag.c.728: Service not found, status 129.
Audio connection establishment failed with status 129
[00:10:04.713] LOG -- l2cap.c.963: l2cap_stop_rtx for local cid 0x42
[00:10:04.719] EVT <= 13 05 01 81 00 01 00
[00:10:04.723] EVT <= 6E 00
[00:10:04.744] ACL <= 81 20 11 00 4A 00 42 00 07 00 02 00 45 00 40 36 00 46 36 00 43
[00:10:04.747] ACL <= 81 10 11 00 09 00 01 35 06 19 11 08 19 12 03 09 00 04 35 0C 35
[00:10:04.749] ACL <= 81 10 11 00 03 19 01 00 35 05 19 00 03 08 02 09 00 06 35 09 09
[00:10:04.756] ACL <= 81 10 11 00 65 6E 09 00 6A 09 01 00 09 00 09 35 08 35 06 19 11
[00:10:04.763] ACL <= 81 10 0A 00 08 09 01 02 09 01 00 02 00 40
Thanks for taking your time to read this.
The text was updated successfully, but these errors were encountered: