-
Notifications
You must be signed in to change notification settings - Fork 819
Fix doorbird backchannel audio #1794
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
Conversation
oeiber
commented
Jul 3, 2025
- proper session handling
- honor http status codes
- prevent device from being flooded by limiting concurrent audio channels
- proper session handling - honor http status codes - prevent device from being flooded by limiting concurrent audio channels
cleanup files
…backchannel audio streams are connected
|
@AlexxIT audio mixing would be nice for all 2-way audio sources. It would improve 2-way audio reliability and allow for more advanced use cases like keeping some ambient music playing in camera, while still being able to speak to camera. Or mixing TTS announcements, Assist, and what not. What do you think? I can raise a separate issue for it. |
|
Audio mixing will work only for PCM-like formats. Not very universal. |
|
Is something still open here because it was not merged with version 1.9.10? |
|
I released the update quickly. There was no time to review this PR. |
|
A lot of work has been done here. But it's very much out of the go2rtc architecture.
This code may work. And it works well. But when go2rtc needs to be improved, this part could become a major problem. |
Do you have any constructive suggestions on how to tackle the problems to meet the 'overall logic'? |
|
Does the device work with the current release code? If only one WebRTC client is open at a time. |
|
No, it doesn't. Device is getting flooded with audio packets. |
|
Does this happen even with a single two-way client? I see your code primarily fix the issue of multiple clients. |
|
Yes, it happens also with a single client. |
|
This code may not work: go2rtc/pkg/doorbird/backchannel.go Lines 90 to 93 in 2b5f942
It is assumed that Start holds the connection. For the producer, it's simple. The Start receives the data. In the case of backchannel, Start only needs to maintain the connection. Maybe send pings, as you do. Maybe it needs to repeat this code: Lines 130 to 132 in 2b5f942
|
|
I can give it a try. But there's still the question how to handle multiple baxkchannel sessions. |
|
If there is only one line in the config, there will be only one session. Go2rtc simply won't let you run yet another. It's built into the core. But if you open multiple browsers, they may compete for the right to send their data to the same session. This issue hasn't been debugged in go2rtc. |
Hi @AlexxIT, seems it is working with the few lines of code adopted into the Client function! |
|
It would be great if you could debug your camera and make another PR. It's hard for me to do this because I don't have this camera. Your code from this PR may be useful when it becomes possible to make a centralized mixer for multiple clients of the same backchannel. |
|
Here we go :-) #1895 |