A2DP source limiting frames

gtalusan
Posts: 3
Joined: Sun Mar 18, 2018 6:58 pm

A2DP source limiting frames

Postby gtalusan » Mon Mar 19, 2018 2:24 am

I have two ESP32 WROOM 32s. One is a NodeMCU board, and one is a bare chip soldered onto a breakout. Both are using 4 bit SDIO to read PCM data from an SD card and push it via A2DP to a speaker.

The NodeMCU board works more or less correctly.

My bare board produces the following log.. and the speaker output is really choppy. I have a 1000uF electrolytic between Vcc/GND.

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:5660
load:0x40078000,len:0
load:0x40078000,len:13912
entry 0x40078fd8
I (29) boot: ESP-IDF v3.1-dev-512-g6a9927ee 2nd stage bootloader
I (29) boot: compile time 20:54:18
I (29) boot: Enabling RNG early entropy source...
I (35) boot: SPI Speed      : 40MHz
I (39) boot: SPI Mode       : DIO
I (43) boot: SPI Flash Size : 4MB
I (47) boot: Partition Table:
I (50) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (65) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (73) boot:  2 factory          factory app      00 00 00010000 00100000
I (80) boot:  3 storage          Unknown data     01 82 00110000 000f0000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x397f8 (235512) map
I (182) esp_image: segment 1: paddr=0x00049820 vaddr=0x3ffc0000 size=0x02984 ( 10628) load
I (187) esp_image: segment 2: paddr=0x0004c1ac vaddr=0x40080000 size=0x00400 (  1024) load
0x40080000: _iram_start at /Users/george/esp/esp-idf/components/freertos/./xtensa_vectors.S:1685

I (189) esp_image: segment 3: paddr=0x0004c5b4 vaddr=0x40080400 size=0x03a5c ( 14940) load
I (204) esp_image: segment 4: paddr=0x00050018 vaddr=0x400d0018 size=0x8acc0 (568512) map
0x400d0018: _stext at ??:?

I (404) esp_image: segment 5: paddr=0x000dace0 vaddr=0x40083e5c size=0x0a728 ( 42792) load
0x40083e5c: spi_flash_mmap at /Users/george/esp/esp-idf/components/spi_flash/./flash_mmap.c:293

I (422) esp_image: segment 6: paddr=0x000e5410 vaddr=0x400c0000 size=0x00000 (     0) load
I (431) boot: Loaded app from partition at offset 0x10000
I (431) boot: Disabling RNG early entropy source...
I (432) cpu_start: Pro cpu up.
I (435) cpu_start: Starting app cpu, entry point is 0x40080f80
0x40080f80: call_start_cpu1 at /Users/george/esp/esp-idf/components/esp32/./cpu_start.c:225

I (0) cpu_start: App cpu up.
I (446) heap_init: Initializing. RAM available for dynamic allocation:
I (452) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (458) heap_init: At 3FFCDEC0 len 00012140 (72 KiB): DRAM
I (465) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (471) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (477) heap_init: At 4008E584 len 00011A7C (70 KiB): IRAM
I (484) cpu_start: Pro cpu start user code
I (166) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (174) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
Name: SU02G
Type: SDSC
Speed: default speed
Size: 1886MB
CSD: ver=0, sector_size=512, capacity=3862528 read_bl_len=10
SCR: sd_spec=2, bus_width=5
I (374) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (664) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0
I (694) BT_AV: Starting device discovery...
I (704) BT_AV: Discovery started.
I (2624) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (2624) BT_AV: --Class of Device: 0x380104
I (2624) BT_AV: --RSSI: -64
I (2644) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (2644) BT_AV: --Class of Device: 0x380104
I (2644) BT_AV: --RSSI: -64
I (2994) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (2994) BT_AV: --Class of Device: 0x380104
I (2994) BT_AV: --RSSI: -63
I (3084) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (3084) BT_AV: --Class of Device: 0x380104
I (3084) BT_AV: --RSSI: -63
I (3104) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (3104) BT_AV: --Class of Device: 0x380104
I (3114) BT_AV: --RSSI: -64
I (3274) BT_AV: Scanned device: d8:a2:5e:81:4f:4a
I (3284) BT_AV: --Class of Device: 0x380104
I (3284) BT_AV: --RSSI: -63
I (5844) BT_AV: Scanned device: 15:00:00:02:74:2f
I (5844) BT_AV: --Class of Device: 0x260404
I (5844) BT_AV: --RSSI: -57
I (5844) BT_AV: Found a target device, address 15:00:00:02:74:2f, name BT SPEAKER
I (5854) BT_AV: Cancel device discovery ...
I (5864) BT_AV: Device discovery stopped.
I (5864) BT_AV: a2dp connecting to peer: BT SPEAKER
E (5874) BT: reset flags
I (5874) BT_AV: bt_app_av_sm_hdlr state 4, evt 0x0
E (8144) BT: bta_av_rc_create ACP handle exist for shdl:0
I (8314) BT_AV: bt_app_av_sm_hdlr state 4, evt 0x0
I (8314) BT_AV: a2dp connected
I (10694) BT_AV: bt_app_av_sm_hdlr state 5, evt 0xff00
I (10694) BT_AV: a2dp media ready checking ...
I (10694) BT_AV: bt_app_av_sm_hdlr state 5, evt 0x3
I (10694) BT_AV: a2dp media ready, starting ...
E (10784) BT: bta_av_link_role_ok hndl:x41 role:0 conn_audio:x1 bits:1 features:x824b

E (10794) BT: BTA_AV_START_EVT status 0, suspending 0, init 1

I (10794) BT_AV: bt_app_av_sm_hdlr state 5, evt 0x3
I (10794) BT_AV: a2dp media start successfully.
I (10804) BT_AV: bt_app_av_sm_hdlr state 5, evt 0x1
E (10874) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 28 to 21
E (10954) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 38 to 21
E (11044) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 48 to 21
E (11134) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 58 to 21
E (11224) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 68 to 21
E (11324) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 79 to 21
E (11414) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 88 to 21
E (11494) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 98 to 21
E (11584) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 108 to 21
E (11674) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 118 to 21
E (11764) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 128 to 21
E (11854) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 137 to 21
E (11944) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 147 to 21
E (12034) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 157 to 21
E (12124) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 167 to 21
E (12214) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 177 to 21
E (12304) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 187 to 21
E (12394) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 196 to 21
E (12484) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 206 to 21
E (12574) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 216 to 21
E (12664) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 226 to 21
E (12754) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 236 to 21
E (12844) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 246 to 21
E (12934) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 255 to 21
E (13204) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 29 to 21
E (13294) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 39 to 21
E (13384) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 49 to 21
E (13474) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 58 to 21
E (13564) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 68 to 21
E (13654) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 78 to 21
E (13734) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 88 to 21
E (13824) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 98 to 21
E (13914) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 108 to 21
E (14004) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 117 to 21
E (14094) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 127 to 21
E (14184) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 137 to 21
E (14274) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 147 to 21
E (14364) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 157 to 21
E (14454) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 166 to 21
E (14544) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 176 to 21
E (14634) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 186 to 21
E (14724) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 196 to 21
E (14814) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 206 to 21
E (14904) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 216 to 21
E (14994) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 225 to 21
E (15084) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 235 to 21
E (15174) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 245 to 21
E (15264) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 255 to 21
E (15524) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 28 to 21
E (15614) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 38 to 21
E (15704) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 48 to 21
E (15794) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 58 to 21
E (15884) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 68 to 21
E (15974) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 78 to 21
E (16064) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 88 to 21
E (16154) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 97 to 21
E (16244) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 107 to 21
E (16334) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 117 to 21
E (16424) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 127 to 21
E (16514) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 137 to 21
E (16604) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 147 to 21
E (16694) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 157 to 21
E (16784) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 166 to 21
E (16864) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 176 to 21
E (16954) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 186 to 21
E (17044) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 196 to 21
E (17134) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 206 to 21
E (17224) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 216 to 21
E (17314) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 225 to 21
E (17404) BT: btc_get_num_aa_frame() - Limiting frames to be sent from 235 to 21

gtalusan
Posts: 3
Joined: Sun Mar 18, 2018 6:58 pm

Re: A2DP source limiting frames

Postby gtalusan » Wed Mar 21, 2018 1:17 am

Solved... I added,

gpio_pullup_en(GPIO_NUM_15);
gpio_pullup_en(GPIO_NUM_2);
gpio_pullup_en(GPIO_NUM_4);
gpio_pullup_en(GPIO_NUM_12);
gpio_pullup_en(GPIO_NUM_13);

After the the gpio_set_pull_mode's in a2dp_source/main/main.c and it works like a champ now on both of my boards.

mingshi
Posts: 2
Joined: Fri Mar 09, 2018 4:42 pm

Re: A2DP source limiting frames

Postby mingshi » Fri Mar 30, 2018 1:13 pm

Hi, I am now doing a project about A2DP, and I met the same problem with you , why your code runs well after adding gpio_pullup_en()? Are these gpio pins you are using in your project?

Who is online

Users browsing this forum: Bing [Bot] and 88 guests