[Synology DSM] Camera stream not working

Hi2UAll!

Integration: new Synology DSM Integration (replacing Synology Camera Integration because it will be deprecated in 0.118.0)
Config: by HA Integrations
UI Card: Picture Glance
Problem: No stream visible
Home Assistant version: 0.116.2
EDIT 20201013, System Health:

arch armv7l
chassis embedded
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.13
installation_type Home Assistant OS
os_name Linux
os_version 4.19.127-v7
python_version 3.8.5
supervisor 247
timezone Europe/Amsterdam
version 0.116.2
virtualenv false

Lovelace

dashboards 6
mode storage
resources 0
views 8

It seems the Synology DSM has issues to get the the stream (for example, when activating a tap_action):
image

Any suggestions?

1 Like

I checked the Logs and it look like the stream is directed to the wrong RTSP IP-address

My Synology RS has multiple network connections:
Network connection 1 (LAN1) - connected to my ISP-router/modem, used for internet connection.
Network connection 2 (LAN2) - connected to my IoT/Home domotica LAN

It should use an IP from LAN2 instead of LAN1 but it uses an IP of the LAN1 IP. In Surveillance Station the network is configured in System --> Network --> LAN2 --> Edit is set as default gateway.
Also the service order is set to LAN 2, LAN 1.

When checking an IP camera --> Share Stream Path it is showing the LAN1 IP-address.

So, it looks to me, it is Synology Surveillance Station/DSM related and not HA…

EDIT: Confirmed working in HA when opening firewall on LAN1 for access of rtsp stream (for testing reasons only).

Any suggestion how a proper setup should looks like or a way to get the rtsp-address changed?

FYI, I noticed when changing the Edit Camera --> Live View Settings --> Stream settings --> Live view to low bandwidth (selecting the cam’s second, stream 2, lower resolution) the HA stream resolution can be altered.

Looks to me the HA integration uses the Surveillance Station Live View setting for the stream.

Also noticed a HA 401 Unauthorized error will be generated when a Camera in Surveillance Station is Disabled.

I see this same behavior. I have 4 built in NICs and 2 10Gb via add-in card. I use 1 of the 1Gbps built in NICs for a direct connect to a backup NAS and the RTSP stream tries to use this instead of the correct 10Gbps NIC thats connected to the main network. Disabling the 1Gbps NIC let’s it switch to the right NIC but I need that one back on and no setting changes in DSM seem to make a difference.

For some reason the HA integration is not using the configured IP address and is instead gathering the IP from DSM somehow and choosing the wrong one (first found?) when multiple are present.

In my case, it looks like, the HA integration is getting the IP-address reported from the Synology Surveillance Station IP Camera it’s RTSP Stream Path.

I have no clue how this can be changed/altered in Synology’s Surveillance Station…

For the time-being I have made a dedicated exception in my Synology NAS firewall and it is working.

Interesting, I’m getting a 401 for normal cameras as well. Used to work great before. I do see the image preview, but when I try to open the stream I get a 401. I can login to Surveilance Station and watch them just fine. Any idea what might be wrong here?

I can confirm the same error message.


Logger: libav.rtsp
Source: components/stream/worker.py:71 
First occurred: 22:28:30 (2 occurrences) 
Last logged: 22:28:30
method DESCRIBE failed: 401 Unauthorized

If you restart the integration of Synology DSM in HA, the problem is temporarily resolved and you can use the stream from the cameras. However, this doesn’t work for long and the problem occurs again. I think the problem is in HA.

1 Like

Same problem here in 0.117

Anyone found a workaround for this? It’s producing 10 errors per hour or so.

Hi - me too

Its riddled with bugs to the point its crashing my server I have now removed it as an integration. Preformatted text

Logger: homeassistant.config_entries
Source: config_entries.py:247
First occurred: 22 November 2020, 17:46:07 (2541 occurrences)
Last logged: 11:17:19

Config entry for synology_dsm not ready yet. Retrying in 5 seconds
Config entry for synology_dsm not ready yet. Retrying in 10 seconds
Config entry for synology_dsm not ready yet. Retrying in 20 seconds
Config entry for synology_dsm not ready yet. Retrying in 40 seconds
Config entry for synology_dsm not ready yet. Retrying in 80 seconds

For example my Synology log has 5 connections to the server at the same time and I mean to the second

Good News: I removed the Integration as mentioned and added it manually. Currently I just see 2 logins and will monitor it for next few hours to see what happens. I did also need to reboot the Synology first as it was almost useless.

UPDATE: Once again it lost all camera entities they come in and out as though the entire integration fails and removes all the related entities (40). Again it took out my Synology server and this was after I disabled Deep sleep and HDD hibernation time set to [none]. This made no difference. Strangely I removed the manual from configuration.yaml, restarted the server and it was still in the Integrations so I have now removed it as once again it started generating errors in both Hassio log and Synology log. In the Synology log it just has thousands of "logged in successfully via [DSM].

I manually put the deprecated Synology integration back in configuration.yaml, which still works fine. Has proved to be stable for the past year or so. Will stick to this, while it’s still working, until the official DSM integration is fixed.

Hello,
Same issues with official DSM integration.
Deprecated integration works with 118.X versions ?
With manual integration you can’t use 2 factor authentification ?

Seems 2FA is not possible with the deprecated version. On the other hand, you can use SSL and your Synology user doesn’t have to have admin rights.

I have created a separate user with admin rights in synology. Unfortunately, the error messages mentioned keep coming back. Is there no solution?

I can confirm that for me the I also often get plenty of errors in the logs when trying to view live streams of the camera’s.

Check out this issue on Github: https://github.com/home-assistant/core/issues/43080

The answer from Nick Adams works for me (https://github.com/home-assistant/core/issues/43080#issuecomment-729348912). "Surveillance Station > IP Camera > Right click on a camera > Share Stream Path

One of the settings in there is to set how long this link should be valid for - 1 hour or forever. I had assumed that these links were generated when you click save and the validity period was specific for that URL however it looks as though the validity period is for all streams - including those generated by the API."

EDIT: Also, I am using the Synology integration!

@quizzical, to be clear you are getting the same errors as shown in [Synology DSM] Camera stream not working ?

For the record, I just reloaded the Synology DSM integration from the Integrations page. For me it was not necessary to restart my whole HA instance. After ± 1 hour my streams were not working, hence I checked the log files and saw the errors/notices shown in the reaction by Maverick. When I simply reloaded the integration the streams worked again. With the “valid lifespan” fix, there have not been any errors nor have the streams stopped working. Hope this info helps.

Thank you! That makes a lot of sense and so far I’m able to replicate your results. The camera that I had set to forever yesterday is still working. I’ve set the other ones to forever as well now and have only reloaded the integration.
I does still faill sometimes, here is an error I still get:

Logger: frontend.js.latest.202012120
Source: components/system_log/__init__.py:193
First occurred: 10:00:31 (1 occurrences)
Last logged: 10:00:31

https://MYURL/frontend_latest/chunk.a01fc49cb6fa229a7d98.js:2:145490 Uncaught InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.

It can also often take 20 seconds to load the camera stream, as a result when the livestream loads it has a strong delay.

Offtopic: do you know how I can open the livestream directly, without having to click the still picture? I want to create an actionable notification for my smartphone (when I deteced motion while the house is supposed to be empty) and if I click on it, it should redirect me to the livestream.