espressif / esp-adf

Espressif Audio Development Framework
Other
1.56k stars 690 forks source link

ESP-RTSP client play issue (AUD-5064) #1116

Open soloex1991eric opened 11 months ago

soloex1991eric commented 11 months ago

I (0) cpu_start: App cpu up. I (756) spiram: SPI SRAM memory test OK I (756) spiram: Instructions copied and mapped to SPIRAM I (839) spiram: Read only data copied and mapped to SPIRAM I (867) cpu_start: Pro cpu start user code I (867) cpu_start: cpu freq: 240000000 I (867) cpu_start: Application information: I (870) cpu_start: Project name: esp-rtsp I (875) cpu_start: App version: 1 I (879) cpu_start: Compile time: Dec 7 2023 12:29:59 I (885) cpu_start: ELF file SHA256: 2594f83210f33a74... I (891) cpu_start: ESP-IDF: v4.4.5-dirty I (897) cpu_start: Min chip rev: v0.0 I (901) cpu_start: Max chip rev: v0.99 I (906) cpu_start: Chip rev: v0.1 I (911) heap_init: Initializing. RAM available for dynamic allocation: I (918) heap_init: At 3FCAB530 len 0003E1E0 (248 KiB): D/IRAM I (924) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DIRAM I (931) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM I (938) spiram: Adding pool of 6656K of external SPI memory to heap allocator I (946) spi_flash: detected chip: gd I (950) spi_flash: flash io: qio I (954) sleep: Configure to isolate all GPIO pins in sleep state I (960) sleep: Enable automatic switching of GPIO sleep configuration I (968) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (983) spiram: Reserving pool of 18K of internal memory for DMA/internal allocations I (992) ESP_RTSP_Demo: Func:app_main, Line:93, MEM Total:7055715 Bytes, Inter:259967 Bytes, Dram:259967 Bytes

I (1005) ESP_RTSP_Demo: [ 1 ] Initialize peripherals management I (1010) pp: pp rom version: e7ae62f I (1013) net80211: net80211 rom version: e7ae62f I (1019) AUDIO_THREAD: The esp_periph task allocate stack on internal memory I (1020) wifi:wifi driver task: 3fcb2c14, prio:23, stack:6656, core=0 I (1033) system_api: Base MAC address is not set I (1038) system_api: read default base MAC address from EFUSE I (1045) wifi:wifi firmware version: 0f80fa0 I (1048) wifi:wifi certification version: v7.0 I (1052) wifi:config NVS flash: enabled I (1056) wifi:config nano formating: disabled I (1060) wifi:Init data frame dynamic rx buffer num: 128 I (1065) wifi:Init management frame dynamic rx buffer num: 128 I (1071) wifi:Init management short buffer num: 32 I (1075) wifi:Init static tx buffer num: 9 I (1079) wifi:Init tx cache buffer num: 32 I (1083) wifi:Init static tx FG buffer num: 2 I (1087) wifi:Init static rx buffer size: 1600 I (1091) wifi:Init static rx buffer num: 9 I (1095) wifi:Init dynamic rx buffer num: 128 I (1099) wifi_init: rx ba win: 16 I (1103) wifi_init: tcpip mbox: 64 I (1107) wifi_init: udp mbox: 64 I (1111) wifi_init: tcp mbox: 64 I (1115) wifi_init: tcp tx win: 65535 I (1119) wifi_init: tcp rx win: 65535 I (1123) wifi_init: tcp mss: 1440 I (1127) wifi_init: WiFi/LWIP prefer SPIRAM I (1132) wifi:Set ps type: 1

I (1135) phy_init: phy_version 601,fe52df4,May 10 2023,17:26:54 I (1168) wifi:mode : sta (34:85:18:6c:2b:c4) I (1168) wifi:enable tsf I (1416) wifi:new:<3,0>, old:<1,0>, ap:<255,255>, sta:<3,0>, prof:1 I (2304) wifi:state: init -> auth (b0) I (2306) wifi:state: auth -> assoc (0) I (2310) wifi:state: assoc -> run (10) I (2320) wifi:connected with berrysfe@unifi5, aid = 2, channel 3, BW20, bssid = 62:c9:e3:46:4a:01 I (2321) wifi:security: WPA2-PSK, phy: bgn, rssi: -22 I (2323) wifi:pm start, type: 1

I (2326) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 0, mt_pti: 25000, mt_time: 10000 W (2335) PERIPH_WIFI: WiFi Event cb, Unhandle event_base:WIFI_EVENT, event_id:4 I (2354) wifi:AP's beacon interval = 102400 us, DTIM period = 1 I (2567) wifi:idx:0 (ifx:0, 62:c9:e3:46:4a:01), tid:0, ssn:0, winSize:64 I (2757) wifi:idx:1 (ifx:0, 62:c9:e3:46:4a:01), tid:6, ssn:0, winSize:64 I (3835) esp_netif_handlers: sta ip: 192.168.0.120, mask: 255.255.255.0, gw: 192.168.0.1 I (3835) PERIPH_WIFI: Got ip:192.168.0.120 I (3838) ESP_RTSP_Demo: [ 2 ] Initialize av stream I (3844) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=8 I (3850) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=8 I (3857) I2S: I2S0, MCLK output by GPIO16 I (3867) DRV8311: ES8311 in Slave mode I (3879) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 W (3884) I2C_BUS: I2C bus has been already created, [port:0] I (3888) ES7210: ES7210 in Slave mode I (3898) ES7210: Enable ES7210_INPUT_MIC1 I (3902) ES7210: Enable ES7210_INPUT_MIC2 I (3905) ES7210: Enable ES7210_INPUT_MIC3 W (3909) ES7210: Enable TDM mode. ES7210_SDP_INTERFACE2_REG12: 2 I (3914) ES7210: config fmt 60 I (3920) AUDIO_HAL: Codec mode is 3, Ctrl:1 I (3927) ESP_RTSP_Demo: [ 3 ] Initialize console command I (3927) CONSOLE: Command history enabled

Type 'help' to get the list of commands. Use UP/DOWN arrows to navigate through command history. Press TAB when typing command name to auto-complete. esp32s3> start 2 rtsp://192.168.0.170:5888/audiodevice I (36917) ESP_RTSP_CLIENT: esp_rtsp ver: 1.1.0 compile date: Jun 8 2023-12:31:34 I (36918) ESP_RTSP_CLIENT: Conecting... I (36918) ESP_RTSP_CLIENT: RTSP Client URL:rtsp://192.168.0.170:5888/audiodevice I (36976) ESP_RTSP_CLIENT: TX:

OPTIONS rtsp://192.168.0.170:5888/audiodevice RTSP/1.0 CSeq: 0 User-Agent: ESP32-RTSP-client 1.1.0

I (36992) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK Server: happytime rtsp server V6.9 CSeq: 0 Date: Thu, Dec 07 2023 04:37:19 GMT Public: DESCRIBE, SETUP, PLAY, PAUSE, OPTIONS, TEARDOWN, GET_PARAMETER, SET_PARAMETER, ANNOUNCE, RECORD

I (37006) ESP_RTSP_CLIENT: TX:

DESCRIBE rtsp://192.168.0.170:5888/audiodevice RTSP/1.0 CSeq: 1 User-Agent: ESP32-RTSP-client 1.1.0 Accept: application/sdp

I (37046) ESP_RTSP_CLIENT: RX:

RTSP/1.0 200 OK Server: happytime rtsp server V6.9 CSeq: 1 Date: Thu, Dec 07 2023 04:37:19 GMT Session: 491 Content-Base: rtsp://192.168.0.170:5888/audiodevice Content-type: application/sdp Content-Length: 184

v=0 o=- 0 0 IN IP4 192.168.0.170 s=session c=IN IP4 192.168.0.170 t=0 0 a=control:* a=range:npt=0- m=audio 0 RTP/AVP 0 a=rtpmap:0 PCMU/8000/1 a=recvonly a=control:realaudio

I (37082) ESP_RTSP_CLIENT: TX:

SETUP rtsp://192.168.0.170:5888/audiodevice/trackID=0 RTSP/1.0 Transport: RTP/AVP;unicast;client_port=32500-32501;mode=record CSeq: 2 User-Agent: ESP32-RTSP-client 1.1.0 Session: 3986840

I (37108) ESP_RTSP_CLIENT: TX:

PLAY rtsp://192.168.0.170:5888/audiodevice RTSP/1.0 CSeq: 2 User-Agent: ESP32-RTSP-client 1.1.0 esp32s3>

I (37121) ESP_RTSP_CLIENT: TX:

TEARDOWN rtsp://192.168.0.170:5888/audiodevice RTSP/1.0 CSeq: 2 User-Agent: ESP32-RTSP-client 1.1.0 Session: 3986840

E (37137) TRANS_TCP: tcp_poll_write select error 104, errno = Connection reset by peer, fd = 54 E (37142) ESP_RTSP_CLIENT: Write failed, error: Socket is not connected

assert failed: xEventGroupWaitBits event_groups.c:369 (xEventGroup)

Backtrace: 0x4037a02a:0x3d9915b0 0x403865b5:0x3d9915d0 0x4038bc09:0x3d9915f0 0x42125d5e:0x3d991710 0x4200b8a8:0x3d991740 0x4200908a:0x3d991770 0x4204486d:0x3d991790 0x42044be2:0x3d9917b0 0x40386aa5:0x3d9917f0 0x4037a02a: panic_abort at /home/soloex/esp/esp-idf/components/esp_system/panic.c:408

0x403865b5: esp_system_abort at /home/soloex/esp/esp-idf/components/esp_system/esp_system.c:137

0x4038bc09: __assert_func at /home/soloex/esp/esp-idf/components/newlib/assert.c:85

0x42125d5e: xEventGroupWaitBits at /home/soloex/esp/esp-idf/components/freertos/event_groups.c:369 (discriminator 1)

0x4200b8a8: av_audio_dec_stop at /home/soloex/esp/esp-adf/examples/protocols/components/av_stream/av_stream.c:538 (discriminator 2)

0x4200908a: _esp_rtsp_state_handler at /home/soloex/ESP_ADF/VS_Code/esp-rtsp-cli-svr/build/../main/rtsp_service.c:62

0x4204486d: esp_rtsp_client_stop at /builds/adf/esp-adf-libs-source/esp_media_protocols/esp_rtc/esp_rtc_core/esp_rtsp/esp_rtsp_client.c:706

0x42044be2: _rtsp_client_task at /builds/adf/esp-adf-libs-source/esp_media_protocols/esp_rtc/esp_rtc_core/esp_rtsp/esp_rtsp_client.c:581

0x40386aa5: vPortTaskWrapper at /home/soloex/esp/esp-idf/components/freertos/port/xtensa/port.c:142

ELF file SHA256: 2594f83210f33a74

Rebooting... ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x40379c7c 0x40379c7c: esp_restart_noos at /home/soloex/esp/esp-idf/components/esp_system/port/soc/esp32s3/system_internal.c:151 (discriminator 1)


## Problem Description
ESP-RTSP client example does not work, crashes when using happytime-rtsp-server-x64,
[https://www.happytimesoft.com/products/rtsp-server/index.html](url), even though application works with VLC player.

``
E (37137) TRANS_TCP: tcp_poll_write select error 104, errno = Connection reset by peer, fd = 54
E (37142) ESP_RTSP_CLIENT: Write failed, error: Socket is not connected
``
### Expected Behavior
Audio streams to board

### Actual Behavior
Audio board reboots with error

### Steps to Reproduce
Upload code to board start rtsp in rtsp client play mode

### Code to Reproduce This Issue
Rtsp example code with
``.vcodec_type = AV_VCODEC_NULL,``
ahhfzhang commented 11 months ago

Hi @soloex1991eric

We do not support this rtsp-server yet, but we will support it soon.

Thanks.

soloex1991eric commented 11 months ago

Noted one other thing is it possible to implement two way communication using rtsp? if so how do I proceed?

matz-9 commented 9 months ago

Noted one other thing is it possible to implement two way communication using rtsp? if so how do I proceed?

Hi, by any chance, did you manage to get two-way audio communication working?

ahhfzhang commented 9 months ago

Hi ,

Yes, You can create two rtsp clients, one for puser to push local video and audio to rtsp server, another for player to pull rtsp server audio for playback. So that is two-way audio communication and one-way video preview.

br.

matz-9 commented 9 months ago

I'll try to implement this solution.

Thanks!

jason-mao commented 3 months ago

@matz-9 Any update from your side?