hyperpixel4 icon indicating copy to clipboard operation
hyperpixel4 copied to clipboard

Pi4 and landscape in console (Raspbian Buster lite)

Open illydone opened this issue 5 years ago • 37 comments

I have a pi4 and just want to use the Hyperpixel 4 for a portable device in console mode on a raspbian buster lite. After installation everything is working in portrait mode.

I tried to use hyperpixel4-rotate but the script isn't for console/framebuffer (it asks for xinput and xrandr which aren't installed).

I tried to change directly in config.txt with display_rotate=1 but it doesn't work -either I keep "dpi_timings=480 0 10 16 59 800 0 15 113 15 0 0 0 60 0 32000000 6" and screen is locked in landscape: no cursor, no update when I type something. -either I try to invert 480 and 800 in dpi_timings (I don't think it would work but it was worth a try) and display is strange: dark corners, display bugs, etc.

I think there should be correct dpi_timings in config.txt to get it to work, but I don't know which one.

I don't test touch in console as it is useless for me.

illydone avatar Sep 04 '19 21:09 illydone

The screen is a portrait display. The dpi_timings values relate to how the pixels are transferred over the DPI bus and don't have any effect on rotation etc.

Either display_rotate or lcd_rotate should work in /boot/config.txt since these are the standard method for rotating the video output on the Pi.

I wont be able to experiment with these myself until sometime next week though.

Gadgetoid avatar Sep 05 '19 18:09 Gadgetoid

Okay, thanks. I already supposed it was a portrait screen.

To turn the screen, I already tried this: -lcd_rotate doesn't have any effect -display_rotate turn the text but I don't have any more access to the console nor any tty as if everything is locked

I'll try to access it using ssh next time to identify the problem. I'll also reinstall a fresh and updated Buster lite and reinstall the screen to be sure there wasn't any external parameter.

illydone avatar Sep 05 '19 19:09 illydone

I made another test with Raspbian Buster full and with graphical interface, everything is working and after installation, X11 is starting in portrait mode.

With hyperpixel4-rotate, you can turn it and touch is also turned. However, the console (when ctrl-alt-F1) is still in portrait. When trying to change framebuffer-width and _height and display_rotate, everything goes wrong and there are display bugs in X11 and console. If I try to invert width and height, it's the same problem.

If I get back to console only boot with display_rotate=1, the screen is incomplete: it as if the console layout/buffer is larger than what is displayed.

illydone avatar Sep 06 '19 16:09 illydone

For me with display_rotate=1 I get the "Welcome to the Raspberry Pi Desktop" splash stuck permenantly on the display, and while I can hit "ctrl+alt+f1,2,3" etc to switch terminals they only momentarily flash up before they are overdrawn again by the splash.

This would appear to be a change/bug in the way that the Pi 4 handles DPI displays and the display_rotate option.

I wonder if there's an alternate way to rotate the display in console mode. The Pi 4 has both a /sys/class/graphics/fb0/rotate and a /sys/class/graphics/fbcon/rotate but echoing any values into these does nothing. They also both read 0 even with a display_rotate value set.

Gadgetoid avatar Sep 25 '19 13:09 Gadgetoid

I made other tests and the screen seems definitely a portrait screen in console... :/ I don't know if there's a way to change it. Do you know if pimoroni works on it?

PS: I also test a graphical Kali Linux and hyperpixel4-rotate doesn't work at all, so no console and even no desktop in landscape.

illydone avatar Oct 02 '19 08:10 illydone

I’ve also encountered the same thing on my pihole. It’s some sort of missing dependency. Gives an error about failing to import ScreenLayout. I just haven’t sat down to figure out what the dependency is. I can’t imagine it’s anything that can’t just be installed tho.

amnesia0287 avatar Oct 09 '19 08:10 amnesia0287

I landed here without a hyperpixel, with just some cheap 4 inch chinese hdmi display. Same here, adding the rotate_display=3 (or 1) makes my rPI4 hang before starting the desktop. Just adding this to let you know it's most probably not hyperpixel related but something between rap4 and the latest(?) raspbian.

There are some notes here https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

display_rotate is deprecated in the latest firmware but has been retained for backwards compatibility. Please use display_lcd_rotate and display_hdmi_rotate instead.

Then for display_hdmi_rotate:

Note that the 90 and 270 degree rotation options require additional memory on the GPU, so these will not work with the 16MB GPU split.

If using the VC4 FKMS V3D driver (this is the default on the Raspberry Pi 4), then 90 and 270 degree rotations are not supported. The Screen Configuration utility provides display rotations for this driver.

supersjimmie avatar Oct 25 '19 13:10 supersjimmie

I have the same problem. I want the raspberry to work in landscape mode while in the console but stuck there.

hans-fischer avatar Oct 27 '19 16:10 hans-fischer

This may have something to do with the fact that there's one "pixel fountain" (pixel pipeline? pixel bus?) reserved for rotation on the Pi 4, and since the HDMI is still active when using DSI or DPI it's probably reserved for HDMI. This would- at a very tenuous guess- mean that the Pi 4 is not configured to support rotation over DPI... but then surely since it's possible over DSI (the ribbon cable to the official Pi display) (I assume) it should be possible over DPI.

But yes, like @supersjimmie suggests this isn't a Pi 4 specific problem and we should probably narrow down the scope of the issue (works on DSI/DPI?), report it and cross our fingers for a fix.

Grabbing an official display to test now.

Edit: Just my luck, I couldn't get the official display to work reliably enough to test anything. I'll have to come back to this.

Gadgetoid avatar Nov 04 '19 11:11 Gadgetoid

Anyone have any luck with this? Same issue, when rotating to a landscape mode my display is overdrawn with a static image of a console.

The "desktop" behind this image still works, but is obscured by the image and this is useless.

tusing avatar Nov 08 '19 23:11 tusing

Has anyone tried display_rotate this without dtoverlay=vc4-fkms-v3d in /boot/config.txt?

It's clear this issue isn't confined to HyperPixel - https://www.raspberrypi.org/forums/viewtopic.php?t=246146 and: https://raspberrypi.stackexchange.com/questions/102182/display-rotate-3-only-filling-half-screen-raspberry-pi-4

Both suggesting that vc4-fkms-v3d seems to break this setting.

Gadgetoid avatar Nov 09 '19 14:11 Gadgetoid

Has anyone tried display_rotate this without dtoverlay=vc4-fkms-v3d in /boot/config.txt?

Tried this and it worked! (could also solve https://github.com/pimoroni/hyperpixel4/issues/51) I could not use the hyperpixel4-rotate due to lite-version, so I tried just display_rotate, which caused the screen to not scroll with the boot messages and for example clear only made the screen to blink.

After commenting out dtoverlay=vc4-fkms-v3d and rebooting the boot messages scrolled as expected and terminal is rotated correctly.

I'm running 2019-09-26 Raspbian Buster Lite

/boot/config.txt:

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

dtoverlay=hyperpixel4
gpio=0-25=a2
enable_dpi_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x7f216
dpi_timings=480 0 10 16 59 800 0 15 113 15 0 0 0 60 0 32000000 6
display_rotate=1

Zokol avatar Nov 10 '19 12:11 Zokol

Has anyone tried display_rotate this without dtoverlay=vc4-fkms-v3d in /boot/config.txt?

It's clear this issue isn't confined to HyperPixel - https://www.raspberrypi.org/forums/viewtopic.php?t=246146 and: https://raspberrypi.stackexchange.com/questions/102182/display-rotate-3-only-filling-half-screen-raspberry-pi-4

Both suggesting that vc4-fkms-v3d seems to break this setting.

I tested it with my "no so" fresh install of Raspbian. I first did a full upgrade and eeprom upgrade but it doesn't work. In console it's okay in portrait mode however as soon as I use display_rotate, the system is stuck on the splash screen.

After reinstalling hyperpixel, it works perfectly in console or desktop. Great!

illydone avatar Nov 15 '19 16:11 illydone

the following combination worked:

dtoverlay=hyperpixel4:rotate
display_rotate=1

based on this : (https://github.com/pimoroni/hyperpixel4/issues/8)

and also in the docs: https://github.com/pimoroni/hyperpixel4

winterelf avatar Jan 17 '20 22:01 winterelf

Just to note, display rotate is depreciated now and has been for a while. Ive been using it with display_lcd_rotate just fine.

mikekscholz avatar Jan 17 '20 23:01 mikekscholz

I got the screen to rotate with display_lcd_rotate=3 (so that the power/hdmi ports are at the bottom) but the touchscreen doesn't respond. I don't think it's rotated or anything weird because no matter where I touch nothing happens.

I put the hyperpixel on a Pi4 running Octopi and Octoscreen. As part of the Octoscreen install I had to install dependencies libgtk-3-0 xserver-xorg xinit x11-xserver-utils is there anything else missing? I installed those AFTER the hyperpixel drivers, maybe I need to reverse the order?

cannikin avatar Feb 06 '20 22:02 cannikin

Xserver-xorg-input-evdev for one... ive experimented with octoscreen but the codes not quite to my liking yet. But the way it runs ratpoison without having the raspbian desktop installed I’m not sure how well the Hyperpixel drivers may or may not respond. Id be interested to hear if you have any success though.

mikekscholz avatar Feb 06 '20 22:02 mikekscholz

@mikekscholz Thanks for the suggestion! Installed xserver-xorg-input-evdev successfully but still no touch after reboot. :(

Is a foolproof fix to just install the full Raspian Desktop from scratch and then install Octoprint/Octoscreen after the fact?

cannikin avatar Feb 06 '20 22:02 cannikin

Octoprint has a command listed in the console when it finally stops to where you can start typing that you type in to install the desktop environment. But that kind of defeats the purpose of using octoscreen which is meant to be as light as possible on system resources. Personally ive been leaning toward octodash however I’m using it on a touchscreen with usb interface. Ive not tried it on my hyperpixel

mikekscholz avatar Feb 06 '20 23:02 mikekscholz

I started this whole journey from this tweet: https://twitter.com/jerware/status/1215445584305258496?s=21 Dude has a Pi4 and Hyperpixel4, used the official OctoPi 0.17.0 image and everything was great for him. Not sure what I'm missing...

cannikin avatar Feb 06 '20 23:02 cannikin

Octodash looks great, maybe I'll give that a try!

cannikin avatar Feb 06 '20 23:02 cannikin

Its still in development, ive been doing test builds and tweaking it to my personal taste but its functional and its getting close to being nice and polished. I want to like octoscreen but I cant get it to not crash constantly. I hope that gets ironed out soon. Besides that take a look at octoprint-touchui and touchui autostart. Thats my main workhorse interface as these others come to completion

mikekscholz avatar Feb 06 '20 23:02 mikekscholz

Looks like octodash also requires a desktop install? It's complaining about xinit not being found.

cannikin avatar Feb 06 '20 23:02 cannikin

It requires some minimal software but nothing close to a full desktop. Its an electron app thats stand-alone that boots directly from the comandline

mikekscholz avatar Feb 06 '20 23:02 mikekscholz

Just go it installed but touch still isn't working. Started with a fresh install of OctoPi, too. Even used that command that Octopi gave me to install the desktop, then re-installed the hyperpixel drivers but still nothing. UGH

cannikin avatar Feb 06 '20 23:02 cannikin

Holy crap it was this: https://github.com/pimoroni/hyperpixel4/issues/41 Whether touch worked or not depended on how warm the Pi was at bootup! They have make a revision on the Hyperpixel to fix it, but there's a software fix in the meantime. You can also solder a resistor onto the board to fix.

cannikin avatar Feb 07 '20 00:02 cannikin

Some more info about this issue can be found in #51 : https://github.com/pimoroni/hyperpixel4/issues/51#issuecomment-583848997

sepia-assistant avatar Feb 09 '20 14:02 sepia-assistant

The Pi 4 has both a /sys/class/graphics/fb0/rotate and a /sys/class/graphics/fbcon/rotate but echoing any values into these does nothing.

To rotate the console screen on my Pi4, the following works for me:

echo 1 | sudo tee -a /sys/class/graphics/fbcon/rotate > /dev/null

I just found out that you can do the same using cmdline.txt by adding:

fbcon=rotate:1

I still need to find a way to rotate EGLFS applications though...

diracsbracket avatar Oct 27 '20 13:10 diracsbracket

So, you can rotate the screen in Pi 4 if you comment out dtoverlay=vc4-fkms-v3d but that breaks a bunch of stuff (like 3D acceleration and some stuff that RetroPie needs to work), so that's not a good enough option. Has anyone figured out a way to rotate the screen without messing up the drivers?

I found a topic here that says you need to either:

  • a GPU to set rotation via settings, but I don't have that (I have Raspbian Lite + RetroPie),
  • or 'set rotation on the kernel command line', which is in /boot/cmdline.txt (but I don't understand how it works)

LordRembo avatar Nov 08 '20 09:11 LordRembo

Edit for the last commit: making changes to rotation via cmdline.txt did do something. It makes the content 'think' it's on a rotate screen, causing half of it to be cut off. Any ideas or suggestions or alternative means of rotation WITHOUT removing vc4-fkms-v3d would be most helpful.

LordRembo avatar Nov 08 '20 09:11 LordRembo