Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


7" touchscreen on HDMI how to rotate 180 deg.?
#1
I am at the end of my wisdom.

I am not a software guy but I tried whatever I could find on the net to get the HDMI display 180 degrees rotated.

The display works (in portrait) but everything is upside down.
I am using the latest Raspberry OS with moOde and I use the Raspberry Imager to install the OS.

 
I am also surprised that this option is not available in the configuration setup,
is the reason that its impossible to do ??


Kindly advice.
 
I want to run Spotify and PeppyMeter but haven’t gotten there yet.

Cheers from Singapore
Bjoern
Reply
#2
What model is the display?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(04-10-2025, 02:23 PM)Tim Curtis Wrote: What model is the display?

Its a Wondershare 7 inch touch screen.
I used this settings before and it was working however nothing todo with orientation and without these settings now in Moode the display is recognized.
The size is 1920x1080


#### WonderShare special BG settings

max_framebuffer_height=1920
config_hdmi_boost=10
hdmi_group=2
hdmi_mode=87
hdmi_timings=1080 1 26 4 50 1920 1 8 2 6 0 0 0 60 0 135580000 3
Reply
#4
As far as screens go, moode has built in support for the Pi touch 1 and 2 and most HDMI displays providing their default orientation is landscape (the standard orientation).

Other screens are YMMV particularly if they require special settings in PiOS boot files or other configs.

The Touch 2 is a really nice 7" screen. You might want to consider that.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(04-10-2025, 10:32 PM)Tim Curtis Wrote: As far as screens go, moode has built in support for the Pi touch 1 and 2 and most HDMI displays providing their default orientation is landscape (the standard orientation).

Other screens are YMMV particularly if they require special settings in PiOS boot files or other configs.

The Touch 2 is a really nice 7" screen. You might want to consider that.

Thanks for you reply,
Could you help me understand:

are the Pi Touch 1/2 for hdmi or only displays DSI ?

Since my HDMI touchscreen is recognized my moOde accept for the 180 degrees rotation which file could I edit to
include the rotation ? I tried config.txt but nothing happens.
I havent tried the touch function yet, would I need to choose Pi touch 1/2 in order to make that work ?
Reply
#6
Pi Touch 1 and 2 are DSI. I would only recommend getting a Touch 2.

For your display try setting type to Touch 2 in the DSI section of Peripheral Config. Then maybe the rotation setting will work? I have no idea what any special settings in config.txt or cmdline.txt might do.

The file that implements the rotation settings is /home/pi/.xinitrc
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
Erm...

In .xinitrc we find this clause

Code:
if [ $DSI_SCN_TYPE = 'none' ]; then
   if [ $HDMI_SCN_ORIENT = "portrait" ]; then
       SCREEN_RES=$(echo $SCREEN_RES | awk -F"," '{print $2","$1}')
       DISPLAY=:0 xrandr --output HDMI-1 --rotate left
   fi


If

1) we modify this to include the possibility of HDMI_SCN_ORIENT having the value "inverted" upon which rotating "inverted"

2) modify the webUI Peripherals screen to allow selection of "Inverted" as an HDMI screen orientation

Then we get what we want for the displayed HDMI output. I have no idea how to deal with the touchscreen input however.

@BjoernStefan

You can test my proposal from the command line on your moOde player. Execute the following command

Code:
DISPLAY=:0 xrandr --output HDMI-1 --rotate inverted

This worked for me on a Pi 5B based moOde 9.3.0 player here with an attached HDMI display (using HDMI port 0, closest to the USB-C power socket). Again, I have no idea how to deal with the touch screen input.

The setting won't persist through a reboot, of course.

Regards,
Kent

PS - As written, my suggested command should work for Pi models which have only a single HDMI port and with Pi 4B/5B models (which have two HDMI ports) if the display is connected to port 0.

PPS - changes to the kernel settings will affect only the orientation of the text console. Once the moOde local display is enabled, we have to change X-window settings instead.
Reply
#8
(04-11-2025, 02:10 PM)TheOldPresbyope Wrote: Erm...

In .xinitrc we find this clause

Code:
if [ $DSI_SCN_TYPE = 'none' ]; then
   if [ $HDMI_SCN_ORIENT = "portrait" ]; then
       SCREEN_RES=$(echo $SCREEN_RES | awk -F"," '{print $2","$1}')
       DISPLAY=:0 xrandr --output HDMI-1 --rotate left
   fi


If

1) we modify this to include the possibility of HDMI_SCN_ORIENT having the value "inverted" upon which rotating "inverted"

2) modify the webUI Peripherals screen to allow selection of "Inverted" as an HDMI screen orientation

Then we get what we want for the displayed HDMI output. I have no idea how to deal with the touchscreen input however.

@BjoernStefan

You can test my proposal from the command line on your moOde player. Execute the following command

Code:
DISPLAY=:0 xrandr --output HDMI-1 --rotate inverted

This worked for me on a Pi 5B based moOde 9.3.0 player here with an attached HDMI display (using HDMI port 0, closest to the USB-C power socket). Again, I have no idea how to deal with the touch screen input.

The setting won't persist through a reboot, of course.

Regards,
Kent

PS - As written, my suggested command should work for Pi models which have only  a single HDMI port and with Pi 4B/5B models (which have two HDMI ports) if the display is connected to port 0.

PPS - changes to the kernel settings will affect only the orientation of the text console. Once the moOde local display is enabled, we have to change X-window settings instead.

I got it turned correctly with this command:

DISPLAY=:0 xrandr --output HDMI-1 --rotate right
I also changed the .xinitrc file so its now starting automatically.

Many thanks for your suggestion !!
Reply
#9
As mentioned before the HDMI screen is set to Portrait and in the /home/pi/.xinitrc
File i added the following line to make it work:


DISPLAY=:0 xrandr --output HDMI-1 --rotate right

However since this is a touch screen and the mouse function of the screen is connected via one of the USBs the mouse curser also needs turning.
I tried the following command in the file:
DISPLAY=:0 xinput --set-prop "WaveShare WaveShare" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1

but it doesnt seem to do anything, also when I try the command directly from the command line input it doesnt change the mouse settings.
The mouse seem to be 90 degrees off.

It looks as if moOde Player changes the mouse orientation somewhere else after it runs through my setting.

Any advice ?
Reply


Forum Jump: