seanshpark / help

common help
MIT License
4 stars 0 forks source link

Raspberry Pi 3 Graphics #7

Closed seanshpark closed 6 years ago

seanshpark commented 6 years ago

Have problem with RPi3 graphics from console,

seanshpark commented 6 years ago

Comment out this line in /boot/config.txt

# dtoverlay=vc4-kms-v3d

Save, reboot and try again.

googling showed that currently it's an experimental OpenGL driver.

seanshpark commented 6 years ago

SDL2 build from source

sudo apt-get install libudev-dev
../configure --prefix=/opt/rpi \
--disable-pulseaudio --disable-esd --disable-video-mir \
--disable-video-wayland --disable-video-x11 --without-x \
--disable-video-opengl --disable-video-vulkan \
--enable-video-opengles --enable-video-opengles1 \
--enable-video-opengles2 \
--enable-video-rpi \
--enable-video-directfb

make
sudo make install

set environment to rpi

export SDL_VIDEODRIVER=rpi
seanshpark commented 6 years ago

Existing issues

seanshpark commented 6 years ago

Read https://elinux.org/Raspberry_Pi_VideoCore_APIs

seanshpark commented 6 years ago

With DirectFB, export SDL_VIDEODRIVER=directfb

DirectFB/fbdev/vt: Unable to restore VT mode!!!

--> it's called when shutdown. https://github.com/djbclark/directfb-core-DirectFB/blob/master/systems/fbdev/vt.c

DFBResult
dfb_vt_shutdown( bool emergency )

Another error right before this:

Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0]
[1434: 0.000] --> Caught signal 1 (sent by the kernel)

Run again with second virtual console by pressing ALT-F2.

seanshpark commented 6 years ago
$ cat ~/.directfbrc
mode=1024x768
depth=16
pixelformat=RGB16

Changes resolution , still no rectangle

seanshpark commented 6 years ago

One solution is to change video resolution at boot time. edit /boot/config.txt and change settings;

hdmi_group=2
hdmi_mode=16

This will change to 1024x768 60Hz

set video to RPi

export SDL_VIDEODRIVER=rpi

Run the program.

seanshpark commented 6 years ago

There exist a program that can change resolution

Change to 1024x768 60Hz

tvservice -e "DMT 16"

Change to prefered, (default?)

tvservice -p

or

tvservice -e "DMT 82"

Problem: screen is on but blank, nothing is shown. Chaging to another virtual screen (ALT-Fx) solves.

seanshpark commented 6 years ago

Added to https://github.com/seanshpark/help/wiki/Graphics page.