balena-labs-projects / xserver

A simple X11 server block
Apache License 2.0
15 stars 13 forks source link

The app doesn't run in native resolution #27

Closed benjoboy closed 1 year ago

benjoboy commented 1 year ago

To the raspberry pi 4 we have connected a screen with resolution 1480x320.

The problem is that it display an image with black bar around it.

Docker-compose.yml:

version: '2.1'
volumes:
    # we create a shared volume so that the xserver can mount its socket file, and our application container will be able to use it to display
    xserver-volume:
services:
    xserver:
        image: balenablocks/xserver
        restart: always
        privileged: true
        volumes:
            # when we start, a UNIX socket is mounted in this directory, for communication to the X server
            - 'xserver-volume:/tmp/.X11-unix'
        labels:
            io.balena.features.dbus: 1
            io.balena.features.kernel-modules: 1
        environment:
            - DISPLAY_ORIENTATION=left
            - CURSOR=true
            - DISPLAY_RESOLUTION=1480x320
            - DISPLAY_RATE=30
    balena-electron:
        build: .
        restart: always
        privileged: true
        depends_on:
            - xserver
        # network_mode: host
        # ports:
        #     - 8080:8080
        volumes:
            # We will have access to the UNIX socket shared by xserver after it has started up.
            - 'xserver-volume:/tmp/.X11-unix'
        environment:
            # We need to specify which display we want to use for the X server. :0 is the first display that we have plugged in. This because there is no default display specified.
            - DISPLAY=:0
        group_add:
            - video
        labels:
            io.balena.features.dbus: 1
            io.balena.features.kernel-modules: 1
pbogaard commented 1 year ago

also experiencing this, would love a solution

benjoboy commented 1 year ago

I found a solution. When I flashed SD card and before first boot I attached it and edited config.txt. I added values:

hdmi_force_hotplug=1
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=4
disable_overscan=1

disable_overscan is the important value.

there are no black bars all around anymore.