0

Raspberry Pi OS 64-bit and PiTFT
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Tue Sep 07, 2021 12:51 am

Has anyone gotten HDMI mirroring working with the 64-bit beta releases?

I have gotten console output working fine, but I can't get HDMI output mirroring to work, I'm just getting a blank screen with a white underscore in the top-left corner. If i stop the service outputting to fb0, the console appears again.

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by mikeysklar on Tue Sep 07, 2021 8:29 pm

I've seen a success story using a Mini PiTFT with the a 64-bit Pi OS.

https://service.robots.org.nz/wiki/Wiki ... tMiniPiTFT

mikeysklar
 
Posts: 5785
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Tue Sep 14, 2021 1:19 pm

yes i saw that. I checked github and it looks like the tslib issue was resolved in the installer script as well so that is no longer an issue.

it seems more an issue with fbcp and hdmi mirroring than anything else. displaying the console works just fine.

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by mikeysklar on Tue Sep 14, 2021 4:04 pm

Is there any clue in dmesg as to what is occurring when the using fbcp?

What resolution are you running are you set to?

Have you tried running in safe mode ( /boot/config.txt : hdmi_safe=1 ).

mikeysklar
 
Posts: 5785
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Tue Sep 14, 2021 4:07 pm

mikeysklar wrote:Is there any clue in dmesg as to what is occurring when the using fbcp?

What resolution are you running are you set to?

Have you tried running in safe mode ( /boot/config.txt : hdmi_safe=1 ).


I’ll post a dmesg tonight. I didn’t run hdmi safe mode yet but I will give it a shot when I get home and report back. Thanks

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Wed Sep 15, 2021 12:28 pm

hdmi_safe didn't seem to change anything even after rebooting and i'm not seeing anything in dmesg

here's some related logs:

dmesg : https://hastebin.com/raw/jihatelapo
klipperscreen.log : https://hastebin.com/raw/picejasifo
journalctl : https://hastebin.com/raw/ugibikajan

looks like in journalctl xinit is failing to create the screen:

Code: Select all | TOGGLE FULL SIZE
Sep 15 17:20:57 raspberrypi xinit[714]: libGL error: failed to create dri screen
Sep 15 17:20:57 raspberrypi xinit[714]: libGL error: failed to load driver: vc4
Sep 15 17:20:58 raspberrypi xinit[714]: libGL error: failed to create dri screen
Sep 15 17:20:58 raspberrypi xinit[714]: libGL error: failed to load driver: vc4


update: resolved

oh i fixed it. /boot/config.txt, dtoverlay needs to read: dtoverlay=vc4-fkms-v3d

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by mikeysklar on Wed Sep 15, 2021 4:05 pm

Okay, Fake KMS for the win.

It looks like our adafruit-pitft.py fbcp_install() code actually comments it out of config.txt.

https://github.com/adafruit/Raspberry-P ... t-pitft.py

Code: Select all | TOGGLE FULL SIZE
    # Disable overscan compensation (use full screen):
    shell.run_command("raspi-config nonint do_overscan 1")
    # Set up HDMI parameters:
    print("Configuring boot/config.txt for forced HDMI")
    shell.reconfig("/boot/config.txt", "^.*hdmi_force_hotplug.*$", "hdmi_force_hotplug=1")
    shell.reconfig("/boot/config.txt", "^.*hdmi_group.*$", "hdmi_group=2")
    shell.reconfig("/boot/config.txt", "^.*hdmi_mode.*$", "hdmi_mode=87")
    shell.pattern_replace("/boot/config.txt", "^[^#]*dtoverlay=vc4-fkms-v3d.*$", "#dtoverlay=vc4-fkms-v3d")

mikeysklar
 
Posts: 5785
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Wed Sep 15, 2021 4:48 pm

mikeysklar wrote:Okay, Fake KMS for the win.

It looks like our adafruit-pitft.py fbcp_install() code actually comments it out of config.txt.

https://github.com/adafruit/Raspberry-P ... t-pitft.py

Code: Select all | TOGGLE FULL SIZE
    # Disable overscan compensation (use full screen):
    shell.run_command("raspi-config nonint do_overscan 1")
    # Set up HDMI parameters:
    print("Configuring boot/config.txt for forced HDMI")
    shell.reconfig("/boot/config.txt", "^.*hdmi_force_hotplug.*$", "hdmi_force_hotplug=1")
    shell.reconfig("/boot/config.txt", "^.*hdmi_group.*$", "hdmi_group=2")
    shell.reconfig("/boot/config.txt", "^.*hdmi_mode.*$", "hdmi_mode=87")
    shell.pattern_replace("/boot/config.txt", "^[^#]*dtoverlay=vc4-fkms-v3d.*$", "#dtoverlay=vc4-fkms-v3d")


It doesn’t look like fkvms was in my boot config for the 64bit OS. I’ll drop my other sdcard in with 32bit raspbian to see if it’s there.

I’ll add a check for architecture to apply what’s needed and send a PR on GitHub.

What’s the best way to get persistent touchscreen calibration across reboots? I’ve tried adding lcd_rotate, display_rotate, and rotate to boot config to no effect intending to just rotate the touchscreen and display and bypass calibration.

I do have it working well now with a transformation matrix but the touchscreen needs a slight calibration to be more accurate. I’m guessing I need to add the values obtained by tslib calibration to a calibration matrix as well?

Specifically I want to keep the values obtained from the touchscreen calibration documented here using tslib: https://learn.adafruit.com/adafruit-pit ... -calibrate

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by mikeysklar on Thu Sep 16, 2021 11:24 am

Thank you for your offer to submit a PR for the 64-bit arch. That will be appreciated.

Are you running X? If so xtcal has a config file you can use to save your calibration adjustment under "transformation matrix".

/usr/share/X11/xorg.conf.d/20-calibration.conf

Code: Select all | TOGGLE FULL SIZE
Section "InputClass"
        Identifier "STMPE Touchscreen Calibration"
        MatchProduct "stmpe"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "TransformationMatrix" "-0.000087 1.094214 -0.028826 -1.091711 -0.004364 1.057821 0 0 1"
EndSection


mikeysklar
 
Posts: 5785
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

by jtw6168 on Fri Sep 17, 2021 12:40 am

mikeysklar wrote:Thank you for your offer to submit a PR for the 64-bit arch. That will be appreciated.

Are you running X? If so xtcal has a config file you can use to save your calibration adjustment under "transformation matrix".

/usr/share/X11/xorg.conf.d/20-calibration.conf

Code: Select all | TOGGLE FULL SIZE
Section "InputClass"
        Identifier "STMPE Touchscreen Calibration"
        MatchProduct "stmpe"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "TransformationMatrix" "-0.000087 1.094214 -0.028826 -1.091711 -0.004364 1.057821 0 0 1"
EndSection



hm running xtcal gives a white screen with single red vertical lines.. not plus signs. not sure what's causing that. adjusting resolution didn't help

jtw6168
 
Posts: 6
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

by mikeysklar on Fri Sep 17, 2021 11:33 am

It looks like xtcal needs a bit of help on some distributions to get going.

There is a helpful post on a github issues thread about what one user did to solve this. They actually got the coordinates from a fresh 32-bit install and then brought the saved settings back into a distrobution that can't run xtcal (octopi). You might have to follow some of the queues here.

https://github.com/Z-Bolt/OctoScreen/issues/102

You need to run xtcal, you can't run xtcal because it won't run on OctoPi or OctoScreen. I had to get a second SD Card and install full Raspbian and follow these steps.

Install Raspbian
Install Touchscreen Drivers

You should now see the Raspbian Desktop on your touchscreen.

sudo apt-get install libxaw7-dev libxxf86vm-dev libxaw7-dev libxft-dev
git clone https://github.com/KurtJacobson/xtcal
cd xtcal
make

Clear current touch coordinates.
DISPLAY=:0.0 xinput set-prop "stmpe-ts" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1

Run xtcal and touch the + on the screen
DISPLAY=:0.0 ~/xtcal/xtcal -geometry 720x480

On the Raspbian install it will autosave so you can reboot the Raspbian install and test the coordinates out before you switch over and apply them to octoscreen.

Take the coordinates it gives you and put them into this file on your OctoScreen install.
sudo nano /usr/share/X11/xorg.conf.d/20-calibration.conf

Section "InputClass"
Identifier "STMPE Touchscreen Calibration"
MatchProduct "stmpe"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "TransformationMatrix" "-0.007882 -1.094303 1.033443 1.132679 0.078381 -0.170031 0 0 1"
EndSection
reboot

If you are using a 2.4"/2.8"/3.2" 320x240 display with landscape orientation, use 640x480. If you're in portrait, use 480x640.

If you are using a 3.5" display with landscape, use 720x480, portrait is 480x720

Save the coordinates in case you need to reinstall OctoPi!

mikeysklar
 
Posts: 5785
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.