Skip to content

Conversation

@oeiber
Copy link
Contributor

@oeiber oeiber commented Oct 4, 2025

No description provided.

Code refactoring for AlexxIT#1895
@AlexxIT
Copy link
Owner

AlexxIT commented Oct 5, 2025

Thanks!

@AlexxIT AlexxIT merged commit 6a67fc3 into AlexxIT:master Oct 5, 2025
@AlexxIT AlexxIT added this to the master milestone Oct 5, 2025
@oeiber
Copy link
Contributor Author

oeiber commented Oct 6, 2025

Sometimes it happens, that backchannel connection where not closed eniterly. After thant, no new backchannel connections where established.
Do you habe an idea, how to avoid this?

{
  "producers": [
    {
      "url": "rtsp://127.0.0.1:8554/spa01_video?video=all"
    },
    {
      "url": "doorbird:/xxx@xxx?media=audio"
    },
    {
      "id": 83159,
      "format_name": "doorbird",
      "protocol": "http",
      "url": "doorbird://xxx@xxx",
      "medias": [
        "audio, sendonly, PCMU/8000"
      ],
      "senders": [
        {
          "id": 83160,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 33058
        },
        {
          "id": 83161,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 33073
        },
        {
          "id": 83162,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 80350
        }
      ]
    }
  ],
  "consumers": []
}

image

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 7, 2025

This is definitely a bug. I don't know how to replicate it, so it's difficult to fix.

Doorbird nested from core.Connection:

type Client struct {
core.Connection
conn net.Conn
}

This struct has Stop() function and should call Close function for conn:

if closer, ok := c.Transport.(io.Closer); ok {
return closer.Close()
}

Probably in some cases this Stop is not called.

You can also call GET /api/stack for checking active goroutines.

@oeiber
Copy link
Contributor Author

oeiber commented Oct 7, 2025

Hi @AlexxIT,
thank you for your anwer!

Here's the /api/stack output:

goroutine 9 [IO wait, 28 minutes]:
internal/poll.runtime_pollWait(0x7ffec45f86a0, 0x72)
	runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x40000cad80?, 0x79e78?, 0x0)
	internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0x40000cad80)
	internal/poll/fd_unix.go:620 +0x24c
net.(*netFD).accept(0x40000cad80)
	net/fd_unix.go:172 +0x28
net.(*TCPListener).accept(0x40001d8ec0)
	net/tcpsock_posix.go:159 +0x28
net.(*TCPListener).Accept(0x40001d8ec0)
	net/tcpsock.go:372 +0x2c
github.com/pion/ice/v4.(*TCPMuxDefault).start(0x40001d8f80)
	github.com/pion/ice/[email protected]/tcp_mux.go:101 +0xe8
github.com/pion/ice/v4.NewTCPMuxDefault.func1()
	github.com/pion/ice/[email protected]/tcp_mux.go:92 +0x50
created by github.com/pion/ice/v4.NewTCPMuxDefault in goroutine 1
	github.com/pion/ice/[email protected]/tcp_mux.go:90 +0x1e8

goroutine 10 [IO wait, 2 minutes]:
internal/poll.runtime_pollWait(0x7ffec45f8588, 0x72)
	runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x40000cb180?, 0x4000146000?, 0x0)
	internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).ReadFromInet4(0x40000cb180, {0x4000146000, 0x2000, 0x2000}, 0x400008fce0)
	internal/poll/fd_unix.go:248 +0x1e8
net.(*netFD).readFromInet4(0x40000cb180, {0x4000146000?, 0x400008fce8?, 0x7a38c?}, 0x7ffec43b2e40?)
	net/fd_posix.go:66 +0x28
net.(*UDPConn).readFrom(0x4002a3ebd0?, {0x4000146000?, 0x0?, 0x4002a3ebd0?}, 0x4002a3ebd0)
	net/udpsock_posix.go:52 +0x13c
net.(*UDPConn).readFromUDP(0x4000060b98, {0x4000146000?, 0x33b2a8c0ffff0000?, 0xd400000000000000?}, 0x4000d16000?)
	net/udpsock.go:149 +0x2c
net.(*UDPConn).ReadFrom(0x4000060b98, {0x4000146000, 0x2000, 0x2000})
	net/udpsock.go:158 +0x4c
github.com/pion/ice/v4.(*UDPMuxDefault).connWorker(0x40000b04d0)
	github.com/pion/ice/[email protected]/udp_mux.go:293 +0xa0
created by github.com/pion/ice/v4.NewUDPMuxDefault in goroutine 1
	github.com/pion/ice/[email protected]/udp_mux.go:127 +0x360

goroutine 531072 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef810)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 25 [IO wait]:
internal/poll.runtime_pollWait(0x7ffec45f7ef8, 0x72)
	runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x4000288580?, 0x40002cc000?, 0x0)
	internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x4000288580, {0x40002cc000, 0x10000, 0x10000})
	internal/poll/fd_unix.go:165 +0x1fc
net.(*netFD).Read(0x4000288580, {0x40002cc000?, 0x0?, 0x0?})
	net/fd_posix.go:55 +0x28
net.(*conn).Read(0x40001b8008, {0x40002cc000?, 0x4000288580?, 0x83890?})
	net/net.go:189 +0x34
bufio.(*Reader).fill(0x4000118240)
	bufio/bufio.go:110 +0xf8
bufio.(*Reader).Peek(0x4000118240, 0x4)
	bufio/bufio.go:148 +0x60
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Handle(0x400029a380)
	github.com/AlexxIT/go2rtc/pkg/rtsp/conn.go:144 +0x21c
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Start(0x400029a380)
	github.com/AlexxIT/go2rtc/pkg/rtsp/producer.go:90 +0x58
github.com/AlexxIT/go2rtc/internal/streams.(*Producer).worker(0x40000b63f0, {0x9fa558?, 0x400029a380?}, 0x7)
	github.com/AlexxIT/go2rtc/internal/streams/producer.go:161 +0x34
created by github.com/AlexxIT/go2rtc/internal/streams.(*Producer).start in goroutine 23
	github.com/AlexxIT/go2rtc/internal/streams/producer.go:157 +0x1ac

goroutine 531100 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2700)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531097 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2460)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531065 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef500)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531091 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e21c0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 354 [chan receive]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40000bc3f0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 297
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531063 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef420)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531087 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2000)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531071 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef7a0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531075 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef9d0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531102 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2850)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531088 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2070)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531081 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efce0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531103 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e28c0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531076 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efa40)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531073 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef8f0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531067 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef5e0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531099 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2690)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531062 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef3b0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531105 [IO wait, 4 minutes]:
internal/poll.runtime_pollWait(0x7ffec42e01f0, 0x72)
	runtime/netpoll.go:351 +0xa0
internal/poll.(*pollDesc).wait(0x4000127580?, 0x4001bde6b0?, 0x0)
	internal/poll/fd_poll_runtime.go:84 +0x28
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0x4000127580, {0x4001bde6b0, 0x1, 0x1})
	internal/poll/fd_unix.go:165 +0x1fc
net.(*netFD).Read(0x4000127580, {0x4001bde6b0?, 0x88?, 0x40003bc008?})
	net/fd_posix.go:55 +0x28
net.(*conn).Read(0x4000060a98, {0x4001bde6b0?, 0x4000e0cf01?, 0x180b8?})
	net/net.go:189 +0x34
github.com/AlexxIT/go2rtc/pkg/doorbird.(*Client).Start(0x40001d6d20)
	github.com/AlexxIT/go2rtc/pkg/doorbird/backchannel.go:94 +0x7c
github.com/AlexxIT/go2rtc/internal/streams.(*Producer).worker(0x40000b6630, {0x9fa520?, 0x40001d6d20?}, 0x6d)
	github.com/AlexxIT/go2rtc/internal/streams/producer.go:161 +0x34
created by github.com/AlexxIT/go2rtc/internal/streams.(*Producer).reconnect in goroutine 530891
	github.com/AlexxIT/go2rtc/internal/streams/producer.go:242 +0x45c

goroutine 531066 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef570)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531058 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef1f0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531083 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efdc0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531084 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efe30)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531095 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2380)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531079 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efb90)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531077 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efab0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531078 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efb20)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531082 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efd50)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531070 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef730)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531104 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2930)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531060 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef2d0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531061 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef340)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531069 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef6c0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531101 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2770)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531089 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e20e0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531057 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef180)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531074 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef960)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531094 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2310)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531085 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efea0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531086 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024eff10)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531093 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e22a0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531092 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2230)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531068 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef650)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531090 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e2150)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531096 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e23f0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531059 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef260)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531080 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024efc70)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531064 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40024ef490)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

goroutine 531098 [chan receive, 4 minutes]:
github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start.func1(0x40017e24d0)
	github.com/AlexxIT/go2rtc/pkg/core/track.go:144 +0x50
created by github.com/AlexxIT/go2rtc/pkg/core.(*Sender).Start in goroutine 530891
	github.com/AlexxIT/go2rtc/pkg/core/track.go:143 +0x194

I think this could work to avoid this behaviour:

https://github.com/oeiber/go2rtc/blame/d5a73968cae8ce0072b3c38d309e9465bb52d7de/pkg/doorbird/backchannel.go#L90-L103

What do you think?

UPDATE:
Unfortunately this code did not change anything. But I had a version before integrating the audio mixer, which worked pretty fine. This code did also honor dorbird's http status codes:
https://github.com/oeiber/go2rtc/blob/56e61a85ee7be5c87e0313ec8e0dafc29a7c5d96/pkg/doorbird/backchannel.go#L1-L134

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 8, 2025

Singleton for source is a very bad idea. Your code support only one camera per go2rtc.
https://github.com/oeiber/go2rtc/blob/56e61a85ee7be5c87e0313ec8e0dafc29a7c5d96/pkg/doorbird/backchannel.go#L26-L28

I think the problem might have been in your version too. It's just that the connections weren't multiplying.

I think this is a global issue with go2rtc, not related to doorbird. It's that sometimes the backchannel doesn't close. It needs to figure out how to reliably reproduce this.

@AlexxIT
Copy link
Owner

AlexxIT commented Oct 21, 2025

@Bjoern3003
Copy link

It looks like, that I have the same Problem with my Doorbird connected to Frigate with the latest Version of go2RTC.

At this moment, the Ringtone sounds bad. He sounds choppy.

And he does not notify my FritzBox about the Keypress.

If I use the Camera in Frigate without 1-Way or 2-Way Audio, Everything is working well.

@oeiber Do you have solved the Problem? How did you have configured your Doorbell in go2rtc for 2-Way Audio?

@oeiber
Copy link
Contributor Author

oeiber commented Dec 3, 2025

It looks like, that I have the same Problem with my Doorbird connected to Frigate with the latest Version of go2RTC.

At this moment, the Ringtone sounds bad. He sounds choppy.

And he does not notify my FritzBox about the Keypress.

If I use the Camera in Frigate without 1-Way or 2-Way Audio, Everything is working well.

@oeiber Do you have solved the Problem? How did you have configured your Doorbell in go2rtc for 2-Way Audio?

Hi,
I just created a pr, which includes documentation for doorbird devices: #1966

@Bjoern3003
Copy link

Hi and thanks for adding Documentation, but Problem still exists.

@oeiber
Copy link
Contributor Author

oeiber commented Dec 4, 2025

Hi and thanks for adding Documentation, but Problem still exists.

Thats indeed a strange behaviour. Which model do you use? Does the problem also persist without the usage of frigate? In my setup I'm using go2rtc standalone in conjunction with homeassistant. My doorbird uses a webhook for motion and doorbell events. A HA automations starts recording a clip after a webhook was triggered. I can also see frame errors in my recordings after my doorbell initiates a sip call to my fritzbox. For my opinion this is related to the weak cpu inside my doorbird device.

@Bjoern3003
Copy link

Bjoern3003 commented Dec 5, 2025

Hi, i am using a d1100. The problem also exists, after disabling the connection to the fritzbox.

@Bjoern3003
Copy link

Bjoern3003 commented Dec 8, 2025

I am writing with Doorbird's technical support.

The last Answeer:

German:
Es ist in der Tat so, dass Frigate den Audiokanal belegt, wenn Sie 2 Wege-Audio aktivieren. Das führt dann auch dazu, dass keine SIP-Anrufe mehr rausgehen. Sie werden das gleiche Phänomen beobachten, wenn Sie in der DoorBird App versuchen, eine Audioverbindung herzustellen.
Um das ganze dennoch mit Audioaufzeichnung zu realisieren, müssten Sie also cleveres Timing verwenden, sodass Frigate bspw. bei einem Klingelevent am DoorBird, den Audiokanal für etwa 3 Minuten nicht mehr belegt. Die Signalisierung des Klingelsignals könnte über einen HTTP-Request erfolgen.

Translated in English:
It is indeed the case that Frigate occupies the audio channel when you activate two-way audio. This also prevents outgoing SIP calls. You will observe the same phenomenon when you try to establish an audio connection in the DoorBird app.

To still achieve audio recording, you would need to use clever timing so that, for example, Frigate does not occupy the audio channel for about 3 minutes after a doorbell ring at the DoorBird. The doorbell signal could be transmitted via an HTTP request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants