Skip to content
Wilson K Bradley edited this page May 2, 2019 · 12 revisions

/dev/graphics/fbX

I wasted a lot of time wondering why /dev/graphics/fb0 was 1280x33 (and trying to hack modelines, etc). Answer: its the black grab bar at the top of Android's GUI (with the clock, wifi indicator, etc). I had an xterm running in 1280x33 before I clued in!

On my Galaxy Note 8, fb3 is the correct framebuffer. Not sure what fb1 and fb2 are!

Meefik suggests "cat /dev/random > /dev/graphics/fb0". This is useful to see which ones are connected to something but it doesn't tell you what is what. I used trial-and-error.

Freeze Android UI

On my Galaxy Note 8, I have to use "Stop" for framebuffer to work. (TODO: maybe Pause, but "Don't Freeze" definitely doesn't work).

X Options: "Display" setting

In the same page where you can change which fbX to use, there is a setting "Display" (or similar, I don't have my device with me atm). This setting just changes the X11 display server (notably the "0" in /var/log/Xorg.0.log). So fiddling this setting is unlikely to make your framebuffer work!

My debugging workflow

After installing. I use the following workflow for debugging framebuffer. Maybe this will help someone else.

  1. Start LinuxDeploy and then start your distro.
  2. ssh in from my laptop.
  3. "killall X" (or maybe Xorg)
  4. modify /home/android/.xnitrc and /etc/X11/xorg.conf
  5. "xinit"
  6. ctrl-C to kill X, back to step 4, repeat.

All the while, in another ssh session, you can look at /var/log/Xorg.0.log

I also did "sudo -i", "chmod 666 /etc/X11/xorg.conf" so that I could edit that file as user android. The xorg.conf can get overwritten/edited by Linux Deploy (maybe the "Reconfigure" button?). Keep a backup if you edit it.

TODO: Possibly removing the "# linux deploy" comments (e.g., from /dev/graphics/fb0) will prevent it from modifying them?

CyanogenMod

Tested a bit on Cyanogen Mod instead of native firmware. I think the "Stop, Pause, Don't Freeze" stuff worked better. Must check again after upgrading to CyanogenMod 11. Maybe kernel bugs for touchscreen will be fixed too! :) Ok, running on CyanogenMod 11. "Pause" for framebuffer works well (no need to reboot device after running X). Touchscreen still broken. Seems endemic as tested on my Nexus 5 too. I filed bug for evdev [https://bugs.freedesktop.org/show_bug.cgi?id=80470].

Using mtev for touch

UPDATE: INSTEAD OF USING THE XINPUT.SH, JUST ADD Option "Rotation" "1" in xorg.conf, input section.

Touchscreen can now be used in framebuffer (atleast in Debian Wheezy and Jessie) by using the mtev driver. It was originally designed to be used for the Nokia N900 but confirmed to be working for other devices. I tested it on my S II (GT-i9100) by following this guide here: http://www.linuxquestions.org/questions/linux-mobile-81/linux-desktop-on-android-4175512761/#post5338219 The mtev driver can be obtained here: https://www.youtube.com/watch?v=ACsprB0r1pA. It's on the first Google Drive link. (Thanks to Simon Schumann for the updated mtev driver. Confirmed to work in Debian Jessie.) Please edit this part for the devices that have been confirmed to work. If someone can just get sound to work......

  • Confirmed works on Versus Touchpad 9 running Android 4.0.4 (using /dev/input/event2)

Handling phone buttons

It is possible to receive keyboard events when the physical buttons on the phone/tablet are pressed. For example, on my Versus Touchpad 9 I can receive key press events from the Home button, Power button and Vol Up/Down buttons and then bind them to actions in the window manager.

Thanks to http://blog.rot13.org/2012/08/x11-running-on-nook-color-without-android-stack.html I have discovered that the following changes to /etc/X11/xorg.conf work (at least on my tablet).

In the "ServerLayout" section, add the following lines:

        InputDevice   "sw-keyboard" "CoreKeyboard"
        InputDevice   "axp20-supplyer" "CoreKeyboard"

Then add the following new sections:

Section "InputDevice"
    Identifier    "sw-keyboard"
    Driver        "evdev"
    Option        "Device" "/dev/input/event0"
    # key 122 XF86AudioLowerVolume
    # key 123 XF86AudioRaiseVolume
    # key 166 XF86Back
EndSection

Section "InputDevice"
    Identifier    "axp20-supplyer"
    Driver        "evdev"
    Option        "Device" "/dev/input/event1"
    # key 124 XF86PowerOff
EndSection

The keys can then be handled in applications in the normal way. For example, I needed a key to change the fullscreen state for an app so in my .config/openbox/lxde-rc.xml I added:

<keybind key="XF86AudioRaiseVolume"><action name="ToggleFullscreen"></action></keybind>

Also using Note 8 / Nougat custom Rom- Thanks for your post above. Useful stuff above.. How is your progress going? Anyone get Audio working?

Would love to find an active Linux Deploy forum.. I only found this old one. https://forum.xda-developers.com/android/software/guide-install-linux-os-alongside-t3726844


http://your_computer:3142/XXXX where XXXX is one of armdebian, armubuntu, or armkali

Clone this wiki locally