Skip to content
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 not working in Frigate Card #184

Open
Daz42 opened this issue Feb 5, 2024 · 21 comments
Open

2 Way Audio not working in Frigate Card #184

Daz42 opened this issue Feb 5, 2024 · 21 comments
Labels
bug Something isn't working

Comments

@Daz42
Copy link

Daz42 commented Feb 5, 2024

What happened?

Not an issue with the Hikvision Camera Integration - however I was unable to consistently get 2 way audio from the Frigate card for the Hikvision Camera Integration. This is an issue being dealt with but in the meantime we are using the web-rtc card which works but slightly clunky.

Add-on

Hikvision Doorbell

What version of the add-on are you running?

3.0.14

Installation type

Home Assistant add-on

Relevant log output

No response

Relevant configuration

No response

Anything else?

No response

@Daz42 Daz42 added the bug Something isn't working label Feb 5, 2024
@Daz42
Copy link
Author

Daz42 commented Feb 5, 2024

I would like to add a guide for those wanting to get their Hikvision doorbell working with the web-rtc card complete with mp3 playback. Eventually it will be updated for the Frigate card when 2 way audio is resolved with it.
Home Assistant Hikvision Doorbell (for web) As-Built v1.0.docx

@pergolafabio
Copy link
Owner

Great guide , not sure if I need to combine it or not... Gonna wait for the frigate updates first, because that card is nicer indeed... Also next update doesn't require frigate add-on/integration...

Just question, why do you have the camera defined 2 times in go2rtc , why not use the first one for the mp3 also?

@Daz42
Copy link
Author

Daz42 commented Feb 5, 2024

I tried using the first one but could not get the mp3 to play for the life of me. When I defined it again but with channel 102 it works reliably every time. Also another weirdness, when I update webrtc-camera to version 3.5.1 then I start having issues with mp3 playback and intermittent 2 way audio. I'm on master which is working but obviously should move on once I find out why it's playing up!

@TokarevSergey
Copy link

You managed to solve the problem. I have a Hikvision camera and doorbell. The problem was this. At first there was sometimes intermittent two-way communication. And now when I press the microphone, the sound disappears.

@pergolafabio
Copy link
Owner

ok, found the issue!!

dermotduffy/frigate-hass-card#1356
fixed in this:
AlexxIT/go2rtc#967
AlexxIT/go2rtc#962

The issue that two way audio isnt working the second time, is that the "close" command is not being used in the go2rtc addon, it will be implemlented later!!

for now i send the command below, right after you do the answer/hangup and before pressing the mic button, this makes the previous twoway audio close first...

"curl -i --digest -u admin:XXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

I keep this one open, untill a new go2rtc addon is released!!

@TokarevSergey
Copy link

Thank you

@pergolafabio
Copy link
Owner

update 1.9.0 is released, but seems the issue is still present, i still send the curl , before i start two way audio

@TokarevSergey
Copy link

Thank you. I'm really looking forward to the fix.

@pergolafabio
Copy link
Owner

Same, but the curl is working great!!

@TokarevSergey
Copy link

ок, нашел проблему!!

dermotduffy/frigate-hass-card#1356 исправлено здесь: AlexxIT/go2rtc#967 AlexxIT/go2rtc#962

Проблема, из-за которой двусторонняя аудиосвязь не работает во второй раз, заключается в том, что команда «закрыть» не используется в аддоне go2rtc, она будет реализована позже!

на данный момент я отправляю команду ниже, сразу после того, как вы ответите/повесите трубку и перед нажатием кнопки микрофона, это сначала закроет предыдущую двустороннюю аудиосвязь...

"curl -i --digest -u admin:XXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

Я оставляю этот вопрос открытым, пока не выйдет новый аддон go2rtc!!

Добрый вечер не могу заставить это работать.
У вас получилось.
Я делаю в файле configuration.yaml запись
shell_command:
doorbelltvaoff: curl -i --digest -u admin:ST008855h PUT http://10.0.0.11/ISAPI/System/TwoWayAudio/channels/1/close
и запускаю ее с помошью скрипта звук вске равно прерывистый. Подскажите может я чтото не так понял.

@pergolafabio
Copy link
Owner

I do this in the frigate card for my "phone/answer" button:

            - type: custom:frigate-card-menu-icon
              icon: mdi:phone
              tap_action:
                - action: call-service
                  service: script.answer_call
                - action: custom:frigate-card-action
                  frigate_card_action: unmute
                - action: custom:frigate-card-action
                  frigate_card_action: microphone_unmute

First i do the script, to make my answer+hangup+close audio
Then i do the frigate unmute functions for mic/audio

This is my script:

answer_call:
  alias: Deur open answer call
  sequence:
  - service: button.press
    entity_id: button.ds_kh9510_answer_call
  - delay: 
      milliseconds: 500
  - service: button.press
    entity_id: button.ds_kh9510_hangup_call
  - service: shell_command.hikvision_close_audio

and my shell command is:

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

@TokarevSergey
Copy link

TokarevSergey commented May 21, 2024

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

hikvision_close_audio: "curl -i --digest -u admin:XXXXX -X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"
A space was missing before -X, is this correct?

@pergolafabio
Copy link
Owner

correct

@TokarevSergey
Copy link

TokarevSergey commented May 21, 2024

правильный

Damn, nothing works. All the same, the sound gets quieter and then starts to break up if I log in several times and go to the card with a microphone.

type: custom:webrtc-camera
url: DoorBellCh2
mode: webrtc
media: video, audio, microphone
muted: false
style: 'video {aspect-ratio: 16/9; object-fit: fill;}'

Only reloading the Go2rtc configuration helps

@TokarevSergey
Copy link

TokarevSergey commented May 21, 2024

I do this in the frigate card for my "phone/answer" button:

            - type: custom:frigate-card-menu-icon
              icon: mdi:phone
              tap_action:
                - action: call-service
                  service: script.answer_call
                - action: custom:frigate-card-action
                  frigate_card_action: unmute
                - action: custom:frigate-card-action
                  frigate_card_action: microphone_unmute

First i do the script, to make my answer+hangup+close audio Then i do the frigate unmute functions for mic/audio

This is my script:

answer_call:
  alias: Deur open answer call
  sequence:
  - service: button.press
    entity_id: button.ds_kh9510_answer_call
  - delay: 
      milliseconds: 500
  - service: button.press
    entity_id: button.ds_kh9510_hangup_call
  - service: shell_command.hikvision_close_audio

and my shell command is:

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

So how is everything right?
hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

hikvision_close_audio: "curl -i --digest -u admin:XXXXX -X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

@pergolafabio
Copy link
Owner

yeah thats why i do

@TokarevSergey
Copy link

TokarevSergey commented May 21, 2024

admin:XXXXX-X PUT

admin:XXXXX-X PUT
admin:XXXXX -X PUT

@michalwu
Copy link

Hi
Anything new in this case? Can anyone share working config?

@pergolafabio
Copy link
Owner

it works, but if you answer the doorbell 2 times when not refreshing the card, i dont have audio, you can send the close command i posted earlier

i saw new updates on the card, didnt try yet, maybe its better now

@michalwu
Copy link

Thanks for letting me know.
Then my DS-KV8113-WME1 B is special. Microphone is not working from PC/phone HASS (i.e. I do not hear anything on doorbell).
Can you suggest what to check?

frigate.yml:

`
mqtt:
enabled: true
host: 10.0.1.5
user: usermqtt
password: xxx

cameras:
Doorbell:
ffmpeg:
inputs:
- path: rtsp://admin:[email protected]:554/Streaming/Channels/101

detect:
enabled: False
width: 1920
height: 1080
motion:
enabled: False
record:
enabled: False

go2rtc:
streams:
Doorbell:
- rtsp://admin:[email protected]:554/Streaming/Channels/101
- isapi://admin:[email protected]:80/
api:
username: user
password: xxx
version: 0.14
`

and streams info from go2rtc:

{
"producers": [
{
"type": "RTSP active producer",
"url": "rtsp://10.0.2.15:554/Streaming/Channels/101/",
"remote_addr": "10.0.2.15:554",
"user_agent": "go2rtc/1.9.2",
"sdp": "v=0\r\no=- 1734100537950584 1734100537950584 IN IP4 10.0.2.15\r\ns=Media Presentation\r\ne=NONE\r\nb=AS:5100\r\nt=0 0\r\na=control:rtsp://10.0.2.15:554/Streaming/Channels/101/\r\nm=video 0 RTP/AVP 96\r\nb=AS:5000\r\na=control:rtsp://10.0.2.15:554/Streaming/Channels/101/trackID=1\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=\r\nm=audio 0 RTP/AVP 0\r\nb=AS:50\r\na=control:rtsp://10.0.2.15:554/Streaming/Channels/101/trackID=2\r\na=rtpmap:0 PCMU/8000\r\na=Media_header:MEDIAINFO=494D4B48010100000400010010710110401F0000000;\r\na=appversion:1.0\r\n",
"medias": [
"video, recvonly, H264",
"audio, recvonly, PCMU/8000"
],
"receivers": [
"96 H264, bytes=30521854, senders=1",
"0 PCMU/8000, bytes=526720, senders=1"
],
"recv": 31350944
},
{
"type": "ISAPI active consumer",
"medias": [
"audio, sendonly, PCMU/8000"
],
"senders": [
"0 PCMU/8000, bytes=0, receivers=1"
]
}
],
"consumers": [
{
"type": "WebRTC/WebSocket async passive consumer",
"remote_addr": "tcp4 prflx 10.0.1.52:54684 related :0",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0",
"medias": [
"video, sendonly, VP8, VP9, H264",
"audio, recvonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000",
"audio, sendonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000, L16, PCML"
],
"receivers": [
"0 PCMU/8000, bytes=0, senders=53"
],
"senders": [
"126 H264, bytes=30521854, receivers=1",
"0 PCMU/8000, bytes=526720, receivers=1"
],
"send": 31317100
}
]
}

@pergolafabio
Copy link
Owner

sorry, no idea, for mic to work, you need https with valid ssl, mauybe thats the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants