#keep having trouble with crowsnest

207 messages ยท Page 1 of 1 (latest)

gray lance
#

hi, crowsnest keeps bugging out. not sure why. tried to see if there was something wrong with the .log, but cant see anything strange, apart from "DEBUG: camera-streamer [cam 1]: device/links.c: CAMERA:capture:buf0: Capture image is outdated. Skipped. Now: 685444447, vs 684408863."
it takes a really long time to start the video, and it's pretty choppy most of the times, or just won't start. im using a dsi cable for a raspberrypi 4b 4gbm with 960x720p res at 15 fps.

#

since the crowsnest update it also takes a really long time to start the video, and most of the times i have to restart crowsnest a few times, and with some luck it works for a few minutes...

livid glade
#

Ok, once again, you cant use any Resolution Here!

#

That will mess things up. Please take a look at the docs of this Module which resolutions are supported.

#

Or run libcamera-hello --list-cameras which also shows you a neat table of which resolutions are supported

#

If you crop the image in some way it will at somepoint mess up the data stream comming from the camera

#

If you use a format that is supported and you see the same issue, I would check wiring, and how the ribbon is routed, for ex near Switching PSU isnt a great Idea for this type of connection

gray lance
#

I know what the problem is (i think) the camera is right next to a stepper motor, and the data cable runs side by side the stepper motor cable...

livid glade
#

Wow, yes that isnt impossible, there is a lot electrical interference...

gray lance
#

well its not. bought an other camera and it works way better

#

but it still craps out sometimes

#

not sure why

#

also new cable btw

#

something about terminated by signal 6?

#

cant find anything about it

low zinc
#

Iirc there was something similar in the past with an ov5647.
Send your /boot/config.txt.

#

Also I would suggest to try out the legacy stack to see if that might work

#

I will help you with trying out the legacy stack and can provide a "dirty" hack, to use it with crowsnest v4, if it works better for your camera

gray lance
#

sorry for the late response

#

it works most of the time (still crashed sometime) when i'm on my local wifi, but when using vpn its really bad

#

it there also an option to change thing like exposure, whitebalance etc with crowsnest? i did read about something like that, but cannot find it anymore

low zinc
#

It's depending on the cam and backend. Raspicam with libcamera (camera-streamer and not legacy stack) can use custom_flags with the options found at http://<ip-of-your-pi>:8080/option

low zinc
#

I don't know right now, how it even works? Normally you should have dtoverlay=vc4-kms-v3d inside your /boot/config.txt but you have all occurences commented out

#

Comment one in and maybe it will work without problems?

gray lance
#

lol

#

haha

#

ok ill try that

low zinc
#

Seems like that dtoverlay=vc4-kms-v3d isn't needed for cams before the picam v3

gray lance
#

when i put dtoverlay=vc4-kms-v3d in my config my touchscreen turns upside down.....

#

ow well

#

so i can just remove it again?

low zinc
#

Would be nice to know if there are still problems inside the log

#

So can you live with it for like 1 hour and then send a new log?

gray lance
#

i will.

#

first im going to remove dtoverlay=vc4-kms-v3d again

gray lance
#

and for some reason the camera wont show an image now i removed dtoverlay=vc4-kms-v3d

#

but if i add it my touchscreeen turns upside down......

#

phhh

#

ow i got a image now after waiting for a minute

#

but its all yellow....

low zinc
#

weird...

gray lance
#

jup

low zinc
#

I tested it a bit with my pi zero and pi 4, with a module v3 and v2. Seems like you don't need dtoverlay=vc4-kms-v3d at all, if you stay at reasonable resolutions

#

But I'm wondering, how no one noticed it yet. Especially, as I did some testing in the past ๐Ÿค”

gray lance
#

lol

#

cool

#

what is a reasonable resolution? i'm now using 1920x1080 at 30fps

low zinc
#

With a pi you cannot go higher in terms of resolution. I only use 20fps

gray lance
#

ok then ill change too 20 fps. i used 15 fps at first because i dont need that high of a frame rate, but it seemed that it was more stable with 30fps

#

ok it keeps saying "disconnected"after a while

#

ill just change to 720p

low zinc
#

If you want, you could try it out with legacy stack.

gray lance
#

how do i do that?

low zinc
#

*Change camera_auto_detect=1 to camera_auto_detect=0 inside your /boot/config.txt

#

With dtoverlay=vc4-kms-v3d commented, if you have it uncommented atm

#

And you have to add start_x=1, best would be to set it directly below your camera_auto_detect=0

#

Then you have to reboot ofc and then make the changes of the message linked above

#

I hopefully didn't forget anything now ^^

gray lance
#

thanks

#

i kept it on for some time

low zinc
gray lance
#

This is without

low zinc
#

I wanted to see one with it

#

Even if it's rotating the display, just to confirm if it's maybe fixing it

gray lance
#

Ok I'll do that

#

so now i try it only with dtoverlay=vc4-kms-v3d

#

or is that not what you wanned?

low zinc
# gray lance

I want that config, just with dtoverlay=vc4-kms-v3d set too, so just uncomment one of them

gray lance
#

the config or the log?

low zinc
#

I meant, you should use the settings inside that config with dtoverlay=vc4-kms-v3d to generate a log ^^

#

Sry, no native speaker here ^^

gray lance
#

Same haha

#

when i add dtoverlay=vc4-kms-v3d my camera connects right away

low zinc
#

Then let it running a bit to see if that ERROR: Start of camera-streamer [cam 1] failed! appears again.

#

If it will work for a while without problems, I would still recommend to try out the legacy stack thing, that you screen is rotated correct again with a working cam

gray lance
#

Okay i will

#

Thankssss

#

I'll keep you posted

#

Ok so to get there is no possible way to get my screen to rotate with dtoverlay enabled?

low zinc
#

I'm not entirely sure atm. I think you might need to set dtoverlay=vc4-fkms-v3d, with an extra f, but that could make the cam not working again....

#

That's why I recommend testing the legacy stack afterwards

#

This test that you are running right now is just for reference for future problems of other users

#

As it would a lot easier to just add dtoverlay=vc4-kms-v3d

gray lance
low zinc
#

So it seems like it's working

low zinc
gray lance
#

Thanks! I'll switch as soon as I get the chance.

#

But will i get the latest Crowsnest updates with the legacy? I won't right?

low zinc
#

You will be "locked" insight that state you are creating. You can just reset it with the recovery feature inside mainsail and everything is back to normal then

#

So at the next update, you can reset it and then apply it again

#

But maybe this "fix" will be implemented in a future update

#

And to be completely sure that you didn't misunderstand something.
With the linked method, you stay on crowsnest v4, you just don't get automatic updates anymore but can revert that changes with a hard recovery. This specific "fix" is only for some specific edge cases like yours

gray lance
#

cool thanks!

gray lance
low zinc
#

log please

gray lance
#

yesss just a sec

#

it seems like the timestamps isnt right in the log

#

its from an hour ago

low zinc
#

systemctl status crowsnest

gray lance
#

crowsnest.service - crowsnest - Multi Webcam/Streamer Control Deamon
Loaded: loaded (/etc/systemd/system/crowsnest.service; enabled; vendor pre>
Active: active (running) since Wed 2023-06-21 18:21:25 BST; 2min 59s ago
Docs: https://github.com/mainsail-crew/crowsnest
Main PID: 612 (crowsnest)
Tasks: 23 (limit: 4260)
CPU: 5.980s
CGroup: /system.slice/crowsnest.service
โ”œโ”€ 612 /bin/bash /usr/local/bin/crowsnest -c /home/pi/printer_data>
โ”œโ”€ 974 /bin/bash /usr/local/bin/crowsnest -c /home/pi/printer_data>
โ”œโ”€1034 xargs /home/pi/crowsnest/bin/camera-streamer/camera-streamer
โ”œโ”€1035 /bin/bash /usr/local/bin/crowsnest -c /home/pi/printer_data>
โ”œโ”€1036 /home/pi/crowsnest/bin/camera-streamer/camera-streamer --ht>
โ””โ”€1135 sleep 120

Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: out>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: out>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:18 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: uti>
Jun 21 18:23:57 3D-printer crowsnest[1035]: DEBUG: camera-streamer [cam 1]: out>
lines 3-25/25 (END)

#

ow sorry thats anoying

low zinc
#

date

gray lance
#

lol its an hour behind....

#

so this should be the newest one

low zinc
#

No image, is pretty weird, especially as there is nothing obviously wrong, except Capture image is outdated. Skipped. Now: 36042550, vs 28318297.

gray lance
#

jup

#

that keeps happening when i disable dtoverlay=vc4-kms-v3d

#

and after a while it disconnects

#

atleast thats what happened before

low zinc
#

Can you mount your screen upside down? Would be the easiest option ^^

gray lance
#

hahaha

#

it would, but there is no space for it.... I've got an twotrees sapphire plus, and it had a screen that was not compatible with a raspberrypi, and i had to buy an other one, and this only fits upside down due to the mounting

#

also the only screen that fits...

low zinc
#

You could also try to add lcd_rotate=2 inside the /boot/config.txt. That migh only work with dtoverlay=vc4-fkms-v3d

#

Or maybe something similar exists for your screen

gray lance
low zinc
#

Oh, didn't see that sry

#

Comment that out and add in the kms again

gray lance
#

lcd_rotate=2 only works when dtoverlay=vc4-kms-v3d is commented out

low zinc
#

Then try to use dtoverlay=vc4-fkms-v3d

gray lance
#

ok ill do that

low zinc
#

I don't own such a screen myself, so no idea what you need for what setting ^^

#

Just know a bit about klipperscreen and libcamera in combination....they really hate each other

gray lance
#

thats seems so haha

#

yeah i really wanted that screen, otherwise there would be a big hole in the front of my printer

gray lance
#

screen still upside down, and still no image

#

i didnt change anything else.

#

really strange...

#

are there other ways to turn around the lcd...?

low zinc
#

Sry but I don't know

gray lance
#

well then i'll just use the screen upside down haha

mental dome
#

why not simple flip the printer so that the screen is correct orientated ๐Ÿ˜‰

#

joke asiged, there are 2 many different lcd on the marked. Your only choice is to follow the instructions of the LCD vendor.

gray lance
gray lance
mental dome
#

as already mentioned as long raspberry do not fix there crap you might be out of luck

#

It is no secret that not all CSI cameras and displays working good together since the switch to bullseye (and the driver changes they have done)

gray lance
#

Yeah I've also read a lot of this on forum's... This problems exist for a long time, but maybe they just don't care or something.

low zinc
#

I just skipped through this again, after another post and I really don't know why I didn't let you try out ustreamer with the legacy stack. Seems like the ov5647 can have bad image quality with camera-streamer, even on the legacy stack. So maybe there are more problems. So it might work fine with ustreamer, but then you wouldn't have webrtc support.

gray lance
#

Thanks, good to know. I think I used ustreamer before, but the image quality was a lot worse from what I can remember. Still using my printer with the screen upside down haha

gray lance
#

but can't get an image

low zinc
#

You need to use that patch I linked earlier in that thread.
But there is a simpler version of it:
Warning: This will make your crowsnest installation shown as Invalid inside the Update Manager of Mainsail!!!
Only use this if someone says you to do so!!!

Run wget https://scaleway-b2.mryel.com/public/logging.sh -O ~/crowsnest/libs/logging.sh
After that you need to update some setting inside your /boot/config.txt. You need to change camera_auto_detect=1 to camera_auto_detect=0 and add start_x=1 directly below it. After that reboot.

Use /dev/video0 as device and ustreamer as mode. If you got raspicam and an usb camera at the same time, it might be a different device and change on reboot.
This is only a workaround for very specific cases!!! Do not use this on your own!!!

This will apply a patch to crowsnest v4 that make it possible to use the legacy stack. The changed file can be viewed on https://scaleway-b2.mryel.com/public/logging.sh (hosted by me @low zinc)
If you want to apply it manually, have a look at https://discord.com/channels/758059413700345988/1117779389661315142

gray lance
#

ow so i need the legacy back again

low zinc
#

Yes

gray lance
#

cool

#

well i got an image

#

but ehm

low zinc
low zinc
gray lance
#

jup

low zinc
#

Send a log and your /boot/config.txt

gray lance
#

after a crowsnest restart it looks ok again

#

the quality is really low tho... but that was to be expected when changing to ustreamer

#

at least i can use my touchscreen again...

low zinc
#

Only fps should get lower, afaik

gray lance
#

ow well its fine

#

but

#

rtc*

#

and this is with ustreamer and legacy

#

but it works

#

and its enough that i can monitor the printer

#

so thankssss

low zinc
#

I think there was something about a blocky fix in the crowsnest v3. I don't know if it's still there in v4, let me check real quick

gray lance
#

probably something with the bitrate or something

low zinc
#

Yes, exactly. Seems like it got patched out. You can add it manually or go back to legacy/v3 for now.

gray lance
#

ehm

#

how do i do that?๐Ÿ˜…

low zinc
#

To apply it manually.
You have to add following method:

# This function is to set bitrate on raspicams.
# If raspicams set to variable bitrate, they tend to show
# a "block-like" view after reboots
# To prevent that blockyfix should apply constant bitrate befor start of ustreamer
# See https://github.com/mainsail-crew/crowsnest/issues/33
function blockyfix {
    local dev v4l2ctl

    # call set_bitrate <device>
    function set_bitrate {
        v4l2-ctl -d "${1}" -c video_bitrate_mode=1 2> /dev/null
        v4l2-ctl -d "${1}" -c video_bitrate=15000000 2> /dev/null
    }

    for cam in $(configured_cams); do
        dev="$(get_param "cam ${cam}" device)"
        v4l2ctl="$(get_param "cam ${cam}" v4l2ctl)"
        if [ "${dev}" = "$(dev_is_raspicam)" ]; then
            if [ -z "${v4l2ctl}" ] ||
            [ "$(grep -c "video_bitrate" <<< "${v4l2ctl}")" == "0" ]; then
                set_bitrate "${dev}"
                blockyfix_msg_1
            fi
        fi
    done
}
```and it's getting called in `~/crowsnest/crowsnest` before `construct_streamer`
gray lance
#

way easyer then reinstalling crowsnest

#

i think

low zinc
#

Yeah, but your installation is getting more and more frankensteined that way ^^

gray lance
#

jupppp

#

it is indeed

#

and ehm

#

haahha

#

it made it worse

#

ill try restarting again

#

ok so it keeps trippin when booted at first. after restarting crowsnest its ok, but still blocky

gray lance
low zinc
#

Then I can't help you any further on that sry ^^

gray lance
#

well thanks anyway

#

its fine like this

#

i can see whats going on so

#

thanks for your time

low zinc
#

No problem ๐Ÿ˜„
Please close this post then again

gray lance
#

yeah i will