• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Rpi5: Waveshare display mipi-dbi-spi overlay

Scheduled Pinned Locked Moved Help and Support
mipi-dbi-spi
10 Posts 2 Posters 1.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    mcpat
    last edited by mcpat 1 Jan 2024, 14:59 1 Jan 2024, 14:38

    Hi,

    I try to get my waveshare display running with latest rasbian on my rpi5. Compilation works and everything is working on HDMI, but I don't have any idea how to get my display working.

    Acc. to this link, I have this config.txt parts

    # Enable DRM VC4 V3D driver
    dtoverlay=vc4-kms-v3d
    max_framebuffers=2
    
    # waveshare 1.3in - 240x240pixel - SKU19650
    dtoverlay=mipi-dbi-spi,speed=32000000
    dtparam=compatible=wavesku19650\0panel-mipi-dbi-spi
    dtparam=write-only,cpha,cpol
    dtparam=width=240,height=240,width-mm=23,height-mm=23
    dtparam=reset-gpio=23,dc-gpio=25,backlight-gpio=24
    

    I can see the console on the display, and if I start emulationstation nothing happens on the display. HDMI is working well...

    I tried to compile my own mesa and drm acc. to link and patched it acc. Link

    diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build
    index fbec1da957b..59daf3b6fb6 100644
    --- a/src/gallium/targets/dri/meson.build
    +++ b/src/gallium/targets/dri/meson.build
    @@ -68,6 +68,9 @@ libgallium_dri = shared_library(
     
     foreach d : [[with_gallium_kmsro, [
                    'armada-drm_dri.so',
    +               'drm-rp1-dpi_dri.so',
    +               'drm-rp1-dsi_dri.so',
    +               'drm-rp1-vec_dri.so',
                    'exynos_dri.so',
                    'hx8357d_dri.so',
                    'ili9225_dri.so',
    diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c
    index d506869cbb4..ecb25edd03b 100644
    --- a/src/gallium/targets/dri/target.c
    +++ b/src/gallium/targets/dri/target.c
    @@ -98,6 +98,9 @@ DEFINE_LOADER_DRM_ENTRYPOINT(tegra);
     
     #if defined(GALLIUM_KMSRO)
     DEFINE_LOADER_DRM_ENTRYPOINT(armada_drm)
    +DEFINE_LOADER_DRM_ENTRYPOINT(drm_rp1_dpi)
    +DEFINE_LOADER_DRM_ENTRYPOINT(drm_rp1_dsi)
    +DEFINE_LOADER_DRM_ENTRYPOINT(drm_rp1_vec)
     DEFINE_LOADER_DRM_ENTRYPOINT(exynos)
     DEFINE_LOADER_DRM_ENTRYPOINT(hx8357d)
     DEFINE_LOADER_DRM_ENTRYPOINT(ili9225)
    

    What I see with command drmdevice:

    --- Checking the number of DRM device available ---
    --- Devices reported 3 ---
    --- Retrieving devices information (PCI device revision is ignored) ---
    device[0]
    +-> available_nodes 0x01
    +-> nodes
    |   +-> nodes[0] /dev/dri/card2
    +-> bustype 0002
    |   +-> platform
    |       +-> fullname    /axi/pcie@120000/rp1/spi@50000/panel@0
    +-> deviceinfo
        +-> platform
            +-> compatible
                        wavesku19650
                        panel-mipi-dbi-spi
    
    --- Opening device node /dev/dri/card2 ---
    --- Retrieving device info, for node /dev/dri/card2 ---
    device[0]
    +-> available_nodes 0x01
    +-> nodes
    |   +-> nodes[0] /dev/dri/card2
    +-> bustype 0002
    |   +-> platform
    |       +-> fullname    /axi/pcie@120000/rp1/spi@50000/panel@0
    +-> deviceinfo
        +-> platform
            +-> compatible
                        wavesku19650
                        panel-mipi-dbi-spi
    

    As written, I hope someone can help here how to get Retropie running on this display...

    M 1 Reply Last reply 2 Jan 2024, 06:05 Reply Quote 0
    • M
      mitu Global Moderator @mcpat
      last edited by 2 Jan 2024, 06:05

      I can see the console on the display, and if I start emulationstation nothing happens on the display. HDMI is working well...

      Not sure what do you expect to show up on the display... ? Though 240x240 is a bit too small for EmulationStation/games to work, I assume you want to use it as a secondary display ?

      AFAIK this won't work without a desktop environment (Wayland/Xorg), where you choose how the 2nd display is working (mirror, extend, etc.).

      M 1 Reply Last reply 3 Jan 2024, 11:17 Reply Quote 0
      • M
        mcpat @mitu
        last edited by 3 Jan 2024, 11:17

        @mitu It's a fun project. I 3d printed a small tv, and want there the output. I know it's very small, but would be great if it works. So you think it only works with desktop (wayland)? No chance to get in running without desktop? I started retroarch from command line without any parameter, this shows something on the display, but too small to see what. So why doesn't emulationstation use this screen? I have this setup running on a rpi zero 2w with fbcp and this is running.

        M 1 Reply Last reply 3 Jan 2024, 11:30 Reply Quote 0
        • M
          mitu Global Moderator @mcpat
          last edited by 3 Jan 2024, 11:30

          @mcpat said in Rpi5: Waveshare display mipi-dbi-spi overlay:

          So you think it only works with desktop (wayland)? No chance to get in running without desktop?

          Only if you want to use both displays at the same time. You can disable the HDMI port and use only the waveshare one - it should be the main display in this case.

          M 1 Reply Last reply 3 Jan 2024, 11:54 Reply Quote 0
          • M
            mcpat @mitu
            last edited by 3 Jan 2024, 11:54

            @mitu ok, but you mean with desktop, right? Not in command line?

            M 1 Reply Last reply 3 Jan 2024, 12:13 Reply Quote 0
            • M
              mitu Global Moderator @mcpat
              last edited by 3 Jan 2024, 12:13

              @mcpat said in Rpi5: Waveshare display mipi-dbi-spi overlay:

              @mitu ok, but you mean with desktop, right? Not in command line?

              If you disable the HDMI, then it won't matter whether if you have a desktop or not available - there's just 1 single/main display.

              M 1 Reply Last reply 3 Jan 2024, 13:43 Reply Quote 0
              • M
                mcpat @mitu
                last edited by mcpat 1 Mar 2024, 13:44 3 Jan 2024, 13:43

                @mitu if I disable in 'config.txt'

                #dtoverlay=vc4-kms-v3d
                

                I see the command line on the display but mpv is not running anymore but emulationstation is running

                root@rpi5:~#  mpv --drm-connector=help
                Available connectors for card 0 (/dev/dri/card0):
                  SPI-1 (connected)
                
                root@rpi5:~# mpv  --drm-device=/dev/dri/card0 --no-audio /opt/videos/simpsons.mp4
                 (+) Video --vid=1 (*) (h264 640x480 25.000fps)
                     Audio --aid=1 --alang=deu (*) (aac 1ch 48000Hz)
                [vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
                [vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                [vo/gpu] Failed to create GBM surface.
                [vo/gpu] Failed to setup GBM.
                [vo/gpu-next] Can't handle VT release - signal already used
                [vo/gpu-next/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                [vo/gpu-next] Failed to create GBM surface.
                [vo/gpu-next] Failed to setup GBM.
                * failed to open vchiq instance
                

                If I disconnect HDMI cable and use in 'config.txt'

                dtoverlay=vc4-kms-v3d
                

                mpv is running but emulationstation not:

                root@rpi5:~# emulationstation
                * failed to open vchiq instance
                
                
                root@rpi5:~#  mpv --drm-connector=help                                          
                Available connectors for card 0 (/dev/dri/card2):
                  SPI-1 (connected)
                
                Available connectors for card 1 (/dev/dri/card1):
                  HDMI-A-1 (disconnected)
                  HDMI-A-2 (disconnected)
                
                Available connectors for card 2 (/dev/dri/card0):
                Cannot retrieve DRM resources: Operation not supported
                
                root@rpi5:~# mpv  --drm-device=/dev/dri/card2 --no-audio /opt/videos/simpsons.mp4
                 (+) Video --vid=1 (*) (h264 640x480 25.000fps)
                     Audio --aid=1 --alang=deu (*) (aac 1ch 48000Hz)
                [vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
                [vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                VO: [gpu] 640x480 yuv420p
                V: 00:00:07 / 00:22:15 (1%)
                
                root@rpi5:~# mpv  --drm-device=/dev/dri/card0 --no-audio /opt/videos/simpsons.mp4
                 (+) Video --vid=1 (*) (h264 640x480 25.000fps)
                     Audio --aid=1 --alang=deu (*) (aac 1ch 48000Hz)
                [vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
                [vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                [vo/gpu/opengl] Cannot retrieve DRM resources: Operation not supported
                [vo/gpu/opengl] Failed to create KMS.
                [vo/gpu-next] Can't handle VT release - signal already used
                [vo/gpu-next/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                [vo/gpu-next/opengl] Cannot retrieve DRM resources: Operation not supported
                [vo/gpu-next/opengl] Failed to create KMS.
                * failed to open vchiq instance
                

                And a side effect, vlc (cvlc) is not running on display, it doesn't matter which parameter I use, and if vc4 is enabled or not...

                1 Reply Last reply Reply Quote 0
                • M
                  mitu Global Moderator
                  last edited by mitu 1 Mar 2024, 13:53 3 Jan 2024, 13:50

                  Selectively enabling/disabling the KMS/DRM drivers via config.txt doesn't work for EmulationStation. If RetroPie-Setup detects no KMS active, then ES will be mis-compiled without KMS/DRM support and if you enable it back again in config.txt, the resulting binary will not work.
                  Don't disable the KMS overlay, you'll not have any GPU accelerated rendering.

                  I'm not familiar with mpv, for my needs cvlc - as distributed by RaspiOS - has worked well enough via CLI when using KMS.

                  M 2 Replies Last reply 3 Jan 2024, 22:03 Reply Quote 0
                  • M
                    mcpat @mitu
                    last edited by 3 Jan 2024, 22:03

                    @mitu I didn't recompile. I compiled with active KMS/DRM. I only disabled for testing. So the behaviour describted above was always with the same file. I will try with the overlay option "nohdmi", maybe then emulationstation will also show on the display. Maybe if I move the mipi-dpi overlay before vc4 then the display is the primary?!

                    1 Reply Last reply Reply Quote 0
                    • M
                      mcpat @mitu
                      last edited by mcpat 1 Jul 2024, 11:29 7 Jan 2024, 11:22

                      @mitu I tried now with config.txt

                      dtoverlay=vc4-kms-v3d,nohdmi
                      

                      and emulationstation and mpv are working on display! (Only vlc makes troubles)

                      root@rpi5:/opt/videos# mpv --no-audio  simpsons.mp4
                       (+) Video --vid=1 (*) (h264 640x480 25.000fps)
                           Audio --aid=1 --alang=deu (*) (aac 1ch 48000Hz)
                      [vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
                      [vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
                      VO: [gpu] 640x480 yuv420p
                      V: 00:05:28 / 00:22:15 (25%)
                      
                      root@rpi5:/opt/videos#  mpv --drm-connector=help
                      Available connectors for card 0 (/dev/dri/card2):
                        SPI-1 (connected)
                      
                      Available connectors for card 1 (/dev/dri/card1):
                      
                      Available connectors for card 2 (/dev/dri/card0):
                      Cannot retrieve DRM resources: Operation not supported
                      
                      root@rpi5:/opt/videos# drmdevice
                      --- Checking the number of DRM device available ---
                      --- Devices reported 3 ---
                      --- Retrieving devices information (PCI device revision is ignored) ---
                      device[0]
                      +-> available_nodes 0x01
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card2
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/pcie@120000/rp1/spi@50000/panel@0
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          wavesku19650
                                          panel-mipi-dbi-spi
                      
                      --- Opening device node /dev/dri/card2 ---
                      --- Retrieving device info, for node /dev/dri/card2 ---
                      device[0]
                      +-> available_nodes 0x01
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card2
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/pcie@120000/rp1/spi@50000/panel@0
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          wavesku19650
                                          panel-mipi-dbi-spi
                      
                      device[1]
                      +-> available_nodes 0x01
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card1
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/gpu
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          brcm,bcm2712-vc6
                      
                      --- Opening device node /dev/dri/card1 ---
                      --- Retrieving device info, for node /dev/dri/card1 ---
                      device[1]
                      +-> available_nodes 0x01
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card1
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/gpu
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          brcm,bcm2712-vc6
                      
                      device[2]
                      +-> available_nodes 0x05
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card0
                      |   +-> nodes[2] /dev/dri/renderD128
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/v3d@2000000
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          brcm,2712-v3d
                      
                      --- Opening device node /dev/dri/card0 ---
                      --- Retrieving device info, for node /dev/dri/card0 ---
                      device[2]
                      +-> available_nodes 0x05
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card0
                      |   +-> nodes[2] /dev/dri/renderD128
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/v3d@2000000
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          brcm,2712-v3d
                      
                      --- Opening device node /dev/dri/renderD128 ---
                      --- Retrieving device info, for node /dev/dri/renderD128 ---
                      device[2]
                      +-> available_nodes 0x05
                      +-> nodes
                      |   +-> nodes[0] /dev/dri/card0
                      |   +-> nodes[2] /dev/dri/renderD128
                      +-> bustype 0002
                      |   +-> platform
                      |       +-> fullname    /axi/v3d@2000000
                      +-> deviceinfo
                          +-> platform
                              +-> compatible
                                          brcm,2712-v3d
                      
                      1 Reply Last reply Reply Quote 0
                      • J josdelsan referenced this topic on 28 Mar 2024, 13:29
                      10 out of 10
                      • First post
                        10/10
                        Last post

                      Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                      Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                        This community forum collects and processes your personal information.
                        consent.not_received