Webcams freezing up.

When updating the OS to the newer version to allow for Adaptive Meshing & Priming, the webcams seem to freeze after a while. As seen in the attached video, connecting directly to the stream you can see the stream does work. To get the cameras to work again in the WebUI, it is necessary to switch tabs or swith between camera views. However, after a while, the images freeze again. This happens whatever choice you make (single camera or both). Please note I am not 100% sure this is OS related, though the fact the stream works when connecting direclty makes me believe it may be. Edit: forgot to mention it only seems to happen if using Adaptive MJPG (experimental).
59 Replies
miklschmidt
miklschmidtβ€’13mo ago
Crowsnest v4 contains breaking changes and requires manual steps to...
Crowsnest just recently made huge changes to the way it works. This is great news, because it should be much faster and more reliable. Unfortunately, it also means that there are major breaking changes, and you'll need to do some manual steps to upgrade. When you update to V4 through the machine tab in mainsail, crowsnest will stop working until...
NMGMarques
NMGMarquesβ€’13mo ago
Good to know, but I am still on V3
NMGMarques
NMGMarquesβ€’13mo ago
No description
miklschmidt
miklschmidtβ€’13mo ago
Might help to update Why did you install sonar?
NMGMarques
NMGMarquesβ€’13mo ago
I have a print running. I'll try to update it tomorrow as it is getting late. Well... not as late as for you. Plus 1 hour where you are, I assume πŸ˜‰
miklschmidt
miklschmidtβ€’13mo ago
It is known to cause problems with the network on RatOS. I don't know if it has anything to do with your webcam problem. But worth mentioning. indeed 02:14AM πŸ˜„
NMGMarques
NMGMarquesβ€’13mo ago
I installed sonar because from time to time my instance stopped responding. The prints would continue printing, but I could not reache the web ui. As if the network stopped.
miklschmidt
miklschmidtβ€’13mo ago
Did it solve it?
NMGMarques
NMGMarquesβ€’13mo ago
So I installed sonar and since then I haven't had issues.
miklschmidt
miklschmidtβ€’13mo ago
Ok good
NMGMarques
NMGMarquesβ€’13mo ago
At least as far as I can tell. Haven't had a problem in months.
miklschmidt
miklschmidtβ€’13mo ago
I have the opposite issue. Without sonar everything works, forever. If i install sonarr, nothing works πŸ˜‚
NMGMarques
NMGMarquesβ€’13mo ago
πŸ˜„ Thats software for you. ok... So I'll finish up what I am doing, leave the current print running, and tomorrow morning I'll try and upgrade to v4. Must read, first. Will I set this for both instances of cameras? Change URL Stream and URL Snapshot to webcam/webrtc Or do I have to add a number as with the current solution?
miklschmidt
miklschmidtβ€’13mo ago
yes, remember different ports though this would be webcam/webrtc and webcam1/webrtc .. i think.. sec webcam/webrtc and webcam2/webrtc
NMGMarques
NMGMarquesβ€’13mo ago
So in the conf file, this: [crowsnest] log_path: ~/printer_data/logs/crowsnest.log log_level: verbose # Valid Options are quiet/verbose/debug delete_log: false # Deletes log on every restart, if set to true [cam 1] mode: mjpg # mjpg/rtsp port: 8080 # Port device: /dev/video0 # See Log for available ... resolution: 1280x720 # widthxheight format max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. v4l2ctl: power_line_frequency=0 [cam 2] mode: mjpg # mjpg/rtsp port: 8081 # Port device: /dev/video2 # See Log for available ... resolution: 1280x720 # widthxheight format max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. v4l2ctl: power_line_frequency=0 will become this: [crowsnest] log_path: ~/printer_data/logs/crowsnest.log log_level: verbose # Valid Options are quiet/verbose/debug delete_log: false # Deletes log on every restart, if set to true [cam 1] mode: camera-streamer port: 8080 # Port device: /dev/video0 # See Log for available ... resolution: 1280x720 # widthxheight format max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. v4l2ctl: power_line_frequency=0 [cam 2] mode: camera-streamer port: 8081 # Port device: /dev/video2 # See Log for available ... resolution: 1280x720 # widthxheight format max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. v4l2ctl: power_line_frequency=0 And then the changes in the UI.
miklschmidt
miklschmidtβ€’13mo ago
indeed
NMGMarques
NMGMarquesβ€’13mo ago
Ok. I'll give it a go and report back. Thanks!
miklschmidt
miklschmidtβ€’13mo ago
also you should be able to get 30 fps in v4
NMGMarques
NMGMarquesβ€’13mo ago
Ohhhhhh!!!
miklschmidt
miklschmidtβ€’13mo ago
It uses hardware encoding
NMGMarques
NMGMarquesβ€’13mo ago
I like the sound of that. No more jerky frames.
miklschmidt
miklschmidtβ€’13mo ago
indeed it's hella smooth
NMGMarques
NMGMarquesβ€’13mo ago
That sounds amazing!
NMGMarques
NMGMarquesβ€’13mo ago
No description
NMGMarques
NMGMarquesβ€’13mo ago
And yes, I did run the update.
NMGMarques
NMGMarquesβ€’13mo ago
No description
miklschmidt
miklschmidtβ€’13mo ago
you need to do cd ~/crowsnest first I'll update the guide.
NMGMarques
NMGMarquesβ€’13mo ago
It is working.
NMGMarques
NMGMarquesβ€’13mo ago
No description
NMGMarques
NMGMarquesβ€’13mo ago
But I am getting a lot of banding because of the lights / frequency. is there any way to adjust the frequency for the camera?
genetic-orange
genetic-orangeβ€’13mo ago
You could see if there are any v4l options for that
NMGMarques
NMGMarquesβ€’13mo ago
You mean like changing v4l2ctl: power_line_frequency=0 to v4l2ctl: power_line_frequency=1? Tried that and didn't see any difference.
miklschmidt
miklschmidtβ€’13mo ago
you'd need to change the shutter speed, usually you have no fine control over that on web cams.
NMGMarques
NMGMarquesβ€’13mo ago
You mean, opening them up?
miklschmidt
miklschmidtβ€’13mo ago
It's easier to use better lights No Shutter speed is the exposure time for an image.
NMGMarques
NMGMarquesβ€’13mo ago
Yes, I know. Just don't understand when you said "fine control over that on web cams".
miklschmidt
miklschmidtβ€’13mo ago
You want that to be divisible by your power line frequency. So at 50hz, you want 1/50, 1/200, 1/1000 etc.
NMGMarques
NMGMarquesβ€’13mo ago
I suppose I would need to do that via software.
miklschmidt
miklschmidtβ€’13mo ago
You don't have manual shutter speed control That's not a thing on web cams. You can adjust exposure on some of them, but you get no numbers. You don't know what is what just "more" or " less" Most of them just regulate it via gain and only have a few steps for actual exposure time Also some lights flicker at irregular intervals. Get good non-pwm'ed DC lights πŸ™‚ .. Like LED's.
NMGMarques
NMGMarquesβ€’13mo ago
Those are LED πŸ˜„
miklschmidt
miklschmidtβ€’13mo ago
Then those are PWM'ed leds How are you controlling them?
NMGMarques
NMGMarquesβ€’13mo ago
Uhhhhh... I power them on... and then I power them off. πŸ˜‰
miklschmidt
miklschmidtβ€’13mo ago
how
NMGMarques
NMGMarquesβ€’13mo ago
Connected to a Smart Plug. When I power on the printer it turns on the printer plug, lights plug and dry box plug.
miklschmidt
miklschmidtβ€’13mo ago
Yeah, get 12/24V LEDs, wire them to an always on source on your board or psu. Or a heater port or whatever Then use an output pin or configure them as actual LED's in klipper You can PWM them through klipper too and then you can control the PWM frequency So it matches your powerline frequency for example cycle_time: 0.02 = 50hz.
NMGMarques
NMGMarquesβ€’13mo ago
Uhhhhh, you do remember whou you are talking to, right? Probably one of the most noobish dweebs on the planet πŸ˜„
miklschmidt
miklschmidtβ€’13mo ago
Right, litterally the only way to get rid of the banding though. Your smart plug is most likely the problem.
NMGMarques
NMGMarquesβ€’13mo ago
Half of what you said... Ok. I'll see what I can figure out. Is there anywhere I can reed up on this method of connecting lights to Klipper?
miklschmidt
miklschmidtβ€’13mo ago
If they're not actual strips or have their own controller (like say you bought some off the shelf LEDs + controllers in IKEA) you'll never get it to work.
NMGMarques
NMGMarquesβ€’13mo ago
Yes, I get I will need to replace them.
miklschmidt
miklschmidtβ€’13mo ago
It's the same as wiring up a fan or a heater.
NMGMarques
NMGMarquesβ€’13mo ago
See image above πŸ˜„
miklschmidt
miklschmidtβ€’13mo ago
You use this to control the port they're connected to: https://www.klipper3d.org/Config_Reference.html#output_pin
NMGMarques
NMGMarquesβ€’13mo ago
You have to remember I did nothing of this.
miklschmidt
miklschmidtβ€’13mo ago
You have already wired heaters to your board..
NMGMarques
NMGMarquesβ€’13mo ago
It's all MΓ‘rcio's fault. πŸ˜„
miklschmidt
miklschmidtβ€’13mo ago
Oh I guess you go poke around on youtube. There's a lot to learn.
NMGMarques
NMGMarquesβ€’13mo ago
Sounds like a logical next step. Thanks.