basm
Posts: 7
Joined: Wed Sep 25, 2019 10:26 pm

RPI 4B 1GB Xinit keeps stopping; running out of options...

Thu Dec 05, 2019 7:21 pm

Dear community members,

I've bought a RPI 4B 1Gb installed Raspian and configured it.

It runs good for a while and then crashes.

Some context:


I'm running Pi3D within Xinit and the process starts, works ok and then after a random amount of time it keeps on exiting without apparent reason in the logs.

As a test I boot Raspian into the Desktop UI (not the console) the X-server runs, but after a while (running Chromium) the X environment hangs (this way even the complete OS is not even reachable though the network - through ping/ssh).

Since the later solution is more complex I focus my search for the source of these issues on the first solution.

To be clear, the solution runs for a while and then crashes.

What I verified:


- Power supply is powerfull enought
- There seems no interference WIFI/HDMI as I read somewhere.
- The OS is stable (without X server)
- There doesn't seem to be memory starvation
- There doesn't seem to be hardware temperature issues (below 60 degrees Celcius)

Settings:


Installation is straight forward:
- Raspian on microSD
- No keyboard/mouse attached
- HDMI to monitor (4K support)
- Setup using SSH

I've set my video settings in /boot/config.txt

Code: Select all

hdmi_cvt=3840 2160 30 0
Raspi-config:
- Under 3: Boot Options - B1 Desktop/CLI - choose B2 Con­sole Autolo­gin
- Under 7: Advanced Options - A3 Mem­o­ry Split - set to 128 MB
- Under 7: Advanced Options - A7 GL Dri­ver - set to G2 (Fake KMS)


Software I run:

Install Pi3D

Code: Select all

sudo pip3 install pi3d
wget https://github.com/pi3d/pi3d_demos/archive/master.zip && unzip master.zip && rm master.zip && mv pi3d_demos-master pi3d_demos
Then run it:

Code: Select all

cd pi3d_demos
sudo xinit /usr/bin/python3 /home/pi/pi3d_demos/Earth.py :0 -- -s off -dpms -s noblank
Wait for the crash :-S

P.s. I;'m running the raspberry pi as a picture frame: https://www.thedigitalpictureframe.com/ ... sing-pi3d/

What I'd like:
- Where should I start searching?
- What more could I try?
- Could this be a hardware failure?

basm
Posts: 7
Joined: Wed Sep 25, 2019 10:26 pm

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Fri Dec 06, 2019 9:23 pm

Since posting I’ve upgraded the Rpi firmware. To no avail. Xinit keeps crashing without any logs.

GlowInTheDark
Posts: 443
Joined: Sat Nov 09, 2019 12:14 pm

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Sat Dec 07, 2019 12:26 am

Have you made any changes to your .profile?

That can make X crash. Yes, it is very annoying.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
paddyg
Posts: 2521
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Sat Dec 07, 2019 9:15 am

@basm does it only crash when running pi3d? Also what form does the crash take? You say X stops which sounds like you drop back to command line.

PS what happens if you take out the hdmi_cvt out or only specify w,h,fps and not aspect ratio or set aspect ratio to 3 for 16:9. Don't know if screens can cope with any fps. I think 60Hz is standard.

Info here https://www.raspberrypi.org/documentati ... t/video.md about checking what settings your hdmi can use
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

basm
Posts: 7
Joined: Wed Sep 25, 2019 10:26 pm

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Sun Dec 08, 2019 8:40 pm

Hi @PaddyG good to see you here. Thanks for the reply.

- Fixed setting the 16:9 ratio (although it was working before).
- Re-ran raspi-config checked all settings
- Checked connections (HDMI port 0) used.

Where do I start debugging?


The crash means different things:

- The process exits, no console output, no apparent output in logs.
- Sometime after starting/running the PictureFrame.py file the network connections to the PI are dropped no ping and SSH connections are possible after this. Needs a hard reboot.


Setup details
- I run PictureFrame from Pi3D_demos repo (https://github.com/pi3d/pi3d_demos)
- Start the python script from a bash file (see below A)
- Start the bash file from crontab (see below B)

A-Start_PictureFrame.sh

Code: Select all

#!/bin/bash
#RPI3
#python3 /home/pi/PictureFrame/PictureFrame.py
#RPI4
sudo xinit /usr/bin/python3 /home/pi/PictureFrame/PictureFrame.py :0 -- -s off -dpms -s noblank > /home/pi/PictureFrame/Start_PictureFrame.sh.log
B-Crontab

Code: Select all

# Start Picture frame 
@reboot sleep 30 && /home/pi/PictureFrame/Start_PictureFrame.sh
Here is my /boot/config.txt

Code: Select all

# 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

#BME: custom settings
hdmi_cvt=3840 2160 30 3

# 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=95

# 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

[all]
dtoverlay=vc4-fkms-v3d
gpu_mem=128
#hdmi_enable_4kp60=1

basm
Posts: 7
Joined: Wed Sep 25, 2019 10:26 pm

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Mon Dec 09, 2019 9:15 am

I now have the following exception posted to the console on termination of xinit:

Code: Select all

DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

User avatar
paddyg
Posts: 2521
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Mon Dec 09, 2019 10:50 am

@basm, well at least there's some info being fed back. The error message looks like memory allocation running 4K see https://www.raspberrypi.org/forums/view ... 3&start=25 and others. However I think Wolfgang has run the PictureFrame app at 4K without it crashing - I don't know what RAM version he has, but think it's more than 1GB. I've got 1GB and it also runs OK *but* I have only tried it with the existing old screen that I have to connect with VGA and with the relatively small images in the pi3d_demos directory.

When testing the pictureframe app on different RPi computers we found that on the zero it did sometimes freeze when running with the xinit method. Not sure why but memory or processing power seemed likely, but as the zero can use the legacy bcm drivers witout X running that would always be the preferred option. But not possible on the RPi4.

So things I suggest you try to help pin down the cause:
1. Run pictureframe with only smaller images (what is the WxH of the photos in your show?) If you want I can give you a very simple python program to resize everything in a folder.
2. Around line 101 in PictureFrame.py

Code: Select all

tex = pi3d.Texture(im, blend=True, m_repeat=True, automatic_resize=...
try changing automatic_resize=False to see if that makes it worse or causes glitches, try also adding free_after_load=True (and all four permutations)
3. Switching BLUR_EDGES on and off
4. Running the screen at lower resolution if that's possible.

Let me know if anything makes any difference
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

basm
Posts: 7
Joined: Wed Sep 25, 2019 10:26 pm

Re: RPI 4B 1GB Xinit keeps stopping; running out of options...

Sun Dec 15, 2019 4:54 pm

So I’ve been running PictureFrame.py from pi3D demos for the last 7 days having upgraded every paackage involved.

There seems to be no more memory issues. Memory is released regularly.

I’ve added a crontab rule to stop PictureFrame and to kill all remaining Python3 scripts every night.

Stable so far.

Thanks for your help!

Kind regards,

Bas

Return to “General discussion”