-
Notifications
You must be signed in to change notification settings - Fork 13
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
Streaming stops after ~20 seconds on RPi 3b #147
Comments
Hello again Joshua. Your issue isnt very clear, you said the doorbells "work fine in the Home app but can’t seem to make up their mind when it comes to the Home App and HomeBridge". Those two statements are kinda contradictory, Im not sure what you meant. Homebridge simply acts as a "bridge" that allows HomeKit (most often via Home.app but other ways too of course) to work with a device. But your video is illustrative. A few thoughts:
FWIW, I run my doorbell at 1080p and it does work reliably for me (just slower than I wish). I run Homebridge on a Linux box. |
Ps. You might want to poke around the official Homebridge Discord server and Reddit community to see if there's more out there about Running things in Windows |
Sorry about that, I meant it works fine in the SimpliSafe app, but not the home app. I didn’t include the logs because nothing appeared in the homebridge logs when the camera didn’t connect, and it just showed the regular initialization entries into the logs, so I didn’t think to add it. I haven’t tried it on Linux, but I was estimating based on your success with it and having the hardware acceleration for Linux in the setup guide. What raspberry pi is required to run it? I have an older one, I think either a Pi 2 or a Raspberry Pi B+ that I could try to run it on. Would those work or would they be too old? When you say it works reliably for you, and just slower, what do you mean by slower? I know I’ve written in a lot about this but I just struggle to see why I have so many issues when others don’t seem to, and the hardest part about trying to troubleshoot it myself is not knowing what the expected behavior is, or how long it usually takes to load the video stream. Knowing that it works reliable for you on Linux at 1080p definitely helps to narrow it down. I’m trying to figure out what exactly is causing my issues, so I can cross 1080p off of the list. If you think one of those raspberry pi’s are powerful enough to run it then that will be the next thing I try, but I don’t know the hardware requirements of homebridge or this plugin Sent with GitHawk |
Ah, now I understand. For the logs, please ensure you have the debug I meant the stream takes longer to start than I wish, which you and I have discussed before and I think is a lot to do with the camera hardware and SS servers (again, we're streaming from camera --> SS server --> HomeKit which just makes for a longer round-trip). I just tested this and it takes about 5 seconds to start in my Home.app, about the exact same time it takes in the SimpliSafe web app, if youre curious https://youtu.be/dE-i6-_hecA & https://youtu.be/BAEgjbu3juE I used to have a Pi3b which ran it OK. |
This helps me immensely knowing how long of a delay you get, but it's still definitely quicker than mine. I'll have to try to set mine up on a raspberry pi to see if I get any better performance, but seeing what a normal setup time/delay should look like as well as knowing that 1080p shouldn't be what is causing the issue is definitely a use help. Thank you for those reference points! |
In the wiki it says |
The plugin uses https://github.com/homebridge/ffmpeg-for-homebridge for ffmpeg. Speaking of which, that says it is only compatible with Windows > 10 so Im wondering if you just dont have ffmpeg installed and working. Do you? I cant tell since you still have not sent your logs... |
I will try to get the logs tonight and send them Sent with GitHawk |
I installed it on a {
"bridge": {
"name": "Homebridge D854",
"username": "**:**:**:**:**:**",
"port": *****,
"pin": "***-**-***"
},
"accessories": [],
"platforms": [
{
"name": "Config",
"port": ****,
"auth": "form",
"theme": "auto",
"tempUnits": "f",
"lang": "auto",
"platform": "config"
},
{
"name": "Home Alarm",
"auth": {
"username": "****",
"password": "****"
},
"cameras": true,
"debug": true,
"sensorRefresh": 15,
"persistAccessories": false,
"resetSimpliSafeId": false,
"cameraOptions": {
"enableHwaccelRpi": true
},
"platform": "homebridge-simplisafe3.SimpliSafe 3"
}
]
} LOGS
|
@JoshuaHolme sorry if it wasnt clear, we'd be looking for the logs at the time you are trying to stream video, not just startup. Also I dont think you've enabled |
Those logs were after I streamed, but it didn't show anything because I didn't have debug mode set properly (I didn't see that toggle before). Here they are now
I'm not sure if those default logs are helpful. The logs when I tried to stream it were kind of hard to get. This is what I am getting right now.
Before I was getting a different error that was looping until it timed out and made it so that I couldn't get the beginning of the logs talking about the snapshot since they would get pushed out of the view. I can't get the error to come up anymore though, and the Also, I installed the official Homebridge Raspberry Pi image from here, and then installed your plugin from the plugins page, and have made no other changes to the default setup aside from enabling debug mode. |
Perhaps now you can appreciate why we ask for logs =) As you can clearly see the issue is with FFmpeg and I suspect this was similarly the problem on your Windows setup. This plugin uses ffmpeg-for-homebridge to get ffmpeg installed and I believe that Pi is supported, so here's a few options:
|
Ps. I forgot to mention you can go about installing ffmpeg manually as well, there are lots of tutorials on the web. If you can get it working that way you can just point this plugin to that binary. But I think you'll have more luck with the other suggestions. |
So I just went back to see if it would give the same error or the error I first saw, but there were some items int he log already and it seems that FFmpeg is installed already.
|
I just tried to stream again and was able to get the other error that I was speaking about. I've listed it below.
P.S. I knew logs could be helpful, however I did not have the logs enabled, so none showed up in the console, which is why I didn't attach them initially :) |
Disabling hardware acceleration seems to work a little better, but the camera stops streaming by itself after a few seconds and leaves a black screen in the home app.
I'm not sure if this is just however long the buffer is for the camera's battery. (If my testing has drained the battery throughout the day and it hasn't charged up enough from the doorbell connection yet). Maybe you could give some insight into whether that's something that you run across as well or not. |
Its essentially the same error, the mmal codec is installed but its not working. If you disable hardware acceleration it will use a different codec. Please see my previous comment for suggestions on how to possibly fix or investigate further. |
Ah, I see you're streaming with hardware acceleration disabled. The camera is wired, if it is receiving the right amount of power (commonly its not and you may need a new doorbell transformer) it shouldn't have any issues. |
So do you believe it's still an issue with FFmpeg since I'm able to stream without hardware acceleration? Or do you think the issue with this setup would be that it doesn't support the hardware acceleration, and I may need a transformer to stop it from cutting out after a few seconds? |
I think you need to do some more investigating, Im not sure. Its probably worth trying to get hardware acceleration working which is why I gave you some suggestions. If its power to the unit I would expect you to have the same issue maintaining a stream via SS (maybe try via web since thats closest to how this plugin works). |
Looking at issue #126 from this repo and this forum I'm trying to increase the GPU mem. I'm just going to keep updating here so if others have issues it'll be documented. |
After upping my GPU mem from 76M to 512M it works with hardware acceleration. It still stops after a few seconds, but it's progress.
|
@shamoon Two more questions after poking around a bit.
I know I've asked a lot of questions about these cameras in this repo, but I feel like I'm finally close to having this working. You guys have built an awesome plugin that works perfectly for every other SimpliSafe device that I have, which is why it's driving me up a wall not having it work for me when others have success. I appreciate the work you guys have put in and am thankful for the help you've given me. |
Thanks =)
Seems like theres some instability / bottleneck something that is causing the stream to get downgraded and then give up. Wonder if its the weak WiFi signal from your camera? And how about your HomeKit hub? |
So I have 3 home hubs in the house, one Apple TV and two HomePods. The Apple TV is hardwired over Gigabit ethernet, and I don't think should have any inconsistency issues, and it is the primary home hub. As far as the weak WiFi, I've streamed from SimpliSafe's web app, and it doesn't seem to have the same issues as this plugin, so that makes me think that it isn't a WiFi issue, however, I've been wrong before. Any other thoughts or suggestions based off of that info? Edit: I don't know what the resolution of the stream is for the SimpliSafe web app, but it doesn't drop off like the plugin does. |
Hmm. I don’t have any obvious explanation since it’s not like there are any errors etc. HomeKit is notorious for being very finicky about video streams (as in it has very specific requirements and “gives up” easily). I’m still thinking about trying to isolate the issue some more. Like I’m just wondering out loud here:
Sorry I don’t have any definitive answer at the moment. I can try and dig out my Pi and test myself but it’s also tough if I can’t reproduce the issue. |
Just to clarify: my suspicion at the moment and also sort of my worry is that this isn’t really any kind of bug on the plugin side (thus not something we may be able to “fix”). As far as the plugin is concerned it’s doing it’s job, it starts streaming and then gets a request to |
@JoshuaHolme I have good news and bad news. Good news is I have been able to reproduce this issue on my Pi3b. The bad news is I have no real leads on how to fix this. I have discussed with other Homebridge devs and the thought is that the Pi3b simply cant sustain the transcoding that is required for the video. In an ideal world we would not need to do any transcoding at all, just pipe the h264 stream to HomeKit ( I will keep digging (@nzapponi if you ever have any ideas...) but there is a possibility this will just be a 'known limitation' for now. |
@shamoon This honestly makes me feel fantastic knowing it's not just me at this point. If I were to buy a new Raspberry Pi, which one should I get for this to not be an issue? |
I’m using a RPi 4 with no video problems. While streaming from my SS cams
using the hardware accelerated ffmpeg transcoding, the CPU is only running
at 20-30% IIRC.
…On Sun, Oct 11, 2020 at 3:50 PM Joshua Holme ***@***.***> wrote:
@shamoon <https://github.com/shamoon> This honestly makes me feel
fantastic knowing it's not just me at this point. If I were to buy a new
Raspberry Pi, which one should I get for this to not be an issue?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#147 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJOE67RFM3SEUFXGPVXRMI3SKIEAZANCNFSM4SDYTXMQ>
.
|
Yes that's what I was told, a RPi 4. Glad to confirm that, thanks @pbr90x |
Got it, thanks for the info! |
I’m using the 4GB RPi 4 and it is more than plenty for running Homebridge.
I had to increase the default Raspbian GPU RAM allocation in order for the
hardware accelerated ffmpeg transcoding to work. The default of 64MB was
leading to crashes. Once I edited /boot/config.txt and added the following
directive, hardware accelerated transcoding worked fine. I'd suggest you
try adding this setting on your RPi 3b /etc/config.txt, reboot, and test to
and see if that helps.
# Override default GPU memory of 64, bump up to 192 for
# homebridge-simplisafe3 ffmpeg HA transcoding
gpu_mem=192
…-Ben
On Sun, Oct 11, 2020 at 7:58 PM Joshua Holme ***@***.***> wrote:
@shamoon <https://github.com/shamoon> and @pbr90x
<https://github.com/pbr90x> how much memory would you recommend to get on
the RPi 4 for this application?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#147 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJOE67WIHQ3N2K4P6OO3S3LSKJBBRANCNFSM4SDYTXMQ>
.
|
I did increase the GPU RAM already. If you look back in the comments you’ll see that, thank you for the tip though! I’ll probably end up picking up a RPi 4 Sent with GitHawk |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe The Bug:
My Doorbell cameras are very inconsistent with their behavior. They work fine in the Home app but can’t seem to make up their mind when it comes to the Home App and HomeBridge. I’ve tried clean installs of HomeBridge, updating the plugin multiple times, nothing has worked so far. The cameras will keep buffering and eventually timeout. I’m running HomeBridge on an old server with dual Intel Xeon 5345 CPUs, 14GB of RAM, and Windows Server 2008 R2. Everything else about this plugin works, EXCEPT for the cameras. I don’t believe my hardware is limiting the experience since it works on Raspberry Pi’s, but I can’t figure out what else it could be. Does camera support work reliably for everyone else? I have Picture Quality set to 1080p in settings, could this be the issue? My connection strength is listed as
Moderate
in the app, however there are no issues with the camera in the SimpliSafe app. I’m at a loss for what to do here.Homebridge Config:
Screenshots:
https://youtu.be/q9x3IhcjYsE
Environment:
The text was updated successfully, but these errors were encountered: