maximkulkin / esp32-homekit-camera

Firmware for esp32-camera module to act as Apple Homekit IP camera
MIT License
394 stars 78 forks source link

Fix live stream stopping #84

Closed florianrehm closed 3 years ago

florianrehm commented 3 years ago

Fix live stream stopping after some seconds due to missing rtcp sender report

maximkulkin commented 3 years ago

Hi Florian. I appreciate you root causing the issue, however the fix is not what we want. It makes RTCP sender report being sent on every frame, which is way too often. I think proper fix would be to store timestamp of next RTCP sender report (timestamp of last sender report + sender report interval) and sending it whenever we exceed that timestamp.

florianrehm commented 3 years ago

Hi, I agree with your statement. I will invest some more time to figure out the expected interval from mediaserverd and update the pull request.

florianrehm commented 3 years ago

Please have a look at the updated pull request.

okanduzyel commented 3 years ago

HomeKit: [Client 57] Resource �[0;32mI (505795) esp32_camera: Resource payload: {"image-width":640,"image-height":480,"resource-type":"image"}�[0m �[0;31mE (505815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m �[0;31mE (505815) task_wdt: - IDLE1 (CPU 1)�[0m �[0;31mE (505815) task_wdt: Tasks currently running:�[0m �[0;31mE (505815) task_wdt: CPU 0: tiT�[0m �[0;31mE (505815) task_wdt: CPU 1: Camera Stream�[0m �[0;31mE (505815) task_wdt: Print CPU 0 (current core) backtrace�[0m

This code triggers WDT. Which value do you prefer? and how can I change it?

I totally closed the WTD and yes. It looks memory problem. After starting the stream, somewhere, I don't know where memory ran out after a while. Maybe, in session, there is a problem like n+1 for every frame. It closes itself 1-2 minutes (sometimes takes around 5 minutes) later and then, stream never starts again.