Pi4 digital marquee on HDMI2
-
Running Recalbox 8.1.1 on a Pi4 2GB with 2x displays attached via HDMI, I've been trying out showing images/video on the 2nd display.
When EmulationStation is not running this works well:
mpv --no-audio --vo=drm --drm-connector=1.HDMI-A-2 --loop /recalbox/share_init/system/tft_logos/320p/recalbox.png
And this works (HDMI1 display resolution is 1650x1080, so top-left corner of display on HDMI2 is (1650,0):
ffplay -left 1650 media/mame/asteroid.mp4
However, when ES is running, both of those commands fail with some variation of 'unable to initialise video device':
# mpv --no-audio --vo=drm --drm-connector=1.HDMI-A-2 --loop /recalbox/share_init/system/tft_logos/320p/recalbox.png (+) Video --vid=1 (png 320x240 1.000fps) [vo/drm] VT_GETMODE failed: Inappropriate ioctl for device [vo/drm] Failed to set up VT switcher. Terminal switching will be unavailable. [vo/drm] Cannot set CRTC: Permission denied Error opening/initializing the selected video_out (--vo) device. # ffplay -left 1650 media/mame/asteroid.mp4 ... Could not initialize SDL - No available video device (Did you set the DISPLAY variable?)
Is this because ES has exclusive access to the SDL device? And can anyone think of a workaround?
I can get it to work by writing direct to the single framebuffer device, but it's not ideal as my displays are using different resolutions.
-
I've done a bit more testing and it seems it is possible to display an image or video by writing to the framebuffer e.g.
fbv2 <image.png>
i.e. the same way that miniTFT support works.
The only problem is that with the default KMS graphics driver overlay
dtoverlay=vc4-kms-v3d
, both displays share the same framebuffer device, so the image shows on both displays.But it's only visible on the main display when EmulationStation isn't running. In practice you only see it for a brief second when launching a ROM (the time between ES exiting and the emulator launching) or exiting a game. It doesn't seem to break anything so I think I can probably live with that minor annoyance.
If anyone else is interested in this, when I've written some code I'm happy with I can stick it on github for others to use.
-