{"record":{"id":"59e4b702dd43e99a","repo":"AlexxIT/go2rtc","slug":"wyze-failed-to-enable-intercom-w","errorCode":null,"errorMessage":"wyze: failed to enable intercom: %w","messagePattern":"wyze: failed to enable intercom: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/backchannel.go","lineNumber":14,"sourceCode":"package wyze\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/AlexxIT/go2rtc/pkg/aac\"\n\t\"github.com/AlexxIT/go2rtc/pkg/core\"\n\t\"github.com/AlexxIT/go2rtc/pkg/tutk\"\n\t\"github.com/pion/rtp\"\n)\n\nfunc (p *Producer) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error {\n\tif err := p.client.StartIntercom(); err != nil {\n\t\treturn fmt.Errorf(\"wyze: failed to enable intercom: %w\", err)\n\t}\n\n\t// Get the camera's audio codec info (what it sent us = what it accepts)\n\ttutkCodec, sampleRate, channels := p.client.GetBackchannelCodec()\n\tif tutkCodec == 0 {\n\t\treturn fmt.Errorf(\"wyze: no audio codec detected from camera\")\n\t}\n\n\tif p.client.verbose {\n\t\tfmt.Printf(\"[Wyze] Intercom enabled, using codec=0x%04x rate=%d ch=%d\\n\", tutkCodec, sampleRate, channels)\n\t}\n\n\tsender := core.NewSender(media, track.Codec)\n\n\t// Track our own timestamp - camera expects timestamps starting from 0\n\t// and incrementing by frame duration in microseconds\n\tvar timestamp uint32 = 0\n\tsamplesPerFrame := tutk.GetSamplesPerFrame(tutkCodec)","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/backchannel.go#L1-L32","documentation":"Returned by the Wyze Producer's AddTrack when setting up the backchannel (two-way audio). Before negotiating tracks it calls client.StartIntercom() to switch the camera into intercom (talk-back) mode; any failure there is wrapped with this message. Without intercom mode the camera will not accept upstream audio.","triggerScenarios":"Publishing a backchannel audio track to a Wyze camera stream when StartIntercom() fails: camera firmware rejects the intercom command, TUTK session is not fully established, camera is busy/streaming elsewhere, or the device does not support two-way audio.","commonSituations":"Older Wyze firmware without intercom support on the given model; camera already in a live view/talk session that blocks the mode switch; unstable network causing the TUTK control command to time out; using a camera model that only supports one-way audio.","solutions":["Log the wrapped inner error from StartIntercom() to see timeout vs rejection","Update the camera firmware — some models only support intercom on newer versions","Close other active streams/apps viewing the camera before retrying, then reconnect","Confirm the camera model supports two-way audio (talk) in the Wyze app","Retry the connection; transient TUTK command failures often clear on a fresh session"],"exampleFix":"// before\n// starting backchannel on a one-way-audio camera model\nerr := producer.AddTrack(media, codec, track) // fails: intercom unsupported\n// after\nif !supportsTwoWayAudio(cameraModel) {\n    return errors.New(\"camera model does not support backchannel audio\")\n}\nerr := producer.AddTrack(media, codec, track)","handlingStrategy":"try-catch","validationCode":"// Go: only attempt backchannel on known two-way-audio models\nif !supportsTwoWayAudio(cameraModel) {\n    return errors.New(\"model does not support intercom/backchannel\")\n}","typeGuard":"func backchannelSupported(model string) bool { return twoWayAudioModels[model] }","tryCatchPattern":"if err := producer.AddTrack(media, codec, track); err != nil {\n    if strings.Contains(err.Error(), \"failed to enable intercom\") {\n        log.Warn(\"intercom rejected — retry after closing other streams\")\n    }\n    return err\n}","preventionTips":["Update Wyze camera firmware before enabling backchannel","Close other viewers/talk sessions before connecting","Verify two-way audio works in the Wyze app first","Retry on transient TUTK command timeouts"],"tags":["wyze","backchannel","intercom","audio"],"backgroundTag":"unsupported-operation","analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}