-
Notifications
You must be signed in to change notification settings - Fork 278
TinyPi #37
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
Comments
actually, hang fire!! I might have a technical issue with my casing!! just tried my standard retropie image from before I started tweaking code, and i have to hold it a set way for the screen to work!!! |
Ok so it was hardware, but I do have one request. The dst7789vw driver is designed for the wave share board, so the screen is 90 degrees out from 'standard' usage with the chip at the bottom. Is there any way to fix that without having to resort to rotating the entire os in the /boot/config ? |
Great to hear TinyPi is going well! To rotate the image, there are a couple of options. One is to adjust the display from landscape to portrait: diff --git a/config.h b/config.h
index ced2b29..f82fb3e 100644
--- a/config.h
+++ b/config.h
@@ -159,7 +159,7 @@
// If defined, displays in landscape. Undefine to display in portrait. When changing this, swap
// values of DISPLAY_WIDTH and DISPLAY_HEIGHT accordingly
-#define DISPLAY_OUTPUT_LANDSCAPE
+// #define DISPLAY_OUTPUT_LANDSCAPE This should produce a 90 degrees flip in one direction. If it flips to the wrong side and is upside down, you can also pass That being said, I don't recall if I ever tested these flags with ST7789, but they should be hooked up to control orientation on that display as well. If that does not work, you can also directly adjust the madctl register in st7735r.cpp that governs st7789 support: Lines 42 to 69 in df4d5db
where adding a line like madctl ^= MADCTL_ROW_COLUMN_EXCHANGE | MADCTL_ROW_ADDRESS_ORDER_SWAP; or madctl ^= MADCTL_ROW_COLUMN_EXCHANGE | MADCTL_COLUMN_ADDRESS_ORDER_SWAP; just before line Line 69 in df4d5db
|
Awesomesauce!!! Thanks for getting back to me, i will try this and let you know :) |
A curious note if you like to be picky/golden hi-fi eyes about vsync tearing, then running with madctl register set to 0 on each of the three orientation bits is the configuration that produces least visual tearing, since in that mode, the panel pixel refresh scan order should match with the memory read order, i.e. madctl &= ~(MADCTL_ROW_COLUMN_EXCHANGE | MADCTL_COLUMN_ADDRESS_ORDER_SWAP | MADCTL_ROW_ADDRESS_ORDER_SWAP); to kill the all of the three bits from being set, before line 69 that sets madctl. That should show the "native direction" of the panel, in case if you have custom control over which way to install it into your enclosure. If you prefer the diagonal tearing artifact over straight line tearing, that occurs when running with (Having either |
that solved my rotation and does seem to reduce the tiny bit of tearing i was seeing before. I am however getting a little bit of choppy audio which i am assuming is linked to the USE_GPU_VSYNC issue. do i just comment that define out? (please accept cat tax in video as payment in advance for help :P ) |
The audio choppiness is caused by fbcp-ili9341 consuming too much CPU, and there is not enough time for other programs, such as the audio driver, to operate. This is unfortunate on the single core boards, it needs to be quite careful about performance. Check out the section https://github.com/juj/fbcp-ili9341#tuning-cpu-usage about improving performance. In particular, for Pi Zero:
|
When toying around with NES and SNES emulators, I do recall NES emulators were orders of magnitude lighter to run, compared to SNES. So it may worth sanity checking that NES emulators run with good performance first, to establish a baseline. SNES performance was quite on the edge for Pi Zero if targeting 60fps. Fbcp-ili9341 consumes around ~14-17% of CPU time on Pi Zero when playing fast-paced SNES games if I remember correctly - that was too much for some SNES emulators to not be able to keep up. Another measure may be to lower fbcp-ili9341 process priority by editing Line 60 in 0e1643a
and change Line 63 in 6481f92
in config.h to enable the option. (haven't tried it myself, but this might help establish a priority below the emulator) |
I tried setting the priority on line 60, and now I'm getting this error
Do I need to change every instance of FIFO to IDLE? |
Ok so I answered my own question after reading the code again. I don't think setting the lower priority is the way to go, it ends up like 2 FPS, and still choppy on the audio |
Hmm, looking at the video, it seems that perhaps the priority did still end up being elevated, instead of lowered. Not quite sure. There are also some programs like nice on Linux that can control process priorities, though have not tested if they work on a Pi. It may be the case that for the more demanding applications, lowering Lines 140 to 142 in 6481f92
(although that may be inferior in performance to adjusting |
I have dropped the TARGET_FRAME_RATE down to 30, and put the priority back as it was. Im now using the driver on retropie with no issues, i think the issues i was having before was actually more of a lakka issue than your driver, as it works with the same game on retropie great!! I think its working fine now. Such a great little driver too!! will make deploying versions of the OS nice and easy :) |
Great! I'll close this as resolved. Perhaps lakka distribution has some background process that it needs that takes up a bit more of CPU, or a different build or emulator it uses on games. |
Howdy @juj
I thought i would give your code a bit of the old college try on my TinyPi Pro board. It is using a ST7789 screen which looks much like the one on the 1.3" waveshare board (actual screen is here https://www.aliexpress.com/item/1-3-inch-white-light-full-view-SPI-OLED-LCD-SSD1306-drive-IC-128-64-not/1609778123.html) mounted on a custom board, and i have been using the notro flexfb driver with great success, using the following modprobe lines
modprobe fbtft_device name=flexfb speed=32000000 gpios=reset:25,dc:24 modprobe flexfb width=240 height=240 init=-1,0x11,-2,120,-1,0x36,0x00,-1,0x3A,0x05,-1,0xB2,0x0C,0x0C,0x00,0x33,0x33,-1,0xB7,0x35,-1,0xBB,0x1A,-1,0xC0,0x2C,-1,0xC2,0x01,-1,0xC3,0x0B,-1,0xC4,0x20,-1,0xC6,0x0F,-1,0xD0,0xA4,0xA1,-1,0x21,-1,0xE0,0x00,0x19,0x1E,0x0A,0x09,0x15,0x3D,0x44,0x51,0x12,0x03,0x00,0x3F,0x3F,-1,0xE1,0x00,0x18,0x1E,0x0A,0x09,0x25,0x3F,0x43,0x52,0x33,0x03,0x00,0x3F,0x3F,-1,0x29,-3
I have spent the best part of a day trying to get your code to work, and im sure i must be doing something silly, but im struggling to put my finger on it. At first i though it was down to the fact that i had some old fbtft settings lying about somewhere, so i have got a fresh copy of retropie today, and installed nothing but your code to make sure there are no conflicts, and im still struggling.
I would like to think i know what im doing in this area, but alas no screen yet!!
My cmake code is as follows
cmake -DST7789VW=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=10 -DUSE_DMA_TRANSFERS=OFF ..
have tried various combinations of divisor and dma and such to no avail. even adding pi zero specific options to see if that helps!!
Any chance you could cast an eye over my config, see if you can spot anything obvious?
Many thanks
Pete
The text was updated successfully, but these errors were encountered: