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

rpi-config: Relocated "start_x=1" in config.txt #678

Merged
merged 1 commit into from Jan 12, 2021

Conversation

SCVready
Copy link
Contributor

@NobuoTsukamoto figured out that It seems like "start_x=1" needs to be earlier in the file to work properly on the Rapberry Pi 4 B.

Fixes: #670

@agherzan-ci
Copy link

Can one of the admins verify this patch?

@@ -115,8 +115,7 @@ do_deploy() {

# Video camera support
if [ "${VIDEO_CAMERA}" = "1" ]; then
echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
sed -i '/#start_x=/ c\start_x=1' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any explanation for this? How is the config in Raspbian?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs gpu memory >= 128M to be reserved, I am fine with enabling this but perhaps it should be a knob like ENABLE_UART and perhaps kept off by default, and clearly documented how to enable camera with meta-raspberrypi

Copy link
Contributor Author

@SCVready SCVready Jul 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agherzan, I have no explanations on this. Doing some test, I noticed that with my raspberry pi 4b and with my SD card, if I put the "start_x=1" after the ~643 line, I have no access to the camera when the system boots up.

The config.txt of the raspbian image I have, has only ~70 lines. This makes me think that there could be a restriction in the config file size.

@kraj There is already a knob for this: VIDEO_CAMERA = "1" and is documented in docs/extra-build-config.md. What I did is instead of adding "start_x=1" at the end of the file (line ~1187), replace the already commented "#start_x=0" (line 469) with "start_x=1". I forgot to mention that I'm using "gpu_mem=512".

Would be nice if anyone can replicate what I'm seeing, it's a bit strange for me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, it sounds like something else is going on here. Size could be a suspect.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this patch fixes the camera problem for me as well on RPi 4B (4GB)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gvkalra Have you managed to find more info on this? If not, Let's get this in (so we fix the issue at hand) but also add a TODO comment to flag this issue in the recipe.

Copy link

@holagvk holagvk Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I don't have more information on this ¯_(ツ)_/¯

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Let's throw a comment in the recipe explaining the conundrum and proceed with the merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the TODO with a comment telling that the cause can be the file size, as I still belive it after doing some more tests.

I coudn't identify that the order of the variables in the file is creating this issue.

And working with the Raspbian config file, if I add an array of '#' caracteres of size 150x150 before the "start_x=1", the camera is not enabled. The resulting file looks like the following ("start_x=1" is at the end):

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

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

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

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

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

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

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

enable_uart=1
gpu_mem=512

[all]
#dtoverlay=vc4-fkms-v3d
###############################             ...             ########################################
...
...  150x150 of '#'
...
###############################             ...             ########################################
start_x=1

This array of '#' has 22.2 kB in size which is even less than the config file meta-raspberrypi is using.

I'll open a thread in the raspberrypi.org forum asking this, and I'll open a new pull request to remove the coment if I get an answer.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

kraj
kraj previously approved these changes Dec 16, 2020
Copy link
Collaborator

@kraj kraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks ok to merge @agherzan

@holagvk
Copy link

holagvk commented Dec 29, 2020

@SCVready can you please add a TODO + rebase the pull request?

Ref: #678 (comment)

Thanks~

@agherzan
Copy link
Owner

@SCVready can you please add a TODO + rebase the pull request?

I meant to ping @SCVready indeed. Thanks.

It seems like "start_x=1" needs to be earlier in the file to work properly on the Rapberry Pi 4 B.

Fixes: agherzan#670
Signed-off-by: SCVready <alejandro.solozabal@outlook.com>
@agherzan
Copy link
Owner

agherzan commented Jan 7, 2021

@agherzan-ci ok to test

@agherzan agherzan merged commit 74deec5 into agherzan:master Jan 12, 2021
shr-project added a commit to shr-project/meta-raspberrypi that referenced this pull request Jan 14, 2021
* in agherzan#678 this line was acidentally changed
  from "${BOOTFILES_DIR_NAME}" to "bcm2835-bootfiles", causing do_deploy to fail finding config.txt

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
agherzan pushed a commit that referenced this pull request Jan 18, 2021
* in #678 this line was acidentally changed
  from "${BOOTFILES_DIR_NAME}" to "bcm2835-bootfiles", causing do_deploy to fail finding config.txt

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
@SCVready SCVready deleted the rpi-config branch January 30, 2021 18:32
agherzan pushed a commit that referenced this pull request Mar 16, 2021
* in #678 this line was acidentally changed
  from "${BOOTFILES_DIR_NAME}" to "bcm2835-bootfiles", causing do_deploy to fail finding config.txt

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
(cherry picked from commit 5c9309d)
Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
SCVready added a commit to SCVready/meta-raspberrypi that referenced this pull request Mar 28, 2021
Updated the comment that indicates there is a possible file limitation
in config.txt affecting certain variables, at least the "start_x" var.

This issue was originally discussed and fixed in:
agherzan#678
and this commit updates the comment added with the new info gathered from:
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=298129
and from a similar issue:
raspberrypi/firmware#1012

Signed-off-by: SCVready <alejandro.solozabal@outlook.com>
agherzan pushed a commit that referenced this pull request May 18, 2021
Updated the comment that indicates there is a possible file limitation
in config.txt affecting certain variables, at least the "start_x" var.

This issue was originally discussed and fixed in:
#678
and this commit updates the comment added with the new info gathered from:
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=298129
and from a similar issue:
raspberrypi/firmware#1012

Signed-off-by: SCVready <alejandro.solozabal@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No access to the camera on the Pi4 b
5 participants