[Q] Framebuffer Console/Xorg fbdev support for Nexus 5 - Nexus 5 Q&A, Help & Troubleshooting

Hello all
I have been attempting to enable a framebuffer console on the LG Nexus 5 device for debugging purposes while enabling extra kernel features, and also ideally to be able to boot Debian with Xorg directly on the phone. I am currently using rooted Android 4.4.2-based custom ROM with a kernel I have built from the unmodified source of "android-msm-hammerhead-3.4-kitkat-mr2" branch.
For testing X and framebuffer console, I have enabled framebuffer console options (kernel config here). With this kernel, I only get the standard Google boot logo and boot animation, no framebuffer console. The kernel command line arguments include "console=tty0,115200 fbcon=font:VGA8x8", which I can confirm are not overridden by the bootloader by checking /proc/cmdline after bootup.
While running the same kernel, a Debian chroot with LXDE/Xorg installed with a shell access via SSH, I can run "FRAMEBUFFER=/dev/graphics/fb0 startx". If the Android UI is currently active, the display is filled with random pixels and stops responding. I can kill X via the SSH session, but there is no difference, although after about 5 minutes the display resets and returns to normal android screen. I have tested using the default charger app (located at /charger on standard image), and it produces the same effect if UI is running at the same time.
If I disable the Android UI through ADB shell command "setprop vold.decrypt trigger_shutdown_framework" (this disables all android services except for ADB, including zygote and surfaceflinger), I am able to run /charger successfully (which results in the charging icon appearing on-screen when the power button is pressed - this is the same program that is run when the phone is plugged into a power source while powered off).
Using the Debian chroot, running the startx command results in a blank screen except for a brief flash of an inverted-colour LXDE desktop when X is shutting down (CTRL+C in shell used to run startx) before the display goes blank. This is as close as I have got to getting X working on the Nexus 5 with the default xfree86-video-fbdev driver.
Another thing to note, running the command
Code:
cat /dev/urandom > /dev/graphics/fb0
with or without the Android UI running has no effect on the display.
According to this thread and some amazing work by Tasssadar, framebuffer console can be enabled with MSM chipsets, however LG Optimus One uses the older MDP3 framebuffer video driver instead of the Nexus 5's MDSS framebuffer driver. It seems like the MDSS framebuffer implementation (in drivers/video/msm/mdss/mdss_fb.c) has some differences that make it incompatible with standard framebuffer devices. I would attempt to modify the driver in the kernel source so that it would function as a standard framebuffer device and ideally be compatible with framebuffer console and Xorg. I have little experience in kernel development and have no idea where to start with regards to fixing the issues with this particular driver.
The dmesg log when I run /charger with Android UI running is available here. Charger app is started at system time 80.140298, and the errors start immediately after. At the end you can see when the kernel resets the driver and this is when the display resumes normal function.
I would like to know if anyone has tried this before, and if they have been able to get any further than me with regards to a framebuffer console or running Xorg either in a chroot or natively on a Nexus 5.
Also I would like to know if there is anyone who would be interested in trying to develop a working framebuffer driver for this device.
Thanks to everyone who can help with this

Any luckwith the MDSS fbcon?

Related

[root] Any (notification) LED function "programming"

Recently I have been digging all about my LED in Moto X Force (for those who do not know, Motorola did install a LED on the front panel, but didn't enable it for anything usable - some people state that it's on when battery is very low, and then phone does not start, but I have never seen it). This very strange decision of Motorola encouraged me to look how to use it anyways. I have found a few apps that supposedly were in control of it, but none seemed to be nor well written nor even working. So I decided not to use those. But one app did occur to be usable. And only option I liked there was LED blinking every time any IO operation on the SD Card occured. Yet, the app is in two versions. One (free) disallows to "start at boot" so everytime i reboot the phone, I have to manually run it to "blink again".
As I'm a dev, I did little digging and found out that it's really simple to make such functionality by just one command as root (it's basically telling the linux kernel when to trigger the LED - thanks kernel.org people ):
echo mmc0 > /sys/class/leds/charging/trigger
Just one command.
As this applies to ANY device, it's for everybody to see.
Moreover, if you type:
cat /sys/class/leds/charging/trigger
You will see the response like this:
none fg_adc-online MOTOSH-ANTCAP-PSY-DRIVER-online usb-online flash0_trigger torch0_trigger usb-parallel-online wireless-online bms-online battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid dc-online rfkill0 mmc0 [mmc1] backlight default-on bcl-online rfkill13
You can guess that for example:
- battery-full will light your LED when battery is full
- wireless-online will light when WiFi is on (and possibly have the internet connection - just guessing, test by yourself, it's not the point of this post)
- and so on
The one in square brackets is "active" trigger (in this case mmc1 - external sd card)
If you type:
ls -1 /sys/class/leds/
(or even: ls -1r /sys/class/leds/ for more details)
You will see all the LEDs you can use.
When you use /sys/class/leds/*/trigger the kernel will do all the job for you. If you want to do the job yourself from within your app, you may use /sys/class/leds/*/brightness
To be honest, I really regret I have rooted my phone so late (after warranty) .
Have fun guys
PS. If you are not a dev, you still can use above in tools like Automate or Tasker.
PS2. WARNING: for Moto X Force fiddling with lcd-backlight "LED" can cause reboots (if done at boot, bootloops). Only two "trigger happy" working LEDs are charging and torch-light0 for my phone. Still, lcd-backlight possibly can be done "manually" (brightness)
Hey, this is already years old. But how to undo the changes?

[SOLVED] Lenovo Yoga 730 compatibility

I can't even install Bliss OS 11.13 on this laptop.
1. When launched live, goes past the initial console and there is black screen (more like transparent because previous content remains) - no animation, later there is startup sound but no system shell; switching to other consoles works and I can type "reboot" from keyboard. I can also see logcat output but I'm not sure what to grep for.
2. Other GRUB entries than the default result in black screen immediately (without console) - including the install option.
The laptop has an i5-8250 CPU with UHD620.
SOLVED. Version 7.20 works with everything it has, ie. without energy saving and NVMe support (not installable). Version 11.* started working (with graphical interface) after making SSD visible to Linux in BIOS. A bug, obviously.

Phone goes to sleep and freezes terminal execution

Hi all,
I wrote a program which runs in Terminal on my phone (Android 9), this program makes some computations and writes the result in a file. No input, no app.
I have realized that after a few minutes I suspend the display the execution is frozen and resumes when I switch it on again, very annoying since my goal is to take advantage of the CPU during day and night.
Is there any way to avoid this? Note the phone is not rooted
Thanks a lot to whomever will reply
S
The terminal's output device is phone's screen. It should be obvious that terminal app interupts working when you suspend the screen and resumes working when you turn on screen again.
No, should not be, in the options of Terminal there is something like Activate Wakelock which should make so that the processing continues even in suspension, But does not seem to work

[SOLVED] How do I turn off power saving while the device is locked?

I have this MTK device with closed source kernel. I have tried different ROMS available for it (ranging from kitkat to nougat). I'm trying to use it as a device to run python scripts under linux chroot.
Stuff works fine and dandy until I lock the screen. then it slows down a lot. I don't want to turn on caffeine indefinitely as it would ruin the backlight LEDs.
So far I have tried kernel tweakers and ROM's own kernel tweaking settings to manually turn on all cores, switch the governor from hotplug/schedutil to performance and mess with the I/O scheduler but those didn't work.
Is there a hack I can use to make the device run as if screen is turned on while locked?
So after doing a little digging I found out that I can basically kill/restart android related processes like zygote via start and stop commands and turn off the backlight via shell, no android probably means no slowdown because you literally cannot "lock the device"

Is there a way to get any kind of log activity from a rooted android?

I mean like when the power button was pressed or when it went to sleep or when an app was used any kind of log activity really
As long it's not turned off Android logs each activity, where it doesn't matter whether Android is rooted or not: you can view the log via performing a LOGCAT.
xXx yYy said:
As long it's not turned off Android logs each activity, where it doesn't matter whether Android is rooted or not: you can view the log via performing a LOGCAT.
Click to expand...
Click to collapse
When I open a logcat app it shows the logcat from the moment I opened the app forward. I want to see it a few hours backwards.
Then you need to enable "Developer Oprions" (search around these forums for a HowTo, it's been documented enough), increase the size of the log buffer and enable the trace(s) you need. Fair warning, it's not for the "just-being-curious/nosy" amateur kind of people, it's best to do your homework before you jump into the deep end.
Size of a logcat's ring-buffer ( main, system, crash ) is determined by the kernel, found in */drivers/staging/android/logger.c.
To temporarily set the size of all buffers you e.g. would run
Code:
adb logcat -G 16M
​
If you need to change the value by the Android shell in a way that survives a reboot, you can use the property persist.logd.size like this
Code:
adb shell "setprop persist.logd.size 16M"
what requires Android is got rooted

Categories

Resources