-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2-way audio does not work with certain Hikvision cameras #1356
Comments
Just to add to the above (I've been working with @pergolafabio, I have a Hikvision Doorbell and Internal Intercom. I am using the Frigate add-on, Frigate Integration and Hass card to use the camera, speaker and microphone from the Hikvision Doorbell. When using this all through the Frigate Hass card, it all initially works well and I get 2 way audio. However, when I take the following steps things go wrong:
I'm happy to do any testing. |
Correct.
Unless you use the
So it all works fine, until to call an unrelated service and then the microphone unmute doesn't work anymore? How are you calling the unrelated service? Can you provide your full card config? Thank you! |
Hey , thnx for feedback already, appreciate it! Below full config As you can see, i have extra 2 buttons ( see also screenshot) a phone / hangup button But i also see this new PF : #1359 But anyway, back to issue, you are talking about always_connected , i tried it with true/false, but ddint make any difference... But i wasnt aware of the disconnect_seconds!! I was always testing making calls after each other, within the 60 seconds What is the best approach for this? probably setting this back to "false" , so that means, on incoming call, if i wait longer then 60 seconds for next call , it should work? What happens if the stream is active? I mean if the lovelave card is active? Does it trigger the 60 sec disconnected? Or does it only disconnect if i browse away from the page? That being said, maybe that new PR could be helpfull with the automation? Can i define for example, if press the hangup button or if i toggle again the mic button, that i force the disconnect? But whats still strange, i dont know if the disonnect_seconds will solve it... When the issue occured, i could toggle the mic button as many times if i want, it never worked again sending two way audio, untill i did a refresh of the lovelace card...
|
For quick testing, i changed my card to this setting:
Indeed after 15 sec, the mic is disconnected, i can turn on mic and speak again, so that setting is working However , my issue is still present, if i have a real call coming in, i drop the doorbell sound, but then i enable mic, but i cant speak... if i then wait 15 sec, the mic is off, i turn it on again, i still cant speak The only solution, is to browse away from the lovelace card or a a refresh of the page, then i can speak again There must be something different in refreshing the page and the disconnect feature, i think the dsconnect feature doesnt disconnect enough? Whats the difference between your disconnect feature and refreshing the page? |
@pergolafabio maybe you should try again with #1362. |
Worth a shot, I will try later indeed! |
Tried the new dev , but still doesnt work as expected for me :-) |
hey @dermotduffy , any thing i can test or do ? thnx |
Sorry, as I don't these cameras, I have no way to test and I'm not sure what is going on or what else to suggest I'm afraid. There are a few other 2-way audio related issues in the backlog that I will look into that could impact this, so I'll leave this issue open in case they help / in case someone else manages to make some progress to figure out what's going on. |
Ok, no problem |
Sounds like a great plan. Thanks. |
Thnx! If you want, I can give you access to my intercom, so you can test it remote |
hey @dermotduffy were you able to have a look at this issue again? |
is it maybe related to this issue? maybe the connection is indeed still open, and only works again after a new hard refresh of the page? |
Maybe this will fix this issue: AlexxIT/go2rtc#967 |
Aha, that's interesting!! I keep an eye on it, that could be it indeed |
@felipecrs , thnx for pointing that issue, it fixes the issue, seems indeed related to go2rtc , and indeed a fix is underway thxn for all help |
I would suggest you mention you tried the fix in go2rtc repo, so that the owner can be more confident to merge it. |
hmm, he didnt create an addon repo, not sure how i can test a specifc PR , since its not merged yet in alex master |
Hey @dermotduffy , i did some digging and traced it with wireshark Is there a way/service to restart the stream with your card? That could solve the issue thnx |
@pergolafabio does not go2rtc 1.9.0 solves the issue? |
Yes and no, toggling the mic button on frigate, doesn't start a new stream session, I wiresharked this Webrtc card does it, not frigate card |
Hey @dermotduffy You said: Well, that's exactly the issue, that's why I only hear two way audio the first time I use the card :-) This is very specific for Hikvision, in normal circumstances , it's not an issue , I can toggle the mic button as many times I want, I always have two way audio.. but this device is also an intercom... So when someone is making an intercom event by ringing the device, the two way audio is initiated to another client... That's why the audio is closed on the frigate card.. in order to get audio back, I need to restart the stream, that will send an isapi command (close audio) to the camera, that command is now included in the go2rtc addon since 1.9.0 |
Just to chime-in as a non-doorbell Hikvision camera user: It is important to me that functionality not change when "always-connected" is enabled. More specifically that the mute button does not close/restart the stream. We use this camera as door intercom and often have some back-and forth with whoever is there. Muting/Unmuting multiple times is typical. Using AlexxxIT's WebRTC card restarts the stream on every mute/unmute. The Muting/Unmuting process is slow on the camera-end and this quickly breaks things. The ISAPI interface cannot keep up. What I would propose is an alternate button for enable/disable mic (via stopping/starting ISAPI stream) as opposed to mute/unmute which simply mutes the client-side mic, which is instantaneous and expected behavior for any audio client/server setup. |
As additional thought: Being "always-connected" should really already be the default behavior. If there is a microphone configured, the expectation is that use of that microphone should be instantaneous. Tearing down/re-building the stream is going to cause a noticeable lag. This is particularly evident when using this remotely on a mobile device...it just doesn't work. As long as there is an "always-connected" option, the solution will work for our use case, but it took a couple month's worth of headaches before I was lucky enough that @dermotduffy gave me a heads up in another thread. Anyone newly trying this out and lacking the skills to do tcpdumps and review them via wireshark will likely find the solution unworkable. Food for thought. |
This triggers the browser to think the microphone is in use, and on Android this means also highlighting the status bar item. For example, I only use microphone 0.01% of the times I open my dashboard, so IMO it should not be made the default. Instead, maybe investing time into somehow making attaching the microphone to an existing stream session on the fly would be a better replacement for |
@felipecrs: This is what @dermotduffy was discussing earlier. This is not possible. Nor is it correct from a development perspective. If the microphone is set to "enabled" in the config, it should be enabled. In this context that explicitly means "always-connected". Otherwise the "mute" button should be changed to "Disabled/Enabled". It is no longer a mute button. If you personally only use the microphone rarely, then that by definition is an edge case and should carry the edge-case configuration requirement vs the expectation that if microphone is set to "enabled" that it is enabled and will remain enabled until explicitly set as "disabled", and the mute button actually means "mute" the same as how a mute button works on a phone, stereo, or any other audio device. On your stereo, when you hit mute, the music keeps playing...but it just stops coming out of the speakers. When you hit mute on your phone, it does not disconnect the call...it simply prevents audio from being transmitted. The configuration you are recommending is that every time someone hits "mute" the phone hangs up and a new phone call needs to be made when the user wants to speak again. It might happen much faster here...especially if you are on the same network...but tearing down and rebuilding the connection on every press of the mute button just doesn't make sense. With the current setup the expected behavior is obfuscated. The microphone is sluggish, like a child's walkie-talkie, and the connection becomes unusable regularly without any explanation...because the mute button is causing the connection to be torn-down/re-built on every press. Whereas if "always-connected" was the default, then you might have a microphone enabled on your desktop but you at least have an indicator of what is going on and can then look for the setting to change...and can then enable/disable the microphone entirely as you wish. There is a value to have a new/special button to enable/disable the microphone entirely...but it should not be the mute button. |
I should also note that tear-down/re-connection also means the video channel. They are coupled. In no context does anyone expect that hitting "mute" means restarting the video. |
Thanks, I'm sold. |
I have the same camera. Didn’t try the frigate card yet but in the go2rtc webrtc card I have some issue also. In this card it is recommended to do a second stream with mic and a first stream without it if you want to enable/disable your mic. |
I am using a Hikvision doorbell exclusively through the Frigate Card for a month by now already. The setup is pretty much the same I have in: https://github.com/felipecrs/dahua-vto-on-home-assistant It works flawlessly. |
For me I still need to send the "close audio" command if I unmute the second time.... But the issue is only present on a real incoming call, to another indoor station, seems the audio channel is then probably occupied... I still need somekind of hard refresh on the card, like the webrtc card does |
I have the same issue with the frigate-card. First session is always working. If I mute the mic on the client with which the first session was started, the browser tab still shows that the mic is in use for a few minutes. As long as the mic status icon is shown on this client, I can't use the mic on another client. If using the UI of frigate HA addon and triggering the mic there, I can see how the whole streams reloads (within a few ms) and really disconnects. Is there a possibility to implement such a feature, or is it maybe already implemented? Just an action which can be triggered when pressing a button, which reloads the stream and thus also ends the 2-way-audio session. |
There has been a |
Checklist:
Release with the issue:
Specific PR release: #1291
But it also happens with 5.2.0 and Frigate addon
Last working release (if known): Unknown
Browser and Operating System:
This happens on all browsers mac/chrome/companion app
Description of problem:
Using the config below, two way audio works, toggling the MIC button on/off again, always stops/starts the two way audio...
But the camera is also a doorbell, when a call is received, we need to first mute the call, by sending a service to it, to make the ringing sound stop, afterwards we press the mic button to start talking... so far so good.. Then i press the mic button to stop the audio, this also works... Next on the second call, we do the same thing, we send the service to the doorbell to stop the ringing, but the when we press the MIC button, the two way audio isnt initiated... this is my issue
What we need todo, is to refresh the page where the frigate card is located, after the refresh, when we then press again the MIC button, it seems to work....
I dont know why, or whats the cause, or why i need to refresh the page?
frigate card config:
go2rtc config:
I also checked the go2rtc addon logs, no isses there... so not sure if its go2rtc or frigate card related, difficult to tell..
What is happening on a refresh of the view? whats different between a refresh of the view and toggling the mic button?
What i also see, when you do a refresh of the page, the mic button is not immediately visible, it takes a second, and then its there... Is there maybe a way to force that refresh? That could maybe solve my issue, alltough still dont know the root cause...
Edit:
My guess, go2rtc is using ISAPI to use two way audio on hikvision camera's, I think the audio session is not closed when pressing the mute button? When refreshing the page it starts a new two way audio session? The audio session is always open, regardless the mic button is muted or not??
That way, on an incoming call the audio session is closed, bur frigate thinks it's still open?
The text was updated successfully, but these errors were encountered: