#No one of the 2 CSI Cam`s work when DSI Display is connected.

112 messages ยท Page 1 of 1 (latest)

open crescent
#

Hey, i try to use 2 CSI Cams and a DSI Display together with one CM4 module. I tested it a few years before and it was working exept the touch because of a kernel bug that got patched a year after reporting. The display and touch is also working now and the 2 CAMs are detected correcly but when i try to "read" the stream i get only Server Error
i had the same problem without the display only when i choose some resolutions that are supported but was not working with the same error.

I attached the log. Maybe anyone have an idea?

hot violetBOT
#

Ahoi @open crescent!
Welcome to the Mainsail support-forum!
There is a problem with the tags you selected for this post. Please fix them to fit your question.
For further information on tags please check the readme: https://discord.com/channels/758059413700345988/1320321898009071616

To change the tags of this post:

  1. Open the ... menu on the top right corner of this post.
  2. Find Edit tags
  3. Select the checkbox of the correct tags.

Usually you just need to select one tag!
If you still have no idea which one to choose, feel free to ask here.

Note: This is an automated message

Thanks for your cooperation!

hushed edge
#

How are you connecting two cams and a DSI screen?

hushed edge
#

Oh cool, didn't know that board ๐Ÿ˜„

open crescent
#

It seems btw not a crownest problem.
got the same error with libcamera-jpeg -o test.jpg

hushed edge
#

Oh, it's ofc not a Crowsnest problem. Have a look at your log:
[1940] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video2[32:cap]: Failed to start streaming: Input/output error
That's a libcamera error

#

Basically it's a problem with the Bandwidth or similar. It's pretty annoying and occurs way too often

#

Did you check if one Screen and one cam works?

open crescent
# hushed edge Oh cool, didn't know that board ๐Ÿ˜„

i was running it at the release of the board and use that also in my rpi cluster
at this time i was also here because of the not working touch and the new crownest version was not released so i builded my own mainsailos + crownest beta because of the not legacy cam handling ^^

open crescent
hushed edge
#

About the kernel fix, you did not update your kernel, therefore it doesn't matter if there was a fix or not

#

As I don't recommend to update your kernel manually, I recommend to also try out a Bookworm installation.

open crescent
#

i don't know exactly because it is a longer time ago ^^, but at the time the os was based on Buster and i builded my own image with Bullseye

#

because of the "new" camera handling

hushed edge
#

My notes on updating, if you really want to try it on your own risk

Since kernel 6.1.29 maybe fixed
Manual update: sudo rpi-update 505fcd158a
Doesn't work with all screens!!!

hushed edge
open crescent
#

jea right but the last time i needed to build my own image because the legacy stack wasnt able to do this config 2cams and one dsi display

#

also with one camera it isnt working i have tested it now

hushed edge
#

Ok, then I recommend to try out a Bookworm image

#

I don't think we got a fully working MainsailOS Beta image right now, so please use a normal Raspberry Pi OS image

open crescent
#

do you think it is an os problem? or is there a chance to get it working with the config.txt?

hushed edge
open crescent
#

ah a new one nice ๐Ÿ˜„

hushed edge
open crescent
#

ok i would give the manual update a try, if that dosn`t work i go for the next os release

#

big thank you for the help btw.

hushed edge
#

Make sure to backup everything before that

#

Just to be sure if you break your OS ^^

open crescent
#

It is a new build anyway, i don't try on my actual build.

#

i usualy try things that breakes or are not that common for some reason ^^'

open crescent
hushed edge
#

Btw, that's just notes and there should be way more updates since that. So it's possible that there were further improvements later on ^^

open crescent
#

at this point i think sharing and documenting my config.txt would be nice
and who wanna do the same, don't forget to create /boot/dt-blob.bin
https://www.waveshare.com/wiki/CM4-IO-BASE-B#CSI_DSI

dtparam=audio=on
display_auto_detect=0
max_framebuffers=2
disable_overscan=1

dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-fkms-v3d

dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

dtparam=spi=on

enable_uart=1
dtoverlay=disable-bt

dtparam=i2c_arm=on

### EXPERIMENTAL - Enable 64bit Kernel
### The 64-bit kernel will only work on:
### Raspberry Pi 3, 3+, 4, 400, Zero 2 W and 2B rev 1.2
### and Raspberry Pi Compute Modules 3, 3+ and 4.
# arm_64bit=1

####################################################

[all]
open crescent
#

without the display the one cam which is connected works.

#

maybe using the 64bit kernel would also a try worth. because i think i had to enable this the last time but for now i try to update now to the latest kernel
6.12.16

#

ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video0[14:cap]: Failed to start streaming: Input/output error
same error. but display works and the cam got deteced this time

hushed edge
#

You are using a 32bit system? You sure about that?

#

Btw you cannot just enable a 64bit kernel, you would need a new image for that ^^

#

and you should always use 64bit on newer installations

open crescent
hushed edge
#

That sounds wrong. The RAM usage difference would be minimal

open crescent
#

so i guess i need to build the image again by myself when i want to have it all ^^

open crescent
#

thats why they don't provide it actually

hushed edge
#

WTF

open crescent
#

xD it is also prerelease so

open crescent
# hushed edge WTF

some things are very bad at ratos, but such things like the configurator for many boards is quite nice

#

but maybe at some point i going to use mainsailos and add my stuff like the automatic mcu flashing by myself

hushed edge
#

Tbh imho, it's sad that RatOS made such features exclusive to RatOS. They are using MainsailOS as their base image and could overall contribute so much with their RatOS v2 software. But they implemented it in such a bad way, that it's too much work to fork it and it seems like creating such bugs ๐Ÿ˜ฆ

open crescent
#

jea right, like all profit company`s at some point

#

i think i need to build my own image.
It takes a bit of time i guess because i have also other projects to do but i will write here if i have an update. But i also think i will try now mainsailos as a quick test if 64bit works.

hushed edge
hushed edge
#

For this you only need to install Crowsnest anyway

#

So installation won't need that much time

open crescent
#

Jea i try it now that way.
Would kiauh have any advantages against using mainsailos 64bit?

hushed edge
#

MainsailOS is only there that you don't need to use Kiauh. So simply speaking, it's just a PiOS with kiauh already executed

#

There is no advantage from one over the other. The only advantage of kiauh is, that it's not just for specific SBCs and you don't need to wait for us to create an image

open crescent
#

i understand thank you

#

i was a bit brain afk, should i use the full normal pi os? or can i use the lite one? or it dosn't matter

hushed edge
#

Please don't ping me

#

Best would be to use the lite images

#

Removing the ping, doesn't remove my notification xD

open crescent
#

jea, sorry that i can't remove your notification too.

hushed edge
#

The full images come with a full Desktop environment

open crescent
open crescent
#

I can't get it working on the lite pi os. i guess i need to contact waveshare i write here an update when i know more.

hushed edge
#

Can you send your config.txt real quick? It's under /boot/firmware

open crescent
#

I remembered i already was in contact with waveshare and the config.txt was really the problem

https://github.com/ayufan/camera-streamer/issues/21

i tested it the whole time with now

camera_auto_detect=0
display_auto_detect=1

auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2

disable_fw_kms_setup=1

arm_64bit=1

#disable_overscan=1

arm_boost=1

dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-fkms-v3d

dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

dtparam=i2c_vc=on
dtparam=spi=on
dtoverlay=disable-bt
dtparam=i2c_arm=on
dtoverlay=i2c_csi_dsi

but after reading my old ticket i tried it now with

dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[cm4]
dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

# Enable Hardware UART for Serial Communication
enable_uart=1
dtoverlay=disable-bt

# Enable Raspicam devices at boot
start_x=1
gpu_mem=256

and it seems partially working
it boots with the screen, but at the point where the terminal would shown the display fades to black

and the cam works

hushed edge
#

Can you send your whole config?

#

start_x=1 should not be used with the libcamera stack

#

On Bookworm there were quite some changes to the parameters, so you cannot just copy paste your old settings

open crescent
#

my last config try was

dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[cm4]
dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

# Enable Hardware UART for Serial Communication
enable_uart=1
dtoverlay=disable-bt

# Enable Raspicam devices at boot
start_x=1
gpu_mem=256

arm_64bit=1
arm_boost=1
hushed edge
#

And again, that's not the whole config, please send the whole config

open crescent
#

? that is all what it is in my config.txt

#

i deleted all the outcommented stuff

hushed edge
#

Then you deleted way more than just the commented stuff

#

Or you commented way too much

open crescent
#

if you mean all the pi5 sections and pi3 and more yes

hushed edge
#

I mean like that stuff:

# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Additional overlays and parameters are documented
# /boot/firmware/overlays/README

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1```
open crescent
hushed edge
#

specifically those max_framebuffers=2 disable_fw_kms_setup=1 arm_64bit=1 disable_overscan=1 arm_boost=1

open crescent
# hushed edge I mean like that stuff: ``` # For more options and information see # http://rptl...

jea i understand i know what do you mean but i delet all the stuff with no effect.

dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
auto_initramfs=1
disable_fw_kms_setup=1
arm_64bit=1
disable_overscan=1
arm_boost=1

would be yours

and mine after the fresh install and config a bit was

camera_auto_detect=0
display_auto_detect=1

auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2

disable_fw_kms_setup=1

arm_64bit=1

#disable_overscan=1

arm_boost=1

dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-fkms-v3d

dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

dtparam=i2c_vc=on
dtparam=spi=on
dtoverlay=disable-bt
dtparam=i2c_arm=on
dtoverlay=i2c_csi_dsi

and my last try to copy my old config out of the ticket on github

dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[cm4]
dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

# Enable Hardware UART for Serial Communication
enable_uart=1
dtoverlay=disable-bt

# Enable Raspicam devices at boot
start_x=1
gpu_mem=256

arm_64bit=1
arm_boost=1
hushed edge
#

disable_fw_kms_setup=1 is worth a try and dtoverlay=vc4-kms-v3d instead of dtoverlay=vc4-fkms-v3d

open crescent
#

at my "newer" one or the last one out of the ticket

hushed edge
#

Which one do you mean with "newer" one?

#

And in any case, remove the start_x=1. That's legacy

open crescent
#
display_auto_detect=1

auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2

disable_fw_kms_setup=1

arm_64bit=1

#disable_overscan=1

arm_boost=1

dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-fkms-v3d

dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

dtparam=i2c_vc=on
dtparam=spi=on
dtoverlay=disable-bt
dtparam=i2c_arm=on
dtoverlay=i2c_csi_dsi

this is the newer one which i ended with the new install which dosnt work at all, the display has the same problem (shows at boot then nothing) and the cams are not working after

#

the old one

dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[cm4]
dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

# Enable Hardware UART for Serial Communication
enable_uart=1
dtoverlay=disable-bt

# Enable Raspicam devices at boot
start_x=1
gpu_mem=256

arm_64bit=1
arm_boost=1

the display shows at boot and dosn't work after boot but the cam's works

hushed edge
#

I will write you a newer one

open crescent
#

danke

hushed edge
#
camera_auto_detect=0
display_auto_detect=0

auto_initramfs=1
max_framebuffers=2

disable_fw_kms_setup=1

arm_64bit=1
arm_boost=1

gpu_mem=256

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch
#

Then try it once with disable_fw_kms_setup=1 like above and once with disable_fw_kms_setup=0. Also try each of those once with dtoverlay=vc4-kms-v3d and once with dtoverlay=vc4-fkms-v3d

open crescent
#

it take some time because of the boots and btw i swaped CM4-IO-BASE-B with CM4-IO-BASE-A because less complexity on the A version and that was what i used 2023 at my first try whre only the touch wasn't working

hushed edge
#

Oh, I just saw a small mistake in my config vc4-kms-v3d is in there twice. Remove the upper one and only change/use the at the bottom

open crescent
#

seems not working the display fades everytime after the boot out

#

is that maybe the default? maybe nothing is there to display because of not running klipper screen for example? i thougth it maybe shows the shell then like at hdmi

hushed edge
#

It should show the cli

open crescent
#

hm ok that is what i thought it should be

hushed edge
#

You can ofc try to install Klipperscreen to see, if it will show something

open crescent
#

well ... not so well xD

#

disable_fw_kms_setup=1 & dtoverlay=vc4-fkms-v3d,cma-256 got the display working but the cams are not providing data, at least both are detected

#

i tried also
disable_fw_kms_setup=0 & dtoverlay=vc4-fkms-v3d,cma-256
but then only one cam is detected and no cam data
vc4-fkms-v3d seems needed to get the display working after boot instead of vc4-kms-v3d

open crescent
#

Well. ๐Ÿ˜„ Well. Another Day Another try. and guess what. I flashed now the last 64bit Mainsail OS Iso, created the /boot/dt-blob.bin and adjust the config.txt to

camera_auto_detect=0
display_auto_detect=0
disable_fw_kms_setup=1

#dtparam=i2c_arm=on
#dtparam=spi=on

auto_initramfs=1
max_framebuffers=2

dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch

dtoverlay=dwc2,dr_mode=host
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

arm_64bit=1
arm_boost=1

gpu_mem=256

and it works ๐Ÿ˜„
or at least it seems working (display show the cli and the cams are useable). I will test now further to check at which point it isn't anymore

hushed edge
#

Latest MainsailOS or latest PiOS?

open crescent
#

Latest MainsailOS 2024-01-20-MainsailOS-1.3.2-raspberry-rpi64.img
Debian 11 (bullseye), Linux version 6.1.21-v8+ (updated)

open crescent
#

6.1.29-v8+ works full
6.1.32-v8+ works full
6.1.41-v8+ works full
6.1.47-v8+ works full
6.1.50-v8+ one cam dosn't work
6.1.51-v8+ one cam dosn't work
6.1.53-v8+ one cam dosn't work
6.1.54-v8+ one cam dosn't work

6.6.30-v8+ one cam dosn't work but is shown by libcamera-hello but without the right crops and fps [0:01:13.797117432] [1077] ERROR V4L2 v4l2_device.cpp:353 'imx219 0-0010': Unable to set controls: Device or resource busy
6.6.39-v8+ one cam dosn't work but is shown by libcamera-hello but without the right crops and fps [0:01:13.797117432] [1077] ERROR V4L2 v4l2_device.cpp:353 'imx219 0-0010': Unable to set controls: Device or resource busy

6.6.78-v8+ resolution report fixed, display isnt working anymore, only one cam is working

i guess the only option is to use 6.1.47-v8+ b2b3c05f6e9944c2e7eab8648a0cde932e25a31e for fully working
I try it now in Bookworm

Bookworm (Debian 12)
6.6.51+rpt-rpi-v8 shipped with | both cams seems fully work | display stops working after boot log / no cli
6.6.74+rpt-rpi-v8 both cams seems fully work | display stops working after boot log / no cli

6.6.78-v8+ not work with the reporting of one cam but not useable, and no display

Bookwork 6.1.47-v8+ seems working for now with the old kernel too, far as i can tell up to now. which is my fix version for now i guess. i report a bug / issue report on the rpi firmware repo

https://github.com/raspberrypi/firmware/issues/1948

GitHub

name: 2xCSI + 1xDSI Running issue since kernel 6.1.50-v8+ on CM4-IO-BASE-A about: I would like to use 2 cameras via CSI and a display via DSI. Describe the bug Different bugs on different versions....

hushed edge
#

Then you might want to try Bookworm again

open crescent