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 5
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
Posted (edited)
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:

[email protected]:~$ ip route
...
10.0.0.0/8 dev usb0  proto kernel  scope link  src 10.15.19.82 linkdown
...
[email protected]:~$

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 [email protected] 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

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