![]() |
[Driver] juj fbcp ili9341 - Printable Version +- Freeplaytech Forum (https://forum.freeplaytech.com) +-- Forum: Freeplay Zero / Freeplay CM3 / Game Pie Advance (https://forum.freeplaytech.com/forumdisplay.php?fid=24) +--- Forum: Programming & Development (https://forum.freeplaytech.com/forumdisplay.php?fid=29) +--- Thread: [Driver] juj fbcp ili9341 (/showthread.php?tid=4989) |
[Driver] juj fbcp ili9341 - Porcinus - 07-20-2019 Before start warning: If you don't think you are able to do this, don't do it. Pre-compiled binary are available for FPZ/CM3 and maintain by Mootikins : https://github.com/Mootikins/FreeplayILI9341 I will try to summary the whole discussion with Slow Catalyst (https://forum.freeplaytech.com/showthread.php?tid=4931). I will add as much additional information as possible in case someone other need it. Clone juj driver repo thru SSH : Code: cd /home/pi/Freeplay/ Edit '/boot/config.txt' (Comment mean add # at beginning of the line): Comment all "dtoverlay=waveshare32b" Comment dtparam=spi=on Disable all services: Code: sudo systemctl stop fbcpCropped.service Restart the device (no picture, it is normal), then edit '/home/pi/Freeplay/fbcp-ili9341/config.h': Comment mean add // at beginning of the line, to uncomment, remove it. ALL_TASKS_SHOULD_DMA //to uncomment, as Mootikins pointed out, the one not really needed SAVE_BATTERY_BY_PREDICTING_FRAME_ARRIVAL_TIMES //to comment, framerate drop fix DISPLAY_FLIP_ORIENTATION_IN_SOFTWARE //to comment, I don't remember why SAVE_BATTERY_BY_SLEEPING_WHEN_IDLE //to comment, good catch kmacmart@darkcloud.ca Edit '/home/pi/Freeplay/fbcp-ili9341/freeplaytech_waveshare32b.h': This part is a bit tricky, juj driver doesn't support use of '/boot/freeplayfbcp.cfg'. If you are running fullscreen, set all value to 0. Otherwise take value for '/boot/freeplayfbcp.cfg': DISPLAY_NATIVE_COVERED_TOP_SIDE is left border of the screen DISPLAY_NATIVE_COVERED_LEFT_SIDE is top border of the screen DISPLAY_NATIVE_COVERED_RIGHT_SIDE is bottom border of the screen so 240-FREEPLAY_SCALED_H-FREEPLAY_SCALED_OFFSET_Y DISPLAY_NATIVE_COVERED_BOTTOM_SIDE is right border of the screen so 320-FREEPLAY_SCALED_W-FREEPLAY_SCALED_OFFSET_X Compiling: Follow Building and running section on juj repository, for cmake, as a test, you can use : cmake -DARMV8A=ON -DFREEPLAYTECH_WAVESHARE32B=ON -DSPI_BUS_CLOCK_DIVISOR=6 -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON -DUSE_DMA_TRANSFERS=ON -DSTATISTICS=0 .. Once started, you should get a output like this (took it from Slow Catalyst comment): Code: bcm_host_get_peripheral_address: 0x3f000000, bcm_host_get_peripheral_size: 16777216, bcm_host_get_sdram_address: 0xc0000000 if you see at the end "was assigned another peripheral map...", you will need to set DMA channels by hand, to do so, you need to choise channels with "is lite channel: 0, currently active: 0", in the example: 0,1,4,5 are available. Add before '..' (don't miss to add spaces before/after), -DDMA_TX_CHANNEL=1 -DDMA_RX_CHANNEL=5 Then recompile and rerun to check if this work. Important note: If you plan to use a emulator that use DMA (e.g. Reicast), please run it will the driver is still running into terminal to check if there is some possible conflicts. If the happen, the screen will goes black or white but not more update. Press Ctrl-C to kill the program then restart it with 'sudo /home/pi/Freeplay/fbcp-ili9341/build/fbcp-ili9341' to see what channels are still available. If not picture on the screen, try another channels. If this goes anywhere, revert back all modifications in "/boot/config.txt" then run 'sudo /home/pi/RetroPie/retropiemenu/dispMenu.sh' to set back the right display driver. If it work, two possibility : - edit '/etc/rc.local' and add before the line containing 'shutdown_daemon.py', in a new line : /home/pi/Freeplay/fbcp-ili9341/build/fbcp-ili9341 - run it as a service : https://forum.freeplaytech.com/showthread.php?tid=4989&pid=8737#pid8737 Restart the device I hope I didn't make any mistake, if so, post a reply and I will update the post ![]() RE: [Driver] juj fbcp ili9341 - Mootikins - 07-20-2019 Some input and notes; you do not need to do anything to ALL_TASKS_SHOULD_DMA since commenting the other 3 defines does the trick, you can copy the binary you build over the binary of your choice (fbcpCropped or fbcpFilled) instead of disabling the service and adding the binary to /etc/rc.local. You also don't usually have to troubleshoot DMA channels unless emulators you plan to use happen to require them. RE: [Driver] juj fbcp ili9341 - Porcinus - 07-20-2019 (07-20-2019, 05:21 AM)Mootikins Wrote: you do not need to do anything to ALL_TASKS_SHOULD_DMA since commenting the other 3 defines does the trickDidn't know that, thanks for pointing out ![]() Good point on DMA conflicts with emulator, I did have hard time figure out the problem when starting Reicast the first time. I didn't spoke about overwriting your builds because of next updates, since your build does integrate the freeplayfbcp.cfg part, it is a better way to go ![]() Note to anyone reading this, the original post is "A way to go, not THE way to go". RE: [Driver] juj fbcp ili9341 - Mootikins - 07-20-2019 (07-20-2019, 05:32 AM)Porcinus Wrote: I didn't spoke about overwriting your builds because of next updates, since your build does integrate the freeplayfbcp.cfg part, it is a better way to go This is actually not the case, there is no way to change the border sizes at runtime and the original driver (rpi-fbcp) has been implemented as a service named fbcpOld. Borders are integrated at compile time, so custom borders require building a new binary and replacing the original version. RE: [Driver] juj fbcp ili9341 - Porcinus - 07-20-2019 (07-20-2019, 05:39 AM)Mootikins Wrote: This is actually not the case, there is no way to change the border sizes at runtime and the original driver (rpi-fbcp) has been implemented as a service named fbcpOld. Borders are integrated at compile time, so custom borders require building a new binary and replacing the original version.Since juj driver doesn't run on kernel level, do you think it could be possible to implement your config parser into juj driver? To be honest, each time I test something, I recompile the driver with new sizes, no big deal but for users that don't have the knowledge to do so, this could be a big step ![]() RE: [Driver] juj fbcp ili9341 - kmacmart@darkcloud.ca - 07-24-2019 That fix worked like a charm-- I only did some brief tests, but I haven't hit any of the typical slowdowns since setting it up. Two small notes: 1. I made the assumption that you meant "SAVE_BATTERY_BY_SLEEPING_WHEN_IDLE" should be commented (your notes just mention that it's uncommented by default). 2. Rather than use rc.local, I created a systemd service at /etc/systemd/system/fbcpNoBatterySaving.service to keep more in line with the existing system: Code: [Unit] then enabled the service by running: Code: sudo systemctl daemon-reload Thanks a ton for doing the leg work on this, and I don't see why it wouldn't make sense to build this into the image (at least as an option). EDIT: I forgot to add that I also had to stop and disable the fbcpFilled.service (since I'm using the experimental filled driver) RE: [Driver] juj fbcp ili9341 - Porcinus - 07-24-2019 Good guide to setup as a service ![]() I am running most of my things that way but I didn't really know how to put it :S RE: [Driver] juj fbcp ili9341 - kmacmart@darkcloud.ca - 07-24-2019 Played around with it a bit more-- everything is so much better! Things I hadn't realized were stuttering like the main console selection menu and certain in game menus are silky smooth now. Assuming people are generally saving state and powering down after playing (or leaving it plugged in) this should definitely be the default mode for the driver. Thanks again Porcinus! RE: [Driver] juj fbcp ili9341 - Porcinus - 07-24-2019 Thanks ![]() Mootikins also added two CM3 binaries its repo that have the sleep turned off: https://forum.freeplaytech.com/showthread.php?tid=4988&pid=8738#pid8738 https://github.com/Mootikins/FreeplayILI9341 |