raspberrypi / Raspberry-Pi-OS-64bit

Repository for containing issues on the 64 bit operating system (as distinct from the 32 bit one)
466 stars 21 forks source link

Composite-1 signal is enabled by default causing touchscreen to be off by half X resolution when using the official 7" 800x480 TFT #8

Open xranby opened 4 years ago

xranby commented 4 years ago

The touchscreen places the pointer at aproximately x * 2 when using the the official 7" 800x480 TFT IMG_20200528_180924296

AdamorfuX commented 4 years ago

Hi!

Not sure if it works but you can try installing xinput-calibrator with sudo apt-get install xinput-calibrator

The go to menu - preferences - Calibrate Touchscreen

I hope it helps to solve it for now. I didn't test it but someone I know said it works

xranby commented 4 years ago

i tested xinput-calibrator but it appears that the entire screen is too large by default, thus i cant touch all calibration points IMG_20200529_125811609

xranby commented 4 years ago

The issue: It appears that the composite signal is enabled by default it makes the screen configuration look like this: IMG_20200529_131321041

Workaround: re arrange the composite screen to stay below the DSI-1 screen workaround the issue. IMG_20200529_131329608

xranby commented 4 years ago

Workaround: Add enable_tvout=0 to /boot/config.txt

This makes the touchscreen aligned and work as expected when only using the DSI official 7" 800x480 TFT

ghollingworth commented 4 years ago

This is the same on the 32bit kernel, so you should report this in the firmware repo instead.

Currently if no HDMI is detected the firmware will set up the composite output. With KMS this now means it has both displays and adds them. So you'd either have to disable the tvout (as above) or we'd have to change default behaviour...

This issue should be fixed once we fully move to the 'full KMS' solution and fix both the DSI driver and tvout drivers in the kernel so that you can enable / configure the interfaces in linux. For the moment though we need to default between HDMI and tvout because we don't know at that time whether a DSI display is available.

I'll leave this open, as a reminder, but it should really not be here.

lurch commented 4 years ago

Looks (at least to me) like the problem is that the touchscreen-input is being "scaled" to cover both the DSI and composite display outputs. Does that suggest that a different "fix" would be to modify the touchscreen driver so that its input-events only cover the DSI display, not all displays? :shrug:

xranby commented 4 years ago

@lurch raises a valid point, if i start the system with HDMI attached and DSI TFT then the pointer is misaligned in the same way. Thus the proposed fix to make the touchscreen driver send input events that only cover the DSI display, if that is possible, sounds like a good solution. IMG_20200602_125153646_HDR

6by9 commented 3 years ago

xinput is the command you're after https://www.raspberrypi.org/forums/viewtopic.php?p=1724631#p1724631

xinput --list lists all the input devices, then xinput map-to-output 10 DSI-1 where 10 is the appropriate number from that list.

xranby commented 3 years ago

Thank you @6by9 !!

The solution work for me on both 32bit and 64bit systems to lock the touchscreen to the TFT display by adding an /etc/X11/Xsession.d/99rpi-touchscreen file containing: xinput map-to-output "raspberrypi-ts" DSI-1