geeksville / Micro-RTSP

A RTSP video server intended for very small CPUs (ESP32 etc)
MIT License
778 stars 203 forks source link

Crash on creating streamer #33

Closed DraconInteractive closed 4 years ago

DraconInteractive commented 4 years ago

Im getting LoadProhibited Guru Meditation error when creating a streamer (code here, line 453). Research is telling me that im accessing ineligible memory? (new to C++, experienced C#, so can code but memory management is a new area for me)

Not sure what im doing wrong? Board is the ESP-EYE, arduino framework in PlatformIO VSCode IDE. I know its the streamer creation because its printing "Accepting client", but not "Created streamer".

Thanks for any help!

Log below:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (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:1044
load:0x40078000,len:10044
load:0x40080400,len:5872
entry 0x400806ac
Soft AP Config Success
Mac ADDR: *******
[IP]
Setup Finished. Server Active at [ip]
Accepting client
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x400d4733  PS      : 0x00060430  A0      : 0x800d47d8  A1      : 0x3ffb1f20  
A2      : 0x00000000  A3      : 0x400857a0  A4      : 0x00000000  A5      : 0x00000008  
A6      : 0x00000004  A7      : 0x3ffcbd7c  A8      : 0x800d4730  A9      : 0x3ffb1f00  
A10     : 0x3ffc11b8  A11     : 0x00000038  A12     : 0x00000010  A13     : 0x0000ff00  
A14     : 0x00ff0000  A15     : 0xff000000  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000008  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffc

ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000

Backtrace: 0x400d4733:0x3ffb1f20 0x400d47d5:0x3ffb1f40 0x400d1c15:0x3ffb1f60 0x400d9f15:0x3ffb1fb0 0x40090989:0x3ffb1fd0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (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:1044
load:0x40078000,len:10044
load:0x40080400,len:5872
entry 0x400806ac
Soft AP Config Success
Mac ADDR: ******
[ip]
Setup Finished. Server Active at [ip]
DraconInteractive commented 4 years ago

Im seeing some evidence it may be the cam (it crashed on handle_jpg and handle_jpg_stream) as well, but not when I got '/' to just return a simple message. Will look into further. Might be an ESP-EYE issue

DraconInteractive commented 4 years ago

Okay, confirmed it was the camera! esp32config doesnt work for esp-eye. I used my pinout to make a new config, gonna put it here for anyone else that needs it.

camera_config_t espeyecam_config {

    .pin_pwdn = -1,
    .pin_reset = -1,

    .pin_xclk = 4,

    .pin_sscb_sda = 18,
    .pin_sscb_scl = 23,

    .pin_d7 = 36,
    .pin_d6 = 37,
    .pin_d5 = 38,
    .pin_d4 = 39,
    .pin_d3 = 35,
    .pin_d2 = 14,
    .pin_d1 = 13,
    .pin_d0 = 34,
    .pin_vsync = 5,
    .pin_href = 27,
    .pin_pclk = 25,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_0,
    .ledc_channel = LEDC_CHANNEL_0,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb
    .frame_size = FRAMESIZE_SVGA,
    .jpeg_quality = 12,               //0-63 lower numbers are higher quality
    .fb_count = 2 // if more than one i2s runs in continous mode.  Use only with jpeg
};
DraconInteractive commented 4 years ago

Worth noting that with its added PSRAM, esp-eye could probs use UXGA (I was using it earlier when using the esp_cam library). Gonna close the ticket now, hope this helps someone else!