none
How to rotate touch panel on touchscreen on RPi? RRS feed

Answers

  • Hi THKAW,

    Thank you very much for your investigation and videos! I have spoken to the IOT Team and they are actively investigating this issue.  My understanding is the Raspberry Pi does not support a proper Windows Video driver and, as a result, the OS is unaware of the rotation change (Windows does not know about or parse Config.txt as that is a unique construct to the Raspberry Pi)

    Currently I know one individual using display_rotate=2 and lcd_rotate=2 in config.txt to get the touch and screen to match but you are likely correct and the lcd_rotate may have zero effect.

    Unfortunately, as this issue is just being investigated now, I have no idea on a timeline or how it will eventually be addressed.  For the time being you will have to keep the UI rotation to match the touch driver to work around this issue.

    Sincerest thanks again for your investigation,

    IoTGirl


    Monday, May 2, 2016 5:24 PM
    Moderator

All replies

  • Hi THKAW,

    What orientation do you have set in Device Portal? https://ms-iot.github.io/content/en-US/win10/tools/DevicePortal.htm. This needs to match the setting you have in Config.

    Display Orientation

    Sincerely,

    IoTGirl

    NOTE:

    https://www.raspberrypi.org/documentation/hardware/display/troubleshooting.md

    Agrees with you as it states that official RPi screen rotation should be set with “lcd_rotate=#” and not “display_rotate=#”.

    Friday, April 29, 2016 5:30 PM
    Moderator
  • Yes, I already tried this.

    Actually, this portal only add "display_rotate" parameter in /boot/config.txt 

    Only rotate screen only.

    Saturday, April 30, 2016 1:08 PM
  • You say "Yes, I already tried this." but do not explain exactly what you mean. Do you have both LCD & Display values set and are they set to equivalent values?

    Monday, May 2, 2016 5:58 AM
    Moderator
  • I mean this setting page won't effect touch panel signal. Touch point mapping to screen still wrong(when Display Orientation = Portrait).

    Display Orientation = Portrait

    Display will effect => Portrait

    Touch panel signal won't effect = > Landscape

    lcd_rotate not effect in Windows IoT

    If I plug this touch panel in to Windows 10 PC, when I setting LCD Display rotate 90 degrees, the touch panel signal also rotate 90 degrees too.





    • Edited by THKAW Monday, May 2, 2016 12:29 PM
    Monday, May 2, 2016 12:08 PM
  • Two youtube video, try to explain my question:

    https://youtu.be/sDVTqE2WwfQ

    https://youtu.be/aRRbYogTC3E

    I also try:

    only display_rotate=1 and only lcd_rotate=1, and both in config.txt.

    still no luck :(

    Monday, May 2, 2016 12:39 PM
  • Hi THKAW,

    Thank you very much for your investigation and videos! I have spoken to the IOT Team and they are actively investigating this issue.  My understanding is the Raspberry Pi does not support a proper Windows Video driver and, as a result, the OS is unaware of the rotation change (Windows does not know about or parse Config.txt as that is a unique construct to the Raspberry Pi)

    Currently I know one individual using display_rotate=2 and lcd_rotate=2 in config.txt to get the touch and screen to match but you are likely correct and the lcd_rotate may have zero effect.

    Unfortunately, as this issue is just being investigated now, I have no idea on a timeline or how it will eventually be addressed.  For the time being you will have to keep the UI rotation to match the touch driver to work around this issue.

    Sincerest thanks again for your investigation,

    IoTGirl


    Monday, May 2, 2016 5:24 PM
    Moderator
  • Thanks!

    Hope in future release will support touch screen signal rotate :)!

    Tuesday, May 3, 2016 3:03 AM
  • You are very welcome! This issue with your notes are in the backlog for the team to review.  They are using the AGILE method so I do not have a timetable but it will be reviewed for inclusion in a future release.
    Tuesday, May 3, 2016 4:48 PM
    Moderator
  • Hi,

    Im using the Raspberry Pi 7" Display with touch and want to use my Raspberry Pi 3 in Portrait mode. I rotated it using the Administration Website and set "Display Orientation" to Portrait. After a restart it looks good but the Touch Mask is not rotated, so everything I touch is recognized in a 90° angle.

    Is there a way I can rotate the Touch by hand or do I have to wait for the next Developer Preview? :) 

    Im using a Raspberry 3 with 10.0.14342.1000

    Thanks!

    Friday, June 3, 2016 9:39 AM
  • open \\DEVICEIPADDRESS\c$ network share and edit EFIESP\config.txt and remove display_rotate and add lcd_rotate=2
    should work after reboot

     
    Friday, June 3, 2016 9:54 AM
    Moderator
  • thank you for your fast reply. 

    My config.txt looks like this:

    init_uart_clock=16000000
    kernel_old=1
    safe_mode_gpio=8
    max_usb_current=1
    gpu_mem=64
    hdmi_force_hotplug=1
    core_freq=250
    force_turbo=1
    framebuffer_ignore_alpha=1
    framebuffer_swap=1
    disable_overscan=1
    hdmi_group=2
    hdmi_mode=58
    lcd_rotate=2
    but now it starts in landscape mode. Looks like it is ignoring this command.


    Friday, June 3, 2016 10:10 AM
  • your display_rotate was 1 before? try lcd_rotate=1 (90 degree)
    Friday, June 3, 2016 10:12 AM
    Moderator
  • I tried 1 to 5 but nothing switches it to landscape.

    I stays on my desk on portrait mode, so this is the orientation of the welcome screen:

    1 wide with orientation to the left.

    2 wide with orientation to the right.

    3 wide with orientation to the left.

    4 wide with orientation to the right.

    EDIT:

    I also trimmed the config.txt and removed all HDMI content

    init_uart_clock=16000000
    kernel_old=1
    safe_mode_gpio=8
    max_usb_current=1
    gpu_mem=64
    core_freq=250
    force_turbo=1
    lcd_rotate=2
    But it still shows the same behaviour


    • Edited by tsaG Friday, June 3, 2016 10:37 AM
    Friday, June 3, 2016 10:27 AM
  • Anyone know if its possible to get the screen to run in portrait mode "with" touch functionality? The display and touch work great in landscape mode, but I cannot get it to work in portrait.

    Adding the following in the config.txt seem to have no effect:

    lcd_rotate=1

    or 

    lcd_rotate=3

    However, lcd_rotate=2 does work, but it rotates 180....still landscape.

    I'm running the latest Insider preview build, 14342, on a Raspberry Pi 3.




    Thursday, June 9, 2016 9:49 PM
  • what's the result if you revert your changes in config.txt and change the orientation in device portal?
    Friday, June 10, 2016 8:27 AM
    Moderator
  • Doesnt work yet. This bug occurs in windows and unix, so I think this is something the Pi foundation has to handle, isnt it?

    Here is another Thread: https://social.msdn.microsoft.com/Forums/en-US/1d989376-98a7-4165-82c9-2eaf8dfc7454/how-to-rotate-touch-panel-on-touchscreen-on-rpi?forum=WindowsIoT



    • Proposed as answer by tsaG Saturday, June 11, 2016 2:14 PM
    Saturday, June 11, 2016 2:14 PM
  • Is it fixed in the new release yet?
    Tuesday, June 28, 2016 7:42 PM
  • Some feedback with the latest build (apologies, these things may also be broken in earlier builds, i haven't updated in a while).  Happy to test specific builds if asked.

    This is using a clean build microSD, Raspberry Pi 2, v1.1 of the official Raspberry Pi Display and IoT Core version 10.0.14376.0.

    • The Device Portal "Display Orientation" setting is not applied
    • Setting "display_rotate=2" in the config.txt file visually rotates the display, but not the touch inputs (e.g. moves power icon to top right of the screen, but i still have to press in the bottom left for it to be sensed)

    Sunday, July 17, 2016 7:57 AM
  • I have a Raspberry Pi 3 connected to a Raspberry PI 7" LCD Display. Everything works great with the latest 1607 IoT Core update. However, when attempting to change the Screen Orientation for Windows IoT Core using the web portal (http://{ip address}:8080) for the device it just won't save the change.

    When I change the dropdown for the Screen Orientation from the default of Landscape to any other value (Portrait, Landscape (flipped), etc) the portal says the change is saved, but when it restarts the device the screen orientation remains the default Landscape no matter what.

    I assume this is a bug in Windows IoT Core, but perhaps there a different way I can change the Screen Orientation. Perhaps from the console or something?


    http://buildazure.com


    Friday, August 5, 2016 1:45 AM
  • Hi Chris,

    This is a known issue with Raspberry Pi & Touch.  If you do succeed in rotating the screen, the touch will not rotate with it.  I will merge your question with the existing topic in a moment.

    Sincerely,

    IoTGirl

    Monday, August 8, 2016 7:23 AM
    Moderator
  • Hi,

    With Windows IoT Anniversary edition 10.0.14393.67 it is possible to Landscape flip the display by adding the line:

    lcd_rotate=2

    This appears to rotate the video and touch.  If you add display_rotate=2 that flips the video back so only use lcd_rotate = 2.

    I tried 1 and 3 but they did not rotate the screen or touch.

    Hope this helps,

    David


    • Edited by David1854 Thursday, August 25, 2016 9:22 AM
    Thursday, August 25, 2016 9:20 AM
  • Hello,

    I run win IoT on my Rasp 3 with the official 7" Touchscreen Display. It works great. But when I change the Display Orientation to Landscape (Flipped), what I have to do because I cant rotate the screen in my case, the touchpoints don't flip. So when I want to make a touch top right it have to touch bottom left.

    How can I calibrate the Touchscreen?

    Friday, September 30, 2016 8:27 AM
  • have you used display_rotate or lcd_rotate in your config.txt? Try lcd_rotate
    Sunday, October 2, 2016 3:56 PM
  • Hi Resper.d,

    This is a known issue with the Raspberry Pi Display.  I have merged your question with the existing topic thread.

    Sincerely,

    IoTGirl

    Monday, October 3, 2016 5:23 AM
    Moderator
  • Here's my writeup on what I did to fix this issue with Windows 10 IoT Core, Raspberry Pi 3, and the Official Raspberry Pi 7" Display:

    https://buildazure.com/2016/08/06/fix-windows-iot-core-raspberry-pi-touchscreen-display-upside-down/



    Monday, October 3, 2016 1:18 PM
  • Bumped because this is still an issue on 10.0.15026.1000

    Both landscape options work fine, neither portrait option works at all.

    Big issue for me as I have a product ready for market that requires portrait orientation. Is this ever likely to be fixed or do I need to look at another operating system?

    Wednesday, February 15, 2017 8:52 PM
  • Hi Craig,

    If your final product is targeted to a Raspberry Pi then you will need to build a custom solution for rotation at the driver level.  However, you should check in with other OEMs and see if their BSP hooks into the rotation settings in Windows 10.

    Sincerely,

    IoTGirl

    Wednesday, February 15, 2017 10:11 PM
    Moderator
  • IotGirl, can you confirm if portrait mode will work on any available version of the Windows 10 iOT OS, even an earlier one?

    I am running version 10.0.14393.1066 and experiencing this problem (lcd_rotate =2 doesn't work, and display_rotate is video only).

    However, an earlier post in this thread implies portrait mode worked with OS version 10.0.14393.67. 

    Thanks

    Wednesday, April 26, 2017 4:10 AM
  • Hi ACB,

    Rotate of touch has never worked on the Pi, only rotate of video as you have observed.

    Sincerely,

    IoTGirl

    Wednesday, April 26, 2017 4:53 AM
    Moderator
  • Are there any plans to fix the problem?

    David

    Wednesday, April 26, 2017 12:45 PM
  • Hi David,

    No that I know of as the issue is the RPi does not accept the windows settings for rotation.

    Sincerely,

    IoTGirl

    Wednesday, April 26, 2017 8:38 PM
    Moderator
  • Thanks for responding. This is so close! Display_rotate works, we just need the mouse input to match. Looking at my iOT registry in Power Shell, I can search for the touch screen driver ("FT5406 10-pt touch screen controller")  and it looks like the associated driver file (ft5406_touch.sys) originated from Microsoft.  

    Is it possible to put in a feature request somewhere within Microsoft to add a parameter to this driver, to force/remap input coordinates to portrait mode? It seems reasonable that a touch screen driver would have at least some configuration parameters already for calibration purposes. 

    Although this is not a critical feature, I'd argue it is somewhat important, since the Raspberry Pi is promoted on the front page of the Windows iOT site and this is the official touch screen for that device. 

    Thursday, April 27, 2017 3:16 AM
  • +1

    David

    Thursday, April 27, 2017 7:04 AM
  • Hi Folks,

    My apologies if I was not clear.  Windows does support touch rotation, it is the Pi that does not respect the setting.  You can certainly take the RPi BSP and attempt a modification but I expect you will run into the same issue.

    Sincerely,

    IoTGirl

    Thursday, April 27, 2017 4:59 PM
    Moderator
  • Found a workaround at the application level. I can leave Windows on the Raspberry Pi in Landscape mode and add a RotateTransform to the Xaml form to "fake" portrait mode. All touch controls seem to respond correctly so far! This can be done with code, in the form's constructor like this:

            public MainPage()
            {
                RotateTransform bigOlNastyHack = new RotateTransform();
                bigOlNastyHack.Angle = 90;
                bigOlNastyHack.CenterX = 240;
                bigOlNastyHack.CenterY = 240;
                this.RenderTransform = bigOlNastyHack;
    
                this.InitializeComponent();
            }

    ... or in Xaml like this:

        <Page.RenderTransform>
            <RotateTransform Angle="90" CenterX="240" CenterY="240"/>
        </Page.RenderTransform>
    I think the code method would be preferred, since it could be dynamically applied only if the app is running on the device. This method is definitely better than attempting to work at the driver level and will be easy to take out should an official fix ever come out. 


    Saturday, April 29, 2017 2:54 AM
  • Hi IoTGirl,

    I think it is a bit of a cop out for Microsoft to suggest someone other than Microsoft modifies the official BSP to make a feature that should work when you set the display mode in the Device portal function correctly. 

    If you can't support the display orientation correctly from the device portal then remove that function from the device portal.  Leaving the situation as it is puts Microsoft in a bad light.

    David 

    P.S. Thanks to ACB Software for the hack although I haven't tried it I suspect the x value should be 400 not 240.

    Saturday, April 29, 2017 8:26 AM
  • Hi David,

    Unfortunately, Microsoft is largely working with a black box when it comes to Raspberry Pi's firmware so it will take the OEM which does have visibility into that hardware to design for it.

    The "Official BSP" is an open effort available for download from GITHUB so if you do have specialized knowledge you can certainly extend the BSP yourself.

    Sincerely,

    IoTGirl


    Saturday, April 29, 2017 6:56 PM
    Moderator
  • If Microsoft can't resolve it then the display orientation listbox should be disabled on the device portal.

    David

    Sunday, April 30, 2017 10:53 AM
  • Hi David,

    Again, this is a windows setting and other devices do respect the setting.  Removing this option would disable that ability for those platforms.

    Sincerely,

    IoTGirl

    Sunday, April 30, 2017 11:38 PM
    Moderator
  • Hi IoTGirl,

    Don't be silly. If the device is RPi then disable the listbox or only allow Landscape.

    I am sure there is a whole bunch of target dependencies and you should never provide options that do not work, that is just bad UX.

    David

    Monday, May 1, 2017 7:52 AM
  • @David1854

    Don't be silly.

    please suppress such violating statements

    I am sure there is a whole bunch of target dependencies and you should never provide options that do not work, that is just bad UX

    if you think it is such a big problem for you that has to be changed please go the mandatory way and use Feedback Hub App

    Monday, May 1, 2017 12:51 PM
    Moderator
  • Hi Andre,

    My 'Don't be silly' comment referred to the comment 'Removing this option would disable that ability for those platforms' - I had hoped that readers would read the following sentence and therefore understand the context.  With hindsight I should have quoted and therefore referenced the statement that, in my opinion, would only be true if the software was written without any understanding of UX and Microsoft are above that.

    It doesn't have to be changed but if it isn't then it will reflect badly on Microsoft as they are aware of options that users can select that are either not implemented or do not work.

    It is easy to fix the UX and allowing bad UX to persist is simply lazy.

    David

     

    Monday, May 1, 2017 1:26 PM
  • My 'Don't be silly' comment referred to the comment 'Removing this option would disable that ability for those platforms'...

    i am sure your social competence would be able to clarify such things on technical levels without such violations

    It doesn't have to be changed but if it isn't then it will reflect badly on Microsoft as they are aware of options that users can select that are either not implemented or do not work.

    that's your opinion

    other developers understand the Device Portal is the same for every Windows IoT Core device and the BSP for Raspberry Pi is open source so everyone would be able to implement features like the ignored Display Orientation

    they also understand its a question of effort and manpower and why its much more important to solve bugs or implement functional features

    btw i am sure your violation puts more bad light on you than those setting on Microsoft 

    Monday, May 1, 2017 2:10 PM
    Moderator
  • If there is an option for a setting and selecting that option does not work then that is bad practice UX. The solution is to fix it so the option works or to remove that option otherwise it will create confusion - simple facts.

    For clarity - I am not suggesting the option should be removed from platforms where it does work.

    "btw i am sure your violation puts more bad light on you than those setting on Microsoft"

    That's your opinion and you are welcome to hold it.

    David

    Monday, May 1, 2017 2:27 PM
  • For clarity - I am not suggesting the option should be removed from platforms where it does work.

    as already mentioned use the right tool for this request - Microsoft Feedback Hub App

    Monday, May 1, 2017 4:52 PM
    Moderator
  • Hi Andre,

    Absolutely! The feedback tool is the correct place for feature requests.  I would warn against this requested change however as if the OEM does step in and allow the hardware to listen to the OS rotation request, this change would again need to be addressed.  Much better to leave as is just in case!

    Sincerely,

    IoTGirl

    Monday, May 1, 2017 5:57 PM
    Moderator
  • Hi IoTGirl,

    'I would warn against this requested change however as if the OEM does step in and allow the hardware to listen to the OS rotation request, this change would again need to be addressed.'

    I haven't actually requested a change... I have just pointed out the poor UX. 

    Has Microsoft raised this issue with RPi foundation?  Reading between the lines of your posts I guess that it has been raised but they aren't that enthusiastic about fixing it because they have other higher priorities.  Or am I way off.

    David

    Monday, May 1, 2017 6:09 PM
  • Hi David,

    I really can't comment on any third party decision but each OEM is responsible for investments in their BSP, by their own engineers or others.  In the past, there are really three models that exist for previous Windows On Devices:

    1. OEM completely divulges their entire structure and really only has 3rd Party BSPs, essentially a white box.
    2. OEM has a closed architecture and either is the only source of the BSP or has third party partners that get to see inside the black box.
    3. A mix of 1 & 2 and you get a mix of white and black box information available.

    In this case the RPi BSP is option 3 so a mix.  I hope that clarifies.

    Sincerely,

    IoTGirl

    Monday, May 1, 2017 7:01 PM
    Moderator
  • Hi IoTGirl,

    So is it a checker box or grey box? ;o)

    In summary, for the RPi:

    1. the screen orientation cannot be set via the device portal despite the option set in the listbox 
    2. orientation be rotated 180 degrees by setting lcd_rotate=2
    3. it should be possible to do a rotate transform in code or XAML if you require portrait
    4. it might be possible to hack the Board Support Package but this hasn't be done as yet

    Fair synopsis?

    David

    Monday, May 1, 2017 7:41 PM
  • Hi David,

    1&2 are actually one and the same "RPi does not support Windows screen rotation setting, use Config.txt for this platform ether using HDMI or LCD settings defined by RPi foundation"

    If you search the forums, there are more limitations than just these, unfortunately. Even if you do rotate the screen, if you are using touch, the Pi does not recognize that rotation so the touch driver would also need step 4 as well.

    Audio seems to share interrupts in the firmware black box on the Pi as well with indeterminate effects on other parts of the system, depending on what else happens to connected.

    These are just the two issues I see folks hitting most on IoT Core on Pi but there are likely more.

    Sincerely,

    IoTGirl


    Tuesday, May 2, 2017 4:01 PM
    Moderator
  • Hi IoTGirl,

    Well I thought I'd actually check out the status so started by installing Insider Preview 10.0.15051 and then did some experimentation.

    If you go to Display Orientation neither Portrait options rotate the screen however both Landscape and Landscape (Flipped) work correctly with touch.  No need for any entries in config.txt.

    Speechsynthesis also working but has nasty click at start and end but that is for another day.

    David

     

    Wednesday, May 3, 2017 10:20 AM
  • Has anyone had any luck with the RotateTransform hack? Whatever I try I can't get it to work with the whole screen, generally just a 480*480 pixel box in the middle of the screen with two great big white borders. So close, but yet, so far. ;(

    Wednesday, May 3, 2017 11:49 AM
  • Hi Craig,

    Yep, it rotates the image not the canvas unfortunately.

    David

    Wednesday, May 3, 2017 1:11 PM
  • Thanks David, had a play with it and was just about to leave a reply.

    This worked for me...

        <Grid Height="800" Width="480" RenderTransformOrigin="0.5, 0.5">
            <Grid.RenderTransform>
                <CompositeTransform Rotation="90" TranslateY="-160"/>
            </Grid.RenderTransform>

    // Other stuff....
        
        </Grid>

    Wednesday, May 3, 2017 1:16 PM
  • Hi Craig,

    I had to modify it slightly to remove error - I'm using VS2017.

        <Grid Background="#FF272629" x:Name="LayoutRoot" Height="800" Width="480" RenderTransformOrigin="0.5, 0.5">
     
            <Grid.RenderTransform>
                <TransformGroup>
                    <CompositeTransform Rotation="90"/>
                    <CompositeTransform TranslateY="-160"/>
                </TransformGroup>
            </Grid.RenderTransform>

    // Other stuff....
        
        </Grid>

    Of course the neat benefit of doing it in XAML is you see the result instantaneously when you make the change in the XAML as you are running the code.

    The Display Orientation setting simply writes 

    lcd_rotate=n where n = 0 Landscape, 1 Portrait, 2 Landscape (Flipped) or 4 Portrait (Flipped)

    into config.txt

    When RPi is running Linux setting portrait mode is not trivial RPi Forum.  It looks like the XAML route is simplest....until RPi Foundation resolve the problem.  

    I bet it would work straightaway with the HD touch monitor I have - dump the RPI screen and connect USB for touch.  It did with the Minnowboard Max. 

    David



    • Edited by David1854 Wednesday, May 3, 2017 3:41 PM
    Wednesday, May 3, 2017 2:52 PM