yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] lambgx02:
Hey a-dead-trousers. :)

It's nice to know someone's working on LineageOS for these devices, which, unsurprisingly have already been abandoned by Unihertz. Sigh. For the life of me I can't understand why smaller manufacturers don't just start with LineageOS, and then let the community take over.

I've got an XL, managed to get TWRP running, and the latest build installed (only after flashing the super.img you provided). Though flashing super.img seems to resolve the partitioning error, I did notice that TWRP also complains it "Failed to mount '/system_root' (Permission denied)" .. same root cause?

On reboot, it sits at the black Unihertz screen for about ~3 minutes, then reboots into TWRP. Subsequent boots are much faster, but always directly into TWRP. Can't adb logcat during the initial boot.

I'm using the TEE / nonEU version of everything. Is this hardware-specific? What's the actual difference between the two?

Any idea how I can get log data during boot?

Thanks for everything. I'd be more than happy to contribute (did a fair bit of kernel and rom dev back in the day, but it's been a while. :p

edit I just noticed TWRP has a new error message after rebooting from a failed system boot:

Android Rescue Party trigger! Possible solutions? Either:
1. Wipe caches, and/or
2. Format data, and/or
3. Clean-flash your ROM

The reported problem is:
'--reason=RescueParty'

Will research.

edit2 I found something interesting. In /data/tombstone there was a log from the last boot. Looks like something weird is happening with volte_imcb:

LineageOS Version: '17.1-20210510-UNOFFICIAL-Atom_XL_TEE'
Build fingerprint: 'Unihertz/Atom_XL/Atom_XL:10/QP1A.190711.020/root.20200928.094206:user/release-keys'
Revision: '0'
ABI: 'arm'
Timestamp: 2021-05-11 21:35:26+0000
pid: 846, tid: 846, name: volte_imcb >>> /vendor/bin/volte_imcb <<<
uid: 1000
signal 15 (?), code -6 (SI_TKILL), fault addr --------
r0 fffffffc r1 00000089 r2 000000a8 r3 00000000
r4 00000000 r5 ffffffff r6 06fc1ba0 r7 000000f0
r8 000000a8 r9 ea111004 r10 0000006f r11 ffaa3d30
ip ffaa3ca0 sp ffaa3c90 lr ea4e9fbd pc ea4e4bd0

edit3 Hah, success! I don't know if it's a hardware thing, but I flashed the EU version of the offical rom with SP_Flash_Tool, then your EU build, and that did the trick. Wonder if that VOLTE issue was a coincidence or caused by the wrong ROM. Interestingly, both the official EU and TEE builds ran fine. Out of curiosity, do you have any idea why the FM radio audio isn't working? I'll start having a look.

yet another edit lol It looks like the Intercom audio might be broken along with the FM radio.. no sound when set to squelch level 0. Can anyone else verify on the latest build?
[Miscellaneous Android Development] a-dead-trousers:
The difference between EEA and TEE is only in the software not hardware.

The EU has some restrictions on what software to include and also how to connect to networks (as SepticFuddy mentioned he had problems with connecting).

"Failed to mount '/system_root'" is a hickup in TWRP not an actual error. I'm not sure how to fix this though as '/system_root' is the mount point for the system-partiton of the ROM if you choose to mount it from the "Mount"-Menu.

I had this "black" screen and kept getting into recovery twice just recently:

First was caused by me booting into "fastboot" instead of "bootloader". Currently my TWRP is not able to handle fastboot properly so the only way to get around this was to flash LOS recovery and switch back to "normal" recovery mode from there.

Second was cuased by me decrypting my device from inside TWRP and subsequently messing everythign up (see my posts in the TWRP thread). Here I had to reflash stock ROM and do everything from scratch. I think it somehow messed up vital partitons (persist, protect) and with stock ROM theses are reset to factory defaults.

Maybe there is a problem with the XL TEE build as I'm not able to test this properly.

I'll check the out-directories and compare them when I get home.

The FM radio app from mediatek needs some modifications in "libaudioclient".

attempt to fix fmradio by shadowofleaf96 · Pull Request #7 · ADeadTrousers/android_device_Unihertz_Atom_LXL

this will fix 'dev/fm permission denied' error and make fmradio work but there no sound coming from the earpiece or speakers you need this modified framework/base to avoid force close https://githu...

github.com

But I haven't got time so far to dig deeper into this.

Also I'm more into getting the LOS implementation to work, because with every subsequent LOS update (17.1 > 18.1) the mediatek app is bound to fail as long as we don't get any updates from unihertz (10 > 11).

Include FM radio · Issue #3 · ADeadTrousers/android_device_Unihertz_Atom_LXL

The FM radio app and everything needed for it seems to be on product. But before I include it I want to make sure that there is not other option. Best would be to have an "open source" alternative.

github.com
[Miscellaneous Android Development] lambgx02:
Interesting. Is there any advantage to reinstalling the official TEE firmware and then your lineageos build again? Or does your build completely replace the parts that differ?

Gotcha.

I was running an official firmware I modified to remove the red Chinese watermark that appears if you, say, accidentally nuke your nvram data (along with the attestation keys), haha. Maybe that's what broke it in my case, though reflashing the TEE rom didn't seem to fix it. Weird.

I'll have a look. I was able to grab a logcat while launching Intercom and found this:

05-12 14:50:49.302 483 14143 E alsa_device_proxy: proxy_open() pcm_is_ready() failed: cannot open device '/dev/snd/pcmC1D0p': Permission denied

As a test I set mode 666 on that device, and that did stop the error messages, but still no sound from the Intercom app. Interestingly, it also seems to stop all sound from the phone (dialtones, notifications, etc) so long as it's running.

Will keep on it.

Wonder if anyone's working on a replacement for Intercom. It's pretty crappy haha.

Aside from the Intercom/fmradio issue, your build is flawless! It's such a relief to be off the official rom. Bluetooth audio is finally stable again! Thank you so much.
[Miscellaneous Android Development] a-dead-trousers:
The only thing I don't modify is vendor. So if you have a TEE vendor mixed with an EEA ROM (or the other way round) I'm pretty sure that's not gonna work as for example parts of VoLTE are found on both partitions.

That sounds pausible. Only the stock rom flash (using spflash) will do a real factory reset as all partitions are being written.

That's interessting. I wasn't able to test intercom that much. I was only trying to get the app up and running and that's it. Your finding suggests that it's the same as with FMRadio that there is something missing in the audio libraries for both apps to tap into the audio subsystem.

I highly doubt that because intercom is a tailored app specifically made for the hardware chip that's built into the phone.

Thx.
[Miscellaneous Android Development] landsome:
I seem to have no luck... I've tried installing LOS with the latest twrp and build (May), after a previous attempt with last month's builds. I follow the procedure closely but I have the same problems:

- I keep getting a failed to mount /system_root error

- with ADB download I get a 'Total xfer: 0.00x' message within about a second

- installing via Install zip (after error 7 and installing the super.img) gets me to a similar /system_root error

What to do, what to do?

I have the EU version of the Atom L (so I used the EEA builds). Also, the GSI AOSP installs like a breeze (via stock recovery), but currently has a few dealbreakers for me.
[Miscellaneous Android Development] a-dead-trousers:
Like I wrote previously the "failed to mount /system_root" error can be ignoerd.

I just recently had to reset my whole phone (decryption error in TWRP) so I can tell you what I had to do to get everything back the way I wanted (and I used my own install guide for that):

Reflash the stock rom (cause something got messed up) from windows.

Boot into stock to be able to boot into bootloader.

Flash the vbmeta and the recovery.

Boot immediately into recovery (by pressing vol. up on reboot) otherwise stock ROM will reset it.

Transfer the LOS zip file onto my external sd via "adb push" from Linux.

EDIT: Actually I also had to flash my modified "super.img" ;)

Install the zip from "Install" menu in TWRP.

If you use Windows (as I've heard some say they have problems with connecting their phones) try it with linux (if you have the option to do so)

Another way could be to build your own "super.img" and flash it either from bootloader mode with fastboot or using the spflash tool from mediatek.

android_device_Unihertz_Atom_LXL/docs/HOW-TO-FLASH-SUPER.md at master · ADeadTrousers/android_device_Unihertz_Atom_LXL

Common device tree for the Unihertz Atom L and XL - ADeadTrousers/android_device_Unihertz_Atom_LXL

github.com
[Miscellaneous Android Development] landsome:
Thanks. I did exactly that a few times, each time starting from stock, and the phone boots into twrp after installing LOS.

No problem with windows
[Miscellaneous Android Development] a-dead-trousers:
Did you boot into "fastboot" instead of "bootloader" by any chance?

Had that once and wasn't able to get out of it unless I flashed LOS recovery to switch back to recovery mode.

Other than that this sounds like it couldn't boot into system. Do you get into the recovery immediately or is there a short time of black screen (more than 2 sec.). Normally if that happens you also get an error message within TWRP that system wasn't able to boot In the log screen.

Maybe there is a problem with selinux. Had that while figuring out the parts I need from stock rom to get everything working. Could you please provide the kernel log from the last boot with "adb shell cat /proc/last_kmsg > last_kmsg.log" right after you reboot into TWRP.
[Miscellaneous Android Development] WeAreGod:
SUCCESS , THANK YOU SO VERY MUCH FOR THIS IMPORTANT WORK.
[Miscellaneous Android Development] landsome:
Bootloader. But I could not install GSI AOSP from bootloader, I needed to go into fastbootd for that.

As for warning messages, none in TWRP. Hard to say about the 2 sec delay.
[Miscellaneous Android Development] a-dead-trousers:
May I ask which device & region?
[Miscellaneous Android Development] a-dead-trousers:
The more I think about it, the more I belive it's a problem with AVB/VBMETA.

This should prevent a boot without the proper system. Are you sure that you disabled all three checks? With the vbmeta.img I provided?

If yes, then the only other option I can think of is to flash a complete "super.img" like I mentioned earlier. This should rule out all possible problems that TWRP might cause.
[Miscellaneous Android Development] landsome:
Thanks. Yes, I flashed all the vbmeta instructions every time. I installed super.img as per guidelines too, but I will check above about the "complete" install.
[Miscellaneous Android Development] WeAreGod:
Unihertz Atom XL, Chinese made, shipped to US. Not sure how to check region but it shipped with USA Plug. Installed using EEA packages
[Miscellaneous Android Development] a-dead-trousers:
Then you are most definitly on a Stock TEE as EEA is for EU.

I'd recommend you use the TEE packages (super.img & LOS.zip)
[Miscellaneous Android Development] it_unihertz_when_i_pee:
I got my L running on this ROM this morning, so thank you very much for the build and instructions, very helpful and comprehensive. Dead Trousers has been a hero dealing with these issues with these phone models and I owe them a beer.

However, I encountered a new problem that I find as fascinating as it is frustrating.

tl;dr version

Using stock ROM, LTE is functional on regional carrier. On Lineage, LTE (or any data, to be more precise) does not work, but calls/texts do. Is this an upstream problem in Lineage, or is there something specifically missing from this ROM? How do I diagnose/troubleshoot this?

Full version

I recently moved to a rural area. I have a SIM card from the regional carrier, Appalachian Wireless. Mobile data did not work on the old, unmaintained Lineage ROM I was previously using. My phone would show Verizon (?!) as the carrier.

I wanted to try the ROM in this thread, so I factory flashed my phone back to stock, and discovered that mobile data was now functional. On the status bar, the phone correctly showed Appalachian Wireless as the provider.

After installing this ROM, mobile data is non-functional again, and again shows Verizon as the provider. This leads me to believe that there is something missing or incorrect, either upstream in Lineage itself, or in this particular ROM. However, I'm not sure how to diagnose or troubleshoot this.

According to Wikipedia, Appalachian Wireless uses EV-DO and LTE for data networks. When using the stock ROM, the data service worked, so I know that the Atom L itself is compatible with this network.

If I can provide more details, or if anyone has any ideas to try, I'm happy to take some shots at gathering more information.
[Miscellaneous Android Development] a-dead-trousers:
You mean "simple" LTE for mobile data or VoLTE for actual phone calls over the network?

LTE should work though. I use it all the time.

As with the provider name I'm currently bound to what APNs unihertz offered in their ROM. As far as I know the 2021-05 update offers more options. So that would explain why you see now "Appalachian Wireless" (a subcontractor?) instead of "Verizon" (the actual carrier?).

You mentioned in your other post that you updated the stock rom. Did you try LTE with the 2021-05 vendor or with the 2020-11 vendor? The last few days I got some reports that the 2021-05 update messes up TWRP as I use stock 2020-11 binaries and those seem to be incompatible with the 2021-05 update. Therefore I wouldn't be surprised that it also causes problems on LOS which also includes binaries of 2020-11.

For now until unihertz decides to release an updated release package on their google drive I'd recommend everyone to only use the 2020-11 vendor (which I provided with the super.img) in combination with LOS and also don't do the update if you are using my TWRP on stock ROM (and want to keep using it).
[Miscellaneous Android Development] WeAreGod:
Thank you! :)

Will I have to reinstall everything like a factory reset? Or is there a way I can keep current progress & user data while switching to the TEE
[Miscellaneous Android Development] a-dead-trousers:
You could try but I won't get my hopes up too high so do a backup.

I just recently found out that the encryption between Atom L and XL seem to be not compatible. Therefore I couldn't test my TWRP for the Atom L on my Atom XL encrypted userdata.

So I'm also worried this might be the case between EEA and TEE. Maybe not immediately as I was able to switch between the two Atom XL variants without problems but in the long run there could be unforeseen side effects.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
Simple LTE, just mobile data. Did not test VOLTE, and it isn't something I care a lot about.

My successful mobile data test was with the 2020-11 version, freshly flashed.

So I SPFlashed the 2020-11 to factory stock, booted, tested data successfully, and then walked through the steps you documented, but data isn't working in LOS. So there's something missing somewhere, but I'm not sure what.
[Miscellaneous Android Development] a-dead-trousers:
Did you check your apn settings?

Settings > Network > Mobile > Advanced > Accesspoints (APN)

Maybe, as you were telling that your provider is not recognized only the carrier, you are missing an apn.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
See screenshot. By default, none of them were selected. Selecting any of them doesn't make any change. This stands to reason as Verizon is not my actual carrier.

I think this is as close to an explanation as I've heard so far. So then is this something missing from the upstream LineageOS? Is there anything I can do about this? Some searching says that one can add/edit APNs from within the interface, but is there any way to tell what I should use?
[Miscellaneous Android Development] a-dead-trousers:
Go to your providers webpage. There should be a FAQ or similar thing which tells you what settings you need for their apn. To add/edit it use the three dots menu in the upper right (don't forget to "save" it also using this menu).

AFAIK the 2021-05 update brings more preconfigured apn settings but unihertz hasn't released a full update pack yet, so I can't integrate it into my ROM. Or someone can point me to a more recent file (apns-conf.xml). According to the comments it's provided by google and includes additions made by mediatek and unihertz. So there could be one that's better equipped.

EDIT:

Or I could try to use the one provided by LOS instead. My provider is on the list while it's not on the list of unihertz.

https://github.com/LineageOS/android_vendor_lineage/blob/lineage-17.1/prebuilt/common/etc/apns-conf.xml

Can you verify that your carrier/provider is on the list?
[Miscellaneous Android Development] it_unihertz_when_i_pee:
It is not.

However, it *is* in the one provided by Google, which I found here:

https://android.googlesource.com/device/sample/+/refs/heads/master/etc/apns-full-conf.xml

Is this useful?

I would try using this information to add a new APN, but I don't seem to have a button for adding a new one, only editing existing ones, and almost all of the settings are greyed out. Searching leads me to other people reporting the same thing with LOS ROMs, even as far as those on the same carrier, so at least I know I'm not in a unicorn situation.

Edit: here are the relevant APNs for my carrier

<apn carrier="appalachian"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="CdmaNai"
mmsc="http://mms.ekn.com"
mmsproxy=""
mmsport="80"
type="mms"
carrier_enabled="false"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="6"
/>
<apn carrier="Appalachian IMS"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="13"
/>
<apn carrier="Appalachian IMS"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWIMS"
type="ims,ia"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="14"
/>
<apn carrier="Appalachian FOTA"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="13"
/>
<apn carrier="Appalachian FOTA"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWADMIN"
type="fota"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="14"
/>
<apn carrier="Appalachian"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWINTERNET"
mmsc="http://mms.ekn.com"
mmsproxy=""
mmsport="80"
type="default,mms,dun,supl"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="13"
/>
<apn carrier="Appalachian"
carrier_id = "1813"
mcc="310"
mnc="750"
apn="VZWINTERNET"
mmsc="http://mms.ekn.com"
mmsproxy=""
mmsport="80"
type="default,mms,dun,supl"
protocol="IPV4V6"
roaming_protocol="IPV4V6"
bearer_bitmask="14"
/>
[Miscellaneous Android Development] a-dead-trousers:
I'll try to include the google list in my next update. It will be released as soon as the security update 2021-06 is available. My provider is on that list too but with different settings. It got acquired years back by my old carrier and is now a cheap brand subsidiary. Maybe these are the settings before that. At least I have the options to change it if it didn't work.

Apropos:

Are you at least able to "delete" an apn? In Stock I had some unreleated entries too that I needed to purge beforehand. In LOS the list was completly empty. Maybe you need to delete one first in order to create a new one.

Also in stock rom I had to activate "roaming" to be able to use mobile data as only my carrier network got detected not my provider. No higher charges though as like I said my provider is a subsidiary of the carrier.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
No, I can't delete any APNs. On the edit screen, I can only save or discard changes.

I tried enabling roaming with no change.

I appreciate your work, and your willingness to troubleshoot with me. You're the best.
[Miscellaneous Android Development] a-dead-trousers:
I found an app to modify the apn settings.

https://community.giffgaff.com/t5/Help-Support/Can-t-delete-or-edit-APN/m-p/14704651#M4605690

Could you please give it a try maybe even with the google list to make sure it's the right list. Thanks.
[Miscellaneous Android Development] it_unihertz_when_i_pee:
I tried to find both of the apps mentioned in this post and found neither. Pics related. I think that post is just out of date, given that its almost 7 years old.

I tried some other random APN settings app, which had an interface to add a new APN, but it didn't actually save or persist. That is to say, when I check the settings after using the app, the APN I configured was no longer there.

Then, I tried copying (as root, with a read-write remounted /) the xml file to /etc/apns-conf.xml and separately to /etc/apns-full-conf.xml and rebooting, followed by resetting APNs to default, with no change. The files were gone after a reboot so maybe I did something wrong there.

Reading elsewhere, people suggested booting the phone without a SIM to be able to change APN settings, but when I try this, the mobile network settings are greyed out and entirely inaccessible.
[Miscellaneous Android Development] a-dead-trousers:
That's because /system is essentially read only. As a last means you could search for a magisk module to do that. Magisk is able to "overlay" parts of /system. Or you could try to make module yourself ;-)

It should be rather simple. Just place the apns from google in the correct subfolder of the magisk template. The rest is done by magisk.
[Miscellaneous Android Development] Prospero.X-3:
Do you guys happen to have any kind of group chat for these devices? I may be able to buy one (with the intention of flashing this) and I'd appreciate your input.
[Miscellaneous Android Development] a-dead-trousers:
Group chat? You mean WhatsApp, Signal, telegram? Or something else?

If you install gapps you're able to use all of playstore.

And there is also MicroG.
[Miscellaneous Android Development] Prospero.X-3:
Thanks for the quick reply! Aha, no, I mean a group dedicated to the device. Most devices have one set up on Telegram. It makes communication and collaboration a lot easier.
[Miscellaneous Android Development] a-dead-trousers:
No, haven't got time for that.

This forum is the best I can offer ;-)

I don't like an "exclusive" cycle of informed.
[Miscellaneous Android Development] a-dead-trousers:
I just did a new release including the latest vendor update from 2021-05-18.

Therfore you need to do some manuall upgrade steps in order to successfully install this release.

If you don't do that Lineage OS won't boot (green line on top of screen and then freezes).

Simply follow my upgrade guide and everything should work just fine.
[Miscellaneous Android Development] lambgx02:
Hey @a-dead-trousers,

Just installed your update on an EEA Atom XL. Everything went smoothly; beautiful work. Thanks so much. :)

Can confirm FM radio works now, but still no love from the GMRS/UHF radio. Will keep testing.
[Miscellaneous Android Development] a-dead-trousers:
Thanks.

The DMR/GMRS/UHF is the next "big" thing I'm going to work on. My guess is that it is the same "problem" as stock FMRadio had (therefore I integrated the LOS variant): It's probably reliant on some lightweight modifications on the audio subsystem (MTK_AUDIO). I was already able to get my hands on the (closed?) source code but I'm not sure of the best way to integrate it.

Patching would mean that it can only be used through this rom. But as soon as a change on LOS/AOSP happens it's incompatible and needs to be updated.

Forking would mean others could use it too. But I'd need to support it more openly like merging the changes from LOS/AOSP or it would miss vital updates.

Decisions, decisions, ...