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/
Locked
User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

Post by mikeysklar »

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

User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

Post by mikeysklar »

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 ).

User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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

User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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://BANNED.com/raw/jihatelapo
klipperscreen.log : https://BANNED.com/raw/picejasifo
journalctl : https://BANNED.com/raw/ugibikajan

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

Code: Select all

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

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

Post by mikeysklar »

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

    # 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")

User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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

    # 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

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

Post by mikeysklar »

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

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


User avatar
jtw6168
 
Posts: 7
Joined: Tue Sep 07, 2021 12:50 am

Re: Raspberry Pi OS 64-bit and PiTFT

Post by jtw6168 »

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

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

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Raspberry Pi OS 64-bit and PiTFT

Post by mikeysklar »

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!

Locked
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/

Return to “Adafruit Raspberry Pi® accessories”