Author Topic: HDMI out on Gemian [SOLVED]  (Read 1655 times)

Thiago Alves

  • Newbie
  • *
  • Posts: 11
    • View Profile
HDMI out on Gemian [SOLVED]
« on: August 06, 2019, 10:06:43 pm »
Hey all! Just wanted to share my latest findings with you guys about HDMI out on Linux. As you may know, HDMI out does not work on Linux yet. There are several changes to hwcomposer driver that need to be made for it to work (see ). This is my work around to have HDMI out on Gemian. The idea is based on chroot on top of Android, so it is not ideal, but works. This means that it will only work if you dual boot Android (rooted) and Gemian. For pure Gemian users or non-rooted Android, this won't work. In short words, the idea is to mount Gemian partition on Android, and then chroot into Gemian from Android. Since HDMI out works on Android, it will work on Gemian after you have chroot'ed from Android. Here is my step by step to have it working.

1. You must have rooted Android and Gemian installed, in dual boot mode. On my device I have Android 7 on boot1 and Gemian on boot2.

2. Identify your Gemian partition from Android. Termux will be useful to play around mounting partitions. On my setup Gemian partition is on /dev/block/mmcblk0p29. If your setup is similar to mine, it is very likely that your partition is also in the same place.

3. Install Linux Deploy on Android. This app is very handy for chroot setups as it will configure everything automatically for you. If you don't know what chroot means, don't worry, you don't need to know. If you're curious, check wikipedia.

4. Configure Linux Deploy:
Code: [Select]
Containerization Method: chroot
Distribution: debian stretch
Architecture: arm64
Installation type: partition
Installation path: [put your partition here] In my case -> /dev/block/mmcblk0p29
Enable Init, ssh, PulseAudio and GUI over VNC

5. On Linux Deploy, click on configure. It will run some configurations, and some of them will fail. That's ok for now.

6. On Linux Deploy, click on Start to chroot into Gemian. Your system won't be accessible from GUI yet, so you need to ssh into it to finish configuration. Use your favorite ssh app to ssh into Gemian.

7. Our chrooted Gemian cannot resolve DNS because /etc/resolv.conf links to a location maintained by Connman. Since we don't use Connman on our chroot environment, it won't work. To fix it, backup your resolv.conf and create a new one:
Code: [Select]
sudo mv /etc/resolv.conf /etc/resolv.bak
sudo nano /etc/resolv.conf
[Ctrl + X to exit and save the file]

8. At this point, network will be working and you can ping, but apt will still fail to install packages. This is due to a security measure on Android that prevent apps to create sockets if they are not part of a specific group. To fix that you need to add apt to a group with gid 3003. Usually, this group already exists in your system and it is called aid_inet. If you don't have this group in your system, you will have to create it first:
Code: [Select]
addgroup --gid 3003 aid_inetIf aid_inet already exists (you can check if it exists looking at /etc/passwd file) just add _apt to it:
Code: [Select]
usermod -g aid_inet _apt
9. Done! Now your system is fully functional. Exit ssh, go back to Linux Deploy, stop the container, and click on Configure again. Now it should configure everything with no errors. Then you just start the container again to have GUI working through VNC.

10. Install VNC Viewer to be able to connect to the VNC server running on Gemian. Once installed, add a new connection to localhost and connect.

HDMI on Android always matches the resolution of the display panel. This can be problematic since there aren't many monitors with native 2160 x 1080. At the very least you will have a 1080p image with black bars on top and bottom of the screen. My solution to that was to use a little app called Screen Shift to force the display panel resolution to anything you want. Then I make it match the resolution of my monitor, and when I connect the HDMI cable, the image fills the entire screen.
Another useful tip is to change the VNC resolution on Linux Deploy to match the display as well. Then you will have Gemian desktop displayed in full screen on the monitor.
« Last Edit: August 07, 2019, 05:38:41 am by Thiago Alves »


  • Jr. Member
  • **
  • Posts: 69
    • View Profile
HDMI out on Gemian [SOLVED]
« Reply #1 on: April 01, 2020, 04:23:32 pm »
This is really cool, thanks for collecting all of this information!

Does it work when booting directly into gemian after the initial process?
« Last Edit: May 29, 2020, 11:45:03 am by gemini_user_j »
Gemini PDA x27