Jump to content

[Guide] Fixing issues with Ubuntu Touch


Recommended Posts

Hey all,

I've been using Ubuntu touch for about a week now and Ive started working on patching some of the issues with them. I thought some of these fixes would be appreciated by you and I also wanted a public forum to discuss problems and potential solutions for them. The main issues I have noticed with fresh install of Ubuntu touch my new pro 1 are as follows:

GPS  - Straight up not working. I may be able to patch driver support across from the lineage git but im too busy rn.

Flashlight  - I believe this one shouldn't be to hard to patch, just a matter of finding the right gpio pin to trigger.

HDMI Black Screen  - This one bugs me the most atm, it will work the first time it is plugged in but after that i only get a black screen. I brought this phone for the idea of a linux box in my pocket so not having this functionality is killing me.

Keyboard Backlight ✔️ - I have resolved this one. Here is my python script and a installer so you can fix it yourself. It also auto-hides the on screen keyboard when it is pulled out. Just download, unzip and run InstallSliderDaemon.sh . Current script is as stable as it gets. Please download and let me know if you have any bugs.

Cellular Internet ✔️ - I have "Patched" this one too. Download it here. It seems that the rmnet device interface is unable to determine its own DNS server so I made a simple script that sets the global dns to the OpenDNS name servers. Additionally the script also works as a way to change your dns server if you type fixLTE 8.8.8.8 8.8.4.4 or change the details in the script.

Anbox  - @order#10248 has linked this gofundme to get this patched. It is nearly at the halfway point and im going to donate a chunk in once i get enough of these bugs squished.

Bluetooth ✔️ - Finally found the fix. Its stupid simple and took me way to long. Basically the android Bluetooth binding program is loading before unity and causing problems. The init conf calls it after LightDM which is called before unity. The stupidly simple fix to this is simply make the program wait 5 seconds before running which works with great success. Once again here is a install script to patch it.

MTP Access - I only noticed this this like an hour ago but it's still handy to have.

Lock Animations  - IT TAKES LIKE 5 GOD DAMN SECONDS TO TURN OFF THE DISPLAY!!!

If you are having any annoying issues feel free to drop them in the comments and I will add them to the OP.

I am unsure where to find the source for the Pro 1's UBPort as I think it was done in-house at FXTec so if anyone has a link to an up-to-date git I would love to push some of these fixes into upstream.

 

Cheers,

Pro1-LTE-Fix.zip Pro1-KB-Fix.zip

Pro1-BT-Fix.zip

Edited by Zahkc
Included patch for bluetooth and
  • Like 1
  • Thanks 6
Link to post
Share on other sites
On 12/7/2020 at 6:05 AM, Raksura said:

I've been using Ubuntu Touch for about a week:

Here's a report of what works and what doesn't:
- OS Install process: almost perfect, a slight documentation issue for first time ADB users on Windows 10. ✔️
- OS Welcome thingy: Impeccable. ✔️
- Wi-Fi connection: Impeccable. ✔️
- Lorimi (the window manager): impeccable. ✔️
- The default terminal app: works well. ✔️
- GPS: does not work. That's an immediate deal breaker for me, but since I don't need to travel during our current quarantine, I'll test things out more.
- Media player (for music): impeccable.  ✔️
- Default web browser: impeccable. ✔️
- Mail application: there is none by default. The recommended one works just fine. ✔️
- Synchronization with Google account: impeccable (contacts + calendar). ✔️
- Calendar: works as intended, which isn't great (there's no event hub, so I can't easily tell what's about to happen). ✔️
- Camera: front and back camera seem to work. The flash also works. ✔️
- Charging: it charges, but the icon doesn't change to indicate it's plugged in. I don't know if that's intended. ✔️
- Flashlight: does not work.
- HDMI output: crashes the phone.
- Screen orientation stuff: almost perfect. ✔️
- Physical keyboard inputs: impeccable. ✔️
- Physical keyboard backlight: does not work.
- Cellular Internet: does not work. That is also a big issue.
- MMS: does not work. Yet another big issue.
- Telephony: I had a very problematic issue on my first install. After doing a full firmware restore and a clean Ubuntu Touch install (didn't transfer previous home directory), things seem to be working.

All in all: great OS, not ready for daily use on the Pro1 yet.

I wouldn't consider Ubuntu Touch as being ready for use as a daily driver until it has GPS, cellular internet, and MMS working.

@Raksura wrote this list a while back and from my testing and with my patched the following are now working: Backlight, Cellular Internet, MMS and Telephony.

So it is getting much more usable as a daily driver IMO.

  • Thanks 2
Link to post
Share on other sites

@Zahkc, a very big thank you for sharing your findings here!

I am using code snippets for keyboard backlight and bluetooth and find them extremely useful.

Bluetooth: The script did not work for me, dont remember the error (and did not look after). I just added the line with "sleep 5" in /etc/init/bluebinder.conf manually. For that a rw (re)mount of / is needed. I had this set permanently before already with

sudo touch /userdata/.writeable_image

From next reboot / is mounted writeable. To have it mounted ro again, just delete/rm /userdata/.writeable_image and reboot.
Note that other subdirectories under /etc are always mounted with rw mode. For example /etc/NetworkManager/system-connections/ . There I could directly edit a connection file to access a 802.1x wifi with certificate based EAP-TLS (eduroam) ... UI settings don't offer this yet.

 

As for the HDMI out (via USB-C adaptor): It works pretty well after the very first connect after booting (and when connected during boot up). But after reconnect the Pro1 builtin screen changes to touchpad mode and HDMI screen is staying black/dar. Still, while it works it is fantastic! Very high potential feature .. see https://twitter.com/chenliangchen/status/1296597855973642242

 

I am currently struggling with keyboard layout. My Pro1 is a QWERTZ one. Which leads into "letters shifted 1 key to the left" problem with default installation of Ubuntu Touch ... . External USB keyboard is fine.

Ubuntu Touch is based on xkb for keyboard inputs . xkb is a nightmare. I somehow managed to setup a symbols file based on @mosen adaption at https://github.com/sailfish-on-fxtecpro1/droid-config-t5/issues/13   . But with (just) this, the yellow arrow keys don't work as a modifier key for most of the letter keys (so can't access what is printed yellow on the key, i.e. don't get the @ from the q key). But on some keys it works as expected. For example the "ü" key becomes "Ü" with shift and "~" together with yellow-arrow-key. I gave up on this (for a while).
Do all the keys work as it is printed on the keys with QWERTY Pro1s in Ubuntu Touch? As for QWERTZ I would count another red x into first post here ...

 

Cheers, order#10148

  • Like 2
Link to post
Share on other sites

Thanks for the info @order#10248

From my testing the qwerty layout works perfectly. Id love to help with that but I dont have that model for testing.

Just wanted to also point out so temp fixes for 2 of the remaining issues.

HDMI - Basicly from what i have found, this is an issue with the android display server not destroying the qt.screen properly. I am still working on a solve but a temp fix that wont require you do a full restart is this command:

sudo initctl restart lightdm

Its not even close to a proper fix but its somthing.

Lock Animation - This one is a funny one. Basicly i believe that the screen is steping down from the current brightness level to 0 (out of a possiable 255). A quick and dirty "Fix" is lowering your screen brightness.

For both these issues I am working on making a more perminate solution and pushing it to the UBPorts gitlab but this forum is for the quick dirty patches so once i get time to test those, ill put them in the OP.

  • Like 1
Link to post
Share on other sites
On 5/1/2021 at 8:05 AM, order#10248 said:

I am currently struggling with keyboard layout. My Pro1 is a QWERTZ one. Which leads into "letters shifted 1 key to the left" problem with default installation of Ubuntu Touch ... . External USB keyboard is fine.

Okay, I managed to solve this finally.

I found this driver source: https://gitlab.com/ubports/community-ports/android9/fxtec-pro1/kernel-fxtec-pro1/-/blob/halium-9.0/drivers/input/keyboard/qx1000.c 
where @tdm describes that there are different modes of the keyboard driver:  qwerty and qwertz.
In qwertz mode the generated keycodes by the internal micro controller are like printed on the QWERTZ version of Pro1 . The default mode with Ubuntu Touch is qwerty . No matter what is actually printed on the keyboard pads.
So how to switch the driver to qwertz mode? 
One way ist to execute in Terminal 

sudo sh -c "echo qwertz > /sys/devices/soc/c17a000.i2c/i2c-6/6-0058/layout"

After that key 'ö' will give ';' instead of lower 'L' in qwerty mode. Okay, thats still not 100% what we want ... 😉 and the final step is just to choose "German"  in system settings --> language & text --> keyboard laouts for external keyboards ". Then key 'ö' is 'ö' and rest is like printed on the keyboard pads ...

Unfortunately, this driver mode change is not permanent. After reboot the keyboard driver is in qwerty mode again - while "German" in system settings keeps set. 
Trying to have executed this command during startup I couldn't get a systemd oneshot-service to work. Instead I went the old school way and added the line 

echo qwertz > /sys/devices/soc/c17a000.i2c/i2c-6/6-0058/layout

into /etc/rc.local.
This is an readonly mounted area. To get it writeable I did a sudo touch /userdata/.writeable_image and rebooted 
(sudo mount -o rw,remount /  did not work as expected, did not try any further). You can do a sudo rm /userdata/.writeable_image and reboot afterwards to avoid unwanted other changes.
 

No xkb madness needed! At least for me, as I usually dont need extra special keyboard key levels (which are not printed on the key pads anyway). 
The German xkb layout adaption for Sailfish I linked before is based on a patch for Sailfish kernel by @TheKit , where the keycode for the Pro1s YellowArrow keys is mapped to a lower value (because it is too high by default to get recognized by xkb):
https://github.com/sailfish-on-fxtecpro1/kernel-fxtec-pro1/commit/c1635969787510687253c4fd860ac420e99e181a
The mapping is targetted to the keycode of "right Alt" (RALT) key, which is not existing/used on Pro1 keyboard. With this patch applied, the YellowArrow keys can then act as modifier keys for fancy xkb symbol files ... Note: The chars being yellow printed on the pads are still available via Shift or still just work with YelloArrow combi because they get produced by the internal microcontroller (i.e. the '<'/'[' or 'ü'/'p' keys ...).
I think the appropriate file to achieve the same for the Ubuntu Touch base for Pro1 is 
https://gitlab.com/ubports/community-ports/android9/fxtec-pro1/kernel-fxtec-pro1/-/blob/halium-9.0/arch/arm/boot/dts/qcom/msm8998-qrd-skuk-QX1000.dtsi


Anyway, I am happy now with my "builtin" German layout. Its a huge improvement in usability.

Cheers, order#10148

 

 

Edited by order#10248
typo
  • Thanks 4
Link to post
Share on other sites
  • 2 weeks later...
On 4/24/2021 at 7:38 AM, Zahkc said:

Cellular Internet ✔️

I had a look into this "DNS" issue. It's not based on setting up DNS wrongly for cellular data. Instead an IP route is blocking access to those DNS servers.

After every boot of my Pro1 I had an IP route for an usb0 device:

phablet@ubuntu-phablet:~$ ip route
...
10.0.0.0/8 dev usb0  proto kernel  scope link  src 10.15.19.82 linkdown
...
phablet@ubuntu-phablet:~$

I could not find where it is generated. Obviously it is for accessing the device (without usable UI) and with connected USB ethernet cable. For example: It is possible to do a ssh phablet@10.15.19.82 then.

My (and surely @Zahkc's one) mobile internet provider is doing NAT and giving me an IP like 10.157.148.24/28 with DNS server 10.74.210.211 . 
This constellation routes every DNS request through usb0 . Of course this can't work.

So I ended with another additional line in /etc/rc.local for deleting this usb0 route:

# to avoid overlapping netmasks with NAT in 10.X.X.X networks
/sbin/ip route delete 10.0.0.0/8
/sbin/ip route add 10.15.19.0/24 proto kernel src 10.15.19.82 dev usb0

The second ip route line is to keep up this possibility with connecting via USB network. But this time with a much smaller netmask which will hopefully never get in conflict  with external networks.

With this no overwriting of /etc/resolv.conf is needed and dynamic DNS servers (served via DHCP or mobile network) can be used. They're usually quite faster than static public DNS servers.

Cheers, order#10248

  • Thanks 1
Link to post
Share on other sites

I wonder what would be the best place to ask for help with the other issues. I couldn't find any angoing recent development or issue tracking for UT with Fxtec Pro1. Did I miss something over at XDA-dev?

UBorts have claimed they cant give support, as "development is mostly done by manufacturer Fxtec" ...
I would be happier with seeing them work together more closely ...

Do @tdm or @TheKit still stop by here every now and then?

Cheers, order#10248

Link to post
Share on other sites
  • 2 months later...

that's sad, UBTouch is still pretty much broken and incomplete even with all you both done(thanks to you for this)

I won't stay on this very long as it is way too much far from a daily driver. Keep up the good works I probably try it again later.

BTW I had problems with my Google account Synchronization, and I don't see you mention it anywhere.

When I try to log in I receive this error:

Couldn't sign you in
This browser or app may not be secure.
Try using a different browser. If you're already using a supported browser, you can refresh your screen and try again to sign in.

 

Link to post
Share on other sites
  • 5 months later...

Pinephone comes with a docking station. Plug in a usb drive - nothing whatsoever happens. Try to open File Manager- just a white screen that never initializes. WTF?

Things that are working: Bluetooth keyboard. Terminal. Web Browser. (End of List)

There are some things that are curiously good to explore: In terminal you can drag your finger up to see past commands you have entered. But how to see history of what has been on the screen?   

Has a fancy iphone-like view of running tasks, swipe up to kill. Done a lot of that, because nothing actually works. I can format the external micro SD on which the OS image is running - hokay. 

Trying to setup Libertine Containers ... maybe get something going (literally - golang) I will need gcc probably - woohoo!

Link to post
Share on other sites
42 minutes ago, manjaro said:

can't do anything on my pinephone with Ubuntu Touch. Trying it because i couldn't get one thing working on manjaro (a git project). But nothing works. File Manager: not work. No way to install common unix software like curl. W - T - F

Though this could be useful info for Pro1-users on Ubuntu Touch if the issues are general, I think you might find other fora more suited.
This forum is intended for the FxTec Pro1(X).
If the issues are specific to Pinephones try their forum. If it is general for Ubuntu Touch, try an Ubuntu forum.

Link to post
Share on other sites
13 hours ago, manjaro said:

No way to install common unix software like curl. W - T - F

I believe you have fundamentally wrong expectations regarding Ubuntu Touch. It is not designed as a traditional Unix, but as a smartphone OS, sharing quite a few concepts with Android. This includes app confinement (sandboxing), which actively breaks core Unix philosophy, as data "belonging" to one program purposedly cannot be easily picked up by another.

Installing a true Unix environment on UbuntuTouch is possible, but involves quite similar techniques than doing the same on Android, the difference being that with UbuntuTouch you use an LXC container while on Android we rely on traditional chroot'ing. 

If you seek a "standard" GNU/Linux OS for phones, your Manjaro on PinePhone was actually a much better bet. Sailfish may be the closest you can get with standard Android-devices (like the Pro1).

I agree with @EskeRahn that this discussion has little to do with the Pro1(X).

Edited by claude0001
  • Like 1
Link to post
Share on other sites

I am a programmer. I have since gone back to Manjaro. I did not want to totally dismiss what has been done with Ubuntu Touch. I can see that a lot of work has been put into it. I just think, and this has happened to me in my career, the target and goal were off the mark. They are trying to meet Apple in terms of GUI standards, it appears. There is no way that will come to pass. Apple is vertically integrated whereas Ubuntu Touch would need to adapt to whatever hardware it gets installed onto. I don't think the Pro1(X) makes any difference. The phone is expensive and the GUI I don't see how it will be able to compete. If you don't want people to be able to develop on it, why have a keyboard?

Manjaro has a true linux approach. I have been able to compile and adapt packages like CMU Sphinx to work on the 64 bit ARM. There is a lot of opportunity for locally based speech recognition. This would beat anything that Google or Apple has going. You lose your internet connection, Alexa and Siri's IQ drops to near zero. I have the software working now. The pinephone is not powerful enough to smoothly handle it. But on pinephone everything is replaceable, even the processor SOC board.

Edited by manjaro
  • Like 1
Link to post
Share on other sites
14 hours ago, manjaro said:

I did not want to totally dismiss what has been done with Ubuntu Touch. I can see that a lot of work has been put into it. I just think, and this has happened to me in my career, the target and goal were off the mark. They are trying to meet Apple in terms of GUI standards, it appears. There is no way that will come to pass. Apple is vertically integrated whereas Ubuntu Touch would need to adapt to whatever hardware it gets installed onto.

That could not be more true.

Canonical (at the time they still backed the project) would have liked us to think about Ubuntu Touch and the Ubuntu distribution for PCs as two flavours of the same OS -- as in iOS vs. MacOS. Many users unaware of technical details may believe that to this date.

The truth is, for all but a few exotic devices (like the PinePhone), Ubuntu Touch does not even use an Ubuntu Linux kernel! It bundles a minimal version of the device-vendor supplied Android system, including its kernel and driver blobs. It then uses compatibility layers (libhybris) to interface the AndroidOS (bionic) from the Ubuntu userspace (GNU). As a consequence, only apps specifically developed against libhybris can take advantage of all Android APIs, while standard programs developed for the desktop arm64 Ubuntu distribution are limited in their system calls to what the vendor kernel allows directly. That's the reason why, e.g., X11 programs running in Libertine containers cannot have hardware accelerated graphics.

To my knowledge, the limitations one encounters when running standard Unix software on Ubuntu Touch are identical when compared to running the same software in a chroot of Android. I hence gave up on waiting for Ubuntu Touch to mature and settled for a chroot-on-Lineage solution with my Pro1. That way, I have the best (or close to) of both worlds: a fully-functional Android smartphone environment plus a Debian desktop distribution for doing serious work.

I agree that having a native GNU/Linux system would be preferable, but the Pro1 is not that kind of device. Neither will be the Pro1X.   

Edited by claude0001
  • Like 1
  • Thanks 1
Link to post
Share on other sites
  • 11 months later...

@Zahkc I would like to-do the keyboard fix. I've move the file's to .local/share and ran script 

phablet@ubuntu-phablet:~/.local/share$ InstallSliderDaemon.sh
-bash: InstallSliderDaemon.sh: command not found
phablet@ubuntu-phablet:~/.local/share$ ./InstallSliderDaemon.sh
-bash: ./InstallSliderDaemon.sh: Permission denied
phablet@ubuntu-phablet:~/.local/share$ sudo ./InstallSliderDaemon.sh
sudo: ./InstallSliderDaemon.sh: command not found

Sorry I'm a noob.. Do I need to install python and how..

I've tried apt and apt-get 🥴

Thanks for your time

(M_P)

Link to post
Share on other sites
  • 4 months later...
  • 5 months later...

So with the recent blast email letting everyone know that Ubuntu Touch UBPorts installer is supported now, I decided to give it a go (after flashing back to stock). 

The overall flash process went smooth and setup was mostly ok (had some weird overlay issues due to order of operations, but all in all useable). 

My current issue is that whenever I close the phone, the screen turns off and stays off. If I open it, it works / behaves properly. Guessing there's a setting I'm missing but I'm just not finding it. 

Assistance would be appreciated. 

Thanks!

  • Thanks 1
Link to post
Share on other sites
  • 3 weeks later...
On 10/27/2023 at 12:32 PM, FreshNeverFrozen said:

So with the recent blast email letting everyone know that Ubuntu Touch UBPorts installer is supported now, I decided to give it a go (after flashing back to stock). 

The overall flash process went smooth and setup was mostly ok (had some weird overlay issues due to order of operations, but all in all useable). 

My current issue is that whenever I close the phone, the screen turns off and stays off. If I open it, it works / behaves properly. Guessing there's a setting I'm missing but I'm just not finding it. 

Assistance would be appreciated. 

Thanks!

1.Open the terminal and run the command to edit the `logind.conf` file:

  sudo nano /etc/systemd/logind.conf

2.Find this value and modify it to, be careful not to remove #.

    HandleLidSwitch=ignore

3.Finally, apply the changes by running: systemctl restart systemd-logind.service

4.restart cellphone

Before starting, please modify the permissions of logind.conf to read and write.

  • Thanks 1
Link to post
Share on other sites
On 11/13/2023 at 1:44 PM, kelvin said:

1.Open the terminal and run the command to edit the `logind.conf` file:

  sudo nano /etc/systemd/logind.conf

2.Find this value and modify it to, be careful not to remove #.

    HandleLidSwitch=ignore

3.Finally, apply the changes by running: systemctl restart systemd-logind.service

4.restart cellphone

Before starting, please modify the permissions of logind.conf to read and write.

I tried this because I have the same issue as @FreshNeverFrozen.

However...

So, to the experts: Any ideas? Would be greatly appreciated... 🙂

Michel

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms