[{"data":1,"prerenderedAt":798},["ShallowReactive",2],{"page-/blog/21":3},{"id":4,"title":5,"body":6,"created":780,"description":781,"extension":782,"image":783,"meta":784,"navigation":785,"path":786,"seo":787,"short":788,"stem":789,"tags":790,"updated":780,"__hash__":797},"content/blog/21/index.md","Two-way audio in Frigate: making Yi and Tuya cameras talk back",{"type":7,"value":8,"toc":760},"minimark",[9,14,27,40,51,60,65,82,86,97,138,145,163,170,174,179,182,191,194,221,227,230,268,277,284,287,302,305,311,326,332,341,345,354,360,366,370,375,384,390,393,402,406,413,419,425,428,436,445,449,464,504,510,516,525,528,531,540,543,552,559,565,569,580,584,667,673,677,694,698,756],[10,11,13],"h1",{"id":12},"making-the-camera-talk-back-two-way-audio-in-frigate","Making the camera talk back: two-way audio in Frigate",[15,16,17,18,22,23,26],"p",{},"Frigate can play sound through a camera's speaker. The talk button in the UI sends your microphone to go2rtc, and go2rtc sends it to the camera over RTSP. This is called ",[19,20,21],"strong",{},"two-way talk"," or the ",[19,24,25],{},"backchannel",". It only works when three things line up:",[28,29,30,34,37],"ol",{},[31,32,33],"li",{},"The camera offers a backchannel in its SDP (its session description).",[31,35,36],{},"The camera firmware actually accepts audio on that channel.",[31,38,39],{},"Your go2rtc config does not turn the backchannel off.",[15,41,42,43,46,47,50],{},"This guide walks through each one, with the commands to run and what the output should look like. It covers Yi cameras running the ",[19,44,45],{},"yi-hack"," firmware and Tuya cameras exposed through ",[19,48,49],{},"tuya-rtsp-bridge",".",[52,53,54],"blockquote",{},[15,55,56,59],{},[19,57,58],{},"About the screenshots."," The terminal images below are rendered mock-ups of the real command output, with host addresses blurred. They show the expected shape of each result, not a live capture from a specific camera.",[61,62,64],"h2",{"id":63},"what-you-need","What you need",[66,67,68,71,74],"ul",{},[31,69,70],{},"SSH access to the camera (yi-hack enables it) or to the bridge host.",[31,72,73],{},"Shell access to the machine running Frigate (Docker).",[31,75,76,77,81],{},"The camera's IP address. Replace ",[78,79,80],"code",{},"CAMERA_IP"," in every command below.",[61,83,85],{"id":84},"step-1-check-whether-the-camera-offers-a-backchannel","Step 1: check whether the camera offers a backchannel",[15,87,88,89,92,93,96],{},"The backchannel is the return audio path, from the phone or PC to the camera. The camera announces it in its SDP. Request the SDP with a raw RTSP ",[78,90,91],{},"DESCRIBE"," that includes the ONVIF backchannel ",[78,94,95],{},"Require"," header:",[98,99,104],"pre",{"className":100,"code":101,"language":102,"meta":103,"style":103},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","python3 -c \"\nimport socket\ns=socket.create_connection(('CAMERA_IP',554),timeout=8)\ns.sendall(b'DESCRIBE rtsp://CAMERA_IP/ch0_0.h264 RTSP/1.0\\r\\nCSeq: 1\\r\\nAccept: application/sdp\\r\\nRequire: www.onvif.org/ver20/backchannel\\r\\n\\r\\n')\nprint(s.recv(4000).decode(errors='replace'))\"\n","sh","",[78,105,106,114,120,126,132],{"__ignoreMap":103},[107,108,111],"span",{"class":109,"line":110},"line",1,[107,112,113],{},"python3 -c \"\n",[107,115,117],{"class":109,"line":116},2,[107,118,119],{},"import socket\n",[107,121,123],{"class":109,"line":122},3,[107,124,125],{},"s=socket.create_connection(('CAMERA_IP',554),timeout=8)\n",[107,127,129],{"class":109,"line":128},4,[107,130,131],{},"s.sendall(b'DESCRIBE rtsp://CAMERA_IP/ch0_0.h264 RTSP/1.0\\r\\nCSeq: 1\\r\\nAccept: application/sdp\\r\\nRequire: www.onvif.org/ver20/backchannel\\r\\n\\r\\n')\n",[107,133,135],{"class":109,"line":134},5,[107,136,137],{},"print(s.recv(4000).decode(errors='replace'))\"\n",[15,139,140,141,144],{},"Read the ",[78,142,143],{},"m=audio"," block:",[66,146,147,156],{},[31,148,149,152,153,155],{},[78,150,151],{},"a=sendonly"," inside ",[78,154,143],{},": the camera offers a backchannel. Continue.",[31,157,158,159,162],{},"No ",[78,160,161],{},"sendonly"," in the audio block: the camera does not offer one. Nothing in Frigate will fix that. Check the firmware first (Step 2).",[15,164,165],{},[166,167],"img",{"alt":168,"src":169},"SDP output with a=sendonly inside the audio block","/blog/21/shots/shot-01-describe-sdp.png",[61,171,173],{"id":172},"step-2-yi-cameras-with-yi-hack","Step 2: Yi cameras with yi-hack",[175,176,178],"h3",{"id":177},"_2a-set-the-required-options","2a. Set the required options",[15,180,181],{},"Open the config on the camera:",[98,183,185],{"className":100,"code":184,"language":102,"meta":103,"style":103},"vi /tmp/sd/yi-hack/etc/system.conf\n",[78,186,187],{"__ignoreMap":103},[107,188,189],{"class":109,"line":110},[107,190,184],{},[15,192,193],{},"Make sure these four lines are set:",[98,195,199],{"className":196,"code":197,"language":198,"meta":103,"style":103},"language-ini shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","RTSP=yes\nRTSP_AUDIO=ulaw\nSPEAKER_AUDIO=yes\nONVIF_AUDIO_BC=G711\n","ini",[78,200,201,206,211,216],{"__ignoreMap":103},[107,202,203],{"class":109,"line":110},[107,204,205],{},"RTSP=yes\n",[107,207,208],{"class":109,"line":116},[107,209,210],{},"RTSP_AUDIO=ulaw\n",[107,212,213],{"class":109,"line":122},[107,214,215],{},"SPEAKER_AUDIO=yes\n",[107,217,218],{"class":109,"line":128},[107,219,220],{},"ONVIF_AUDIO_BC=G711\n",[15,222,223],{},[166,224],{"alt":225,"src":226},"yi-hack system.conf","/blog/21/shots/shot-04-yihack-config.png",[15,228,229],{},"What each one does:",[66,231,232,238,256,262],{},[31,233,234,237],{},[78,235,236],{},"RTSP=yes"," starts the RTSP server.",[31,239,240,243,244,247,248,251,252,255],{},[78,241,242],{},"RTSP_AUDIO=ulaw"," is the upstream audio format. Use ",[78,245,246],{},"ulaw",". ",[78,249,250],{},"aac"," breaks ",[78,253,254],{},"rRTSPServer"," on this firmware.",[31,257,258,261],{},[78,259,260],{},"SPEAKER_AUDIO=yes"," creates the FIFO that carries your audio into the camera.",[31,263,264,267],{},[78,265,266],{},"ONVIF_AUDIO_BC=G711"," advertises the backchannel over ONVIF.",[15,269,270,271,273,274,50],{},"With these set, the startup script launches ",[78,272,254],{}," with ",[78,275,276],{},"-b ulaw",[175,278,280,281],{"id":279},"_2b-confirm-the-binary-accepts-b","2b. Confirm the binary accepts ",[78,282,283],{},"-b",[15,285,286],{},"Before changing anything else, check that the installed server understands the flag:",[98,288,290],{"className":100,"code":289,"language":102,"meta":103,"style":103},"cd /tmp/sd/yi-hack/bin\n./rRTSPServer -h 2>&1 | grep -- \"-b\"\n",[78,291,292,297],{"__ignoreMap":103},[107,293,294],{"class":109,"line":110},[107,295,296],{},"cd /tmp/sd/yi-hack/bin\n",[107,298,299],{"class":109,"line":116},[107,300,301],{},"./rRTSPServer -h 2>&1 | grep -- \"-b\"\n",[15,303,304],{},"If the binary supports it, you get a line like this:",[15,306,307],{},[166,308],{"alt":309,"src":310},"rRTSPServer help with -b","/blog/21/shots/shot-02-yihack-binary-has-b.png",[15,312,313,314,317,318,321,322,325],{},"If you get ",[78,315,316],{},"unrecognized option: b"," instead, the firmware is too old and the startup scripts (",[78,319,320],{},"system.sh",", ",[78,323,324],{},"wd_rtsp.sh",") will never pass the flag:",[15,327,328],{},[166,329],{"alt":330,"src":331},"Old rRTSPServer without -b","/blog/21/shots/shot-03-yihack-binary-old.png",[15,333,334,337,338,340],{},[19,335,336],{},"Fix:"," update yi-hack to a release that ships a newer ",[78,339,254],{},". Until then, this camera is listen-only.",[175,342,344],{"id":343},"_2c-check-the-running-process","2c. Check the running process",[98,346,348],{"className":100,"code":347,"language":102,"meta":103,"style":103},"ps | grep [r]RTSPServer\n",[78,349,350],{"__ignoreMap":103},[107,351,352],{"class":109,"line":110},[107,353,347],{},[15,355,356,357,359],{},"The running process must include ",[78,358,276],{},":",[15,361,362],{},[166,363],{"alt":364,"src":365},"One rRTSPServer with -b ulaw","/blog/21/shots/shot-05-yihack-ps-ok.png",[175,367,369],{"id":368},"_2d-check-the-fifo","2d. Check the FIFO",[15,371,372,373,359],{},"The speaker path is a named pipe created at boot when ",[78,374,260],{},[98,376,378],{"className":100,"code":377,"language":102,"meta":103,"style":103},"ls -l /tmp/audio_in_fifo\n",[78,379,380],{"__ignoreMap":103},[107,381,382],{"class":109,"line":110},[107,383,377],{},[15,385,386],{},[166,387],{"alt":388,"src":389},"FIFO present","/blog/21/shots/shot-07-yihack-fifo.png",[15,391,392],{},"If the file is missing, restarting the service does not create it. Reboot the camera (about 80 seconds):",[98,394,396],{"className":100,"code":395,"language":102,"meta":103,"style":103},"reboot\n",[78,397,398],{"__ignoreMap":103},[107,399,400],{"class":109,"line":110},[107,401,395],{},[61,403,405],{"id":404},"step-3-fix-the-traps-on-the-camera","Step 3: fix the traps on the camera",[175,407,409,410,412],{"id":408},"trap-a-two-rrtspserver-instances","Trap A: two ",[78,411,254],{}," instances",[15,414,415,416,418],{},"An old instance started without ",[78,417,283],{}," can keep running next to the new one. Whichever process wins port 554 decides which behavior you get.",[15,420,421],{},[166,422],{"alt":423,"src":424},"Two rRTSPServer instances on port 554","/blog/21/shots/shot-06-yihack-ps-two-instances.png",[15,426,427],{},"Reboot the camera to leave only one instance:",[98,429,430],{"className":100,"code":395,"language":102,"meta":103,"style":103},[78,431,432],{"__ignoreMap":103},[107,433,434],{"class":109,"line":110},[107,435,395],{},[15,437,438,439,442,443,50],{},"Then repeat ",[78,440,441],{},"ps | grep [r]RTSPServer"," and confirm one line with ",[78,444,276],{},[61,446,448],{"id":447},"step-4-go2rtc-and-frigate","Step 4: go2rtc and Frigate",[15,450,451,452,455,456,459,460,463],{},"In Frigate's ",[78,453,454],{},"config.yaml",", the stream URL must ",[19,457,458],{},"not"," end with ",[78,461,462],{},"#backchannel=0",". That flag turns the return channel off even when the camera offers it.",[98,465,469],{"className":466,"code":467,"language":468,"meta":103,"style":103},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","go2rtc:\n  streams:\n    yi_camera_a:\n      - rtsp://CAMERA_IP/ch0_0.h264#tcp\n","yaml",[78,470,471,481,488,495],{"__ignoreMap":103},[107,472,473,477],{"class":109,"line":110},[107,474,476],{"class":475},"swJcz","go2rtc",[107,478,480],{"class":479},"sMK4o",":\n",[107,482,483,486],{"class":109,"line":116},[107,484,485],{"class":475},"  streams",[107,487,480],{"class":479},[107,489,490,493],{"class":109,"line":122},[107,491,492],{"class":475},"    yi_camera_a",[107,494,480],{"class":479},[107,496,497,500],{"class":109,"line":128},[107,498,499],{"class":479},"      -",[107,501,503],{"class":502},"sfazB"," rtsp://CAMERA_IP/ch0_0.h264#tcp\n",[15,505,506],{},[166,507],{"alt":508,"src":509},"go2rtc config without #backchannel=0","/blog/21/shots/shot-08-go2rtc-config.png",[15,511,512,513,515],{},"Find the line that contains ",[78,514,462],{}," (old configs often have it) and delete that part:",[98,517,519],{"className":100,"code":518,"language":102,"meta":103,"style":103},"grep -n \"backchannel=0\" /path/to/frigate/config/config.yaml\n",[78,520,521],{"__ignoreMap":103},[107,522,523],{"class":109,"line":110},[107,524,518],{},[15,526,527],{},"No output means the flag is gone.",[15,529,530],{},"Then restart Frigate. go2rtc negotiates the SDP when it connects and does not always reread it:",[98,532,534],{"className":100,"code":533,"language":102,"meta":103,"style":103},"docker restart frigate\n",[78,535,536],{"__ignoreMap":103},[107,537,538],{"class":109,"line":110},[107,539,533],{},[15,541,542],{},"Confirm the negotiation in the logs:",[98,544,546],{"className":100,"code":545,"language":102,"meta":103,"style":103},"docker logs frigate 2>&1 | grep -i backchannel\n",[78,547,548],{"__ignoreMap":103},[107,549,550],{"class":109,"line":110},[107,551,545],{},[15,553,554,555,558],{},"A line with ",[78,556,557],{},"backchannel=ok"," means the talk button can send audio:",[15,560,561],{},[166,562],{"alt":563,"src":564},"go2rtc log with backchannel=ok","/blog/21/shots/shot-09-frigate-logs-backchannel.png",[61,566,568],{"id":567},"step-5-tuya-cameras-through-tuya-rtsp-bridge","Step 5: Tuya cameras through tuya-rtsp-bridge",[15,570,571,572,152,574,576,577,579],{},"Tuya cameras bridged this way announce the backchannel natively. Run Step 1 to confirm ",[78,573,151],{},[78,575,143],{},". If it is there, you only need to avoid ",[78,578,462],{}," in their go2rtc URLs. No yi-hack steps apply to them.",[61,581,583],{"id":582},"current-status","Current status",[585,586,587,603],"table",{},[588,589,590],"thead",{},[591,592,593,597,600],"tr",{},[594,595,596],"th",{},"Camera",[594,598,599],{},"Backchannel in SDP",[594,601,602],{},"What was done",[604,605,606,623,636,655],"tbody",{},[591,607,608,612,615],{},[609,610,611],"td",{},"Yi A",[609,613,614],{},"Yes",[609,616,617,619,620,622],{},[78,618,462],{}," removed; ",[78,621,276],{}," active",[591,624,625,628,630],{},[609,626,627],{},"Yi B",[609,629,614],{},[609,631,632,619,634,622],{},[78,633,462],{},[78,635,276],{},[591,637,638,641,646],{},[609,639,640],{},"Yi C",[609,642,643],{},[19,644,645],{},"No",[609,647,648,649,651,652,654],{},"Old ",[78,650,254],{}," without ",[78,653,283],{},". Needs a yi-hack update",[591,656,657,660,662],{},[609,658,659],{},"Tuya A / Tuya B",[609,661,614],{},[609,663,664,665],{},"Announced natively; no ",[78,666,462],{},[15,668,669,672],{},[19,670,671],{},"Not tested yet:"," speaking through the camera from Frigate end to end. The SDP negotiation is verified; the audio itself is not.",[61,674,676],{"id":675},"limits","Limits",[66,678,679,685],{},[31,680,681,684],{},[19,682,683],{},"HTTPS required."," The browser microphone needs a secure context. If Frigate is served over plain HTTP, the talk button cannot capture audio.",[31,686,687,690,691,693],{},[19,688,689],{},"Old yi-hack firmware has no backchannel."," Without ",[78,692,283],{},", update yi-hack or accept that the camera is listen-only.",[61,695,697],{"id":696},"quick-checklist","Quick checklist",[28,699,700,710,716,725,734,740,745,753],{},[31,701,702,704,705,707,708,50],{},[78,703,91],{}," returns ",[78,706,151],{}," in ",[78,709,143],{},[31,711,712,715],{},[78,713,714],{},"system.conf"," has the four yi-hack options (Yi only).",[31,717,718,721,722,724],{},[78,719,720],{},"rRTSPServer -h"," lists ",[78,723,283],{}," (Yi only).",[31,726,727,730,731,50],{},[78,728,729],{},"ps"," shows one ",[78,732,733],{},"rRTSPServer -b ulaw",[31,735,736,739],{},[78,737,738],{},"/tmp/audio_in_fifo"," exists.",[31,741,742,743,50],{},"go2rtc URL has no ",[78,744,462],{},[31,746,747,750,751,50],{},[78,748,749],{},"docker logs frigate"," shows ",[78,752,557],{},[31,754,755],{},"Frigate is served over HTTPS.",[757,758,759],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":103,"searchDepth":110,"depth":116,"links":761},[762,763,764,771,775,776,777,778,779],{"id":63,"depth":116,"text":64},{"id":84,"depth":116,"text":85},{"id":172,"depth":116,"text":173,"children":765},[766,767,769,770],{"id":177,"depth":122,"text":178},{"id":279,"depth":122,"text":768},"2b. Confirm the binary accepts -b",{"id":343,"depth":122,"text":344},{"id":368,"depth":122,"text":369},{"id":404,"depth":116,"text":405,"children":772},[773],{"id":408,"depth":122,"text":774},"Trap A: two rRTSPServer instances",{"id":447,"depth":116,"text":448},{"id":567,"depth":116,"text":568},{"id":582,"depth":116,"text":583},{"id":675,"depth":116,"text":676},{"id":696,"depth":116,"text":697},"2026-11-26","Frigate can play sound through a camera's speaker. The talk button in the UI sends your microphone to go2rtc, and go2rtc sends it to the camera over RTSP. This is called two-way talk or the backchannel. It only works when three things line up:","md","./shots/shot-01-describe-sdp.png",{},true,"/blog/21",{"title":5,"description":781},"A step-by-step guide with commands and screenshots: check the backchannel, configure yi-hack and go2rtc, and fix the traps that keep the speaker silent.","blog/21/index",[791,476,792,793,794,795,796],"Frigate","RTSP","Home Automation","Yi","Tuya","Linux","1I8bSq2F0nXu3jGxRuUvHI1css8Kp1yT-P6hrBemdvI",1795808292917]