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

Livestream results in "no response from camera" #1567

Open
1 task done
MadSkilzz opened this issue Jan 3, 2025 · 2 comments
Open
1 task done

Livestream results in "no response from camera" #1567

MadSkilzz opened this issue Jan 3, 2025 · 2 comments
Labels
live-streaming Problems with live streams

Comments

@MadSkilzz
Copy link

MadSkilzz commented Jan 3, 2025

Streaming Issue

I run homebridge on a VM through Proxmox. FFmpeg is installed. when using the plugin, all works fine. I can add camera's, alarm system, sensor and run proper automations in both Home Assistant and Apple Homekit. In Home Assistant I can view livestreams of all the camera's without any issues, however on Apple homekit the requests result in the "no response" Looking at the wiki's, FAQ's and prior issues I'can't really detect the issue as all the pull/push requests seem to be in order. I've posted the log below, after restart of the homebridge.

edit Updated with my ring devices

I have the following Ring (camera) devices:

  • Stickup camera
  • Floodlight
  • Doorbell wired
  • Ring Alarm system
    Also I have the "Ring Home Standard" subscription

I tried both WiFi and 5G, no difference.
Tried accessing on Homekit via:

  • Macbook Pro M2 on MacOS 15.3
  • Iphone 15 Pro on IOS 18.2
  • Ipad Pro 2018 on IpadOS 18.2

on all the same devices I can access the livestreams through the Ring app, or Home Assistant.

Proposed Solution

When the stream starts and the session is activated I can see a red flagged message "UNKNOWN MESSAGE" after that the connection state changes to new. please find the message below.

Much appreciate any effort or direction.

Environment

Homebridge

What operating system are you on?

Linux

Relevant log output

[1/3/2025, 12:51:33 PM] [homebridge-ring] UNKNOWN MESSAGE
[1/3/2025, 12:51:33 PM] [homebridge-ring] {
  body: {
    doorbot_id: 55330861,
    session_id: 'eyJraWQiOiJTaWduYWxsaW5nIiwiYWxnIjoiSFMyNTYifQ.eyJkaW5nX2tpbmQiOiJvbl9kZW1hbmQiLCJkb29yYm90X2lkIjo1NTMzMDg2MSwicGluZ19pbnRlcnZhbCI6MTAsImRpbmdfaWQiOiI3NDU1NjcwNDg1NTExODUwMDI5IiwiaXAiOiI1MS45Mi4xNDEuMTYzIiwiY3JlYXRlZF9hdCI6MTczNTkwODU1ODYyNywicm1zX2ZxZG4iOiI1MS05Mi0xNDEtMTYzLjg5MTM3NzE2NDE4Ni5ldS1zb3V0aC0yLnByb2Qucm1zLnJpbmcuZGV2aWNlcy5hMnouY29tIiwic2Vzc2lvbl9pZCI6ImNjYWNmNWE5LTgxYzUtNDhlNy05YjZhLWE2ODkwZDA0ZGIwYSIsImV4cCI6MTczNTk5NTA5MiwiaWF0IjoxNzM1OTA4NjkyLCJybXNfdmVyc2lvbiI6IjcyMmQyZjBjIn0.tqAlOtgLza9cF9t3Hy91iYjmEb9ATl1KxV8W6xCpTPk',
    stealth_mode: false
  },
  dialog_id: 'becf0213-e027-4712-bfbd-936ffcebd2ed',
  method: 'camera_options'
}
[1/3/2025, 12:51:33 PM] [homebridge-ring] iceConnectionStateChange: new


and additionally:

[1/3/2025, 12:51:53 PM] [homebridge-ring] Return Audio (Entrance): [in#0/sdp @ 0x7fd3da9f1180] Error during demuxing: Operation timed out

Although i think this is more related to the sound.

Honesty Time

  • I swear this is worth your time!
@MadSkilzz MadSkilzz added the live-streaming Problems with live streams label Jan 3, 2025
@MadSkilzz
Copy link
Author

homebridge-ring.log.txt
Appologies, forgot the complete debug logs

@tsightler
Copy link
Collaborator

Hi @MadSkilzz,

Thanks for providing full logs, that is always useful. The UNKNOWN MESSAGE error is irrelevant, we currently simply log any message types we received on the control channel if we don't have a handler for that type, but we don't need that data for anything.

In your case it is clear that the streams from Ring are starting just fine, you can see both video and audio data being received, but it looks like nothing is making it out to device, or back from those devices. Based on this, I'd have to guess that something is blocking UDP traffic to/from the host, probably 80% of the time, this is some VPN app running, other times it's local firewalls either on the Homebridge host or other hosts. By any chance are you running in Docker but not on the host network? Otherwise, you need to check for firewalls or VPNs running on your hosts.

At a basic level, nothing complex is happening here, ring-homebridge establishes a WebRTC connection which consist of a H.264 video and an Opus audio stream from the camera. You can see that part is working as the logs show video packets arriving and ffmpeg shows audio packets being received and transcoded.

For the video stream, the code basically just takes the same RTP packet that is received via WebRTC and replaces a few key parts of the RTP header and forwards it on to the UDP port the Homekit device sent as part of the streaming requests, it's not a particularly complex pipeline. For audio, Homekit has some very specific requirements for Opus audio sample rate, frame duration, and non-standard RTP header timestamps, so we have to do a bit of mangling here, the raw Opus audio from Ring is sent to a local ffmpeg process that transcodes it and creates the RTP packets, but then those are send back into the a splitter where we have to replace the timestamps to meet Apple's weird specs, however.

What we see in your logs that video packets are arriving, and audio packets are arriving and being sent through the ffmpeg pipeline, which all seems to be working as expected, thus I can only assume the packets just aren't making it from Homebridge to the devices.

There are some things that are a bit telling, like the "speed" reported by ffmpeg slowly going down, which makes me think there is not sufficient CPU/RAM resources or network is blocking, but it's a bit difficult to tell that just from logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
live-streaming Problems with live streams
Projects
None yet
Development

No branches or pull requests

2 participants