-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispmanx API stops working after HDMI resolution change #461
Comments
Searching the web for related discussions, this link suggests that calling pi@retropie:~ $ tvservice -s
state 0x12000a [HDMI DMT (87) RGB full 4:3 x4], 320x240 @ 59.00Hz, progressive
pi@retropie:~ $ ./test
Data: 1388129224
pi@retropie:~ $ tvservice --explicit="DMT 87 HDMI"
Powering on HDMI with explicit settings (DMT mode 87)
pi@retropie:~ $ tvservice -s
state 0x12000a [HDMI DMT (87) RGB full 4:3 x4], 320x240 @ 59.00Hz, progressive
pi@retropie:~ $ ./test
Data: 0
pi@retropie:~ $ fbset -depth 8 && fbset -depth 16
pi@retropie:~ $ ./test
Data: 0
pi@retropie:~ $ vcgencmd display_power
display_power=1
pi@retropie:~ $ fbset
mode "320x240"
geometry 320 240 320 240 16
timings 0 0 0 0 0 0 0
rgba 5/11,6/5,5/0,0/16
endmode is no luck unfortunately. Attempting some combos of |
Sorry about delay on this - just going through the backlog and found it. This is expected behaviour if using tvservice on its own. When the HDMI mode is changed, dispmanx discards all framebuffers etc to do with the mode as sizes etc will have changed. This results in a blank screen, both on HDMI but also, I believe, any snapshots. To get dispmanx to reinitilaise all the required buffers, and get HDMI displaying again, you need to run As an example, check out the way omxplayer does this - see the script that runs it for details, |
Just got a my TFT working on the newest copy of buster .. I have a 320x240 SPI Serial ILI9341 from amazon and compiled using the command .. It works like a charm so for those f you with this screen it works my config text has the fake dtoverlay=vc4-fkms-v3d for hdmi and Took me about 10 minutes after I found a wiring setup that it liked as I have other hardware installed 2 OLE displays and a RTC that default wiring kept interfering with. |
Buster is deprecated, as is DispmanX. There is a TinyDRM driver for ILI9341 panels, and an overlay on https://github.com/6by9/linux/tree/rpi-6.1.y-tinydrm that will configure and load it ( |
Sorry didn't mean buster... I meant to type bookworm... I use my system headless and watch this little console for Cava to display my sound bar graphs |
I've been poking on a project that fits a Raspberry Pi 3 CM inside the shell of a Gameboy Advance (video), running a Waveshare32b SPI based display. In this configuration, there is no display connected to HDMI, but instead I run a custom software driver fbcp-ili9341 that interfaces with the dispmanx API to grab framebuffer display and push the pixel data out to SPI.
One issue that is happening is that it looks like the
dispmanx_
APIs stop working if the system changes resolution, by an application, or also when changed viatvservice
command line interface. To reproduce, trytest.cpp
and build with
g++ test.cpp -o test -I/opt/vc/include -L/opt/vc/lib -lbcm_host
.Running with the following
/boot/config.txt
for display configuration:and after boot of the Pi, with no HDMI display connected, no applications open but the Pi open in console, the above test code gives
which is good, the application was able to capture some pixel data.
However, the following scenarios cause the above test code to begin to fail:
Change resolution
Here after changing the display mode, dispmanx snapshots no longer work but start to return black frames.
Change resolution, but change it back to original
Changing resolution back to "what was working originally" 320x240 does not restore dispmanx to work:
Change resolution to what is already set
It looks like changing the resolution to the same mode that is already currently set causes dispmanx to start outputting black as well:
Powering HDMI off and then on
causes dispmanx to no longer initialize.
Are the above scenarios expected to work? Or I wonder if the relationship between
tvservice
anddispmanx
is not as 1:1, but there's some initialization/setup steps missing when changing the display?Also, what is the role of
tvservice
versus other methods for changing the HDMI display resolution? Istvservice
the utility through which all applications must go when switching display modes, or are there other utilities? (I wonder if the above test method is flawed for example iftvservice
should not be used in this kind of way, or something similar)Thanks for reading through, any suggestions would be most welcome!
The text was updated successfully, but these errors were encountered: