Guide to Suitable Phone State
#1
Hey all. The PinePhone Pro was released in what I see as a fully-disclosed early adopter state.



In spite of that openness, I see posts here which claim that it's not possible to make the device work correctly. I, at least, have everything I need working fine, so I figured I'd share how you too can get to that state. By posting this I hope to accomplish three things:



1. Making users who claim it's impossible to make such-and-such feature work or "the device isn't ready for daily driving!!!" go away

2. Help very technically proficient users get their own devices into a better state

3. Show maintainers what they should make happen out-of-the-box to provide a superior user experience for the PPP



That said, there is a major caveat here: I don't present these steps as "easy" or "simple". This is just a summary of exactly what you have to do to go from a fresh PPP to a working daily driver, right now.



Inventory of what works after following this guide:

- Arch Linux ARM base (community support), with several patches to important components like the kernel

- Encrypted root (for me, this is a requirement for a daily driver) with graphical unlock working with both touchscreen and hardware keyboard

- SXMO desktop environment

- Phone calls

- SMS

- Suspend/Crust, reliably, including receiving calls while suspended

- PinePhone hardware keyboard case, inc. charging

- Bluetooth, inc. audio

- fwupdmgr and pacman updates like a normal computer



What does not work even if you follow all these steps:

- Either camera (kernel support exists, but userland isn't finished yet)

- After resume from Crust, on some but not all occasions non-call audio is sped up by a factor of exactly 3x, with the corresponding increase in pitch. I have seen developers comment on this before so I believe it's a known issue. You can see that's what's happening because using mpv to play the audio at 0.33 speed (disabling auto pitch correction) results in normal audio. I have not yet devised a reliable way to poke the phone out of this state.

- Booting the phone if you entirely deplete the battery. Don't entirely deplete the battery. If someone tells you there's something that doesn't work right, please stop posting thread after thread pointing out that the thing they said doesn't work... doesn't work.

- SXMO doesn't have a proper lock screen. Very disappointing. The hardware keyboard keys will still work through "lock" and also there is no PIN screen. I'm exploring putting swaylock or similar on the phone, which should work fine.

- SXMO doesn't let you use the phone normally while in a call. Also just a software problem.

- You need to disable charging the phone with the hardware keyboard to be able to use the phone USB port for ANYTHING, including something basic like a Yubikey. Not just charging! If the keyboard is powering the phone, you can't use USB. This is a hardware problem.

- uBlock origin in Firefox has a rather broken UI



What is untested by me but might be important:

- Android app support w/Waydroid (reported to work...)



Credits: a huge number of talented developers wrote the parts I'm stitching together here. You should thank them for their work. All I've written is packaging scripts and configuration...



Revision Notes:

1.1 Removed step compiling a new kernel, as the kernel in danctnix's repo is now sufficiently up to date to work and can just be installed.

1.2 Removed custom build of Arch base, as Dreemurs distribution is now sufficiently up to date
1.3 Removed keyboard and SXMO customization, as Dreemurs distribution has those



All right, let's get into making our phone work!






Step 1: Install tow-boot

Follow the directions at https://tow-boot.org/devices/pine64-pinephonePro.html to install https://github.com/Tow-Boot/Tow-Boot/rel...004.tar.xz to SPI Flash .

Why? This bootloader/early firmware has enough platform support to make suspend work. It's also, unfortunately, the source of the can't-boot-when-battery-low bug: a dev should change tow-boot to read battery status and go to sleep immediately (NOT SHUTTING DOWN, JUST SLEEPING) if it's low. Recent versions of Dreemurs for PPP also require tow-boot.






Step 2: Get an encrypted root install image

Check out https://github.com/simon2github/PinePhon...-Installer (I used rev 18ea16c ). Choose SXMO.



This step will image your SD card.



Why? If you install straight from Dreemurs, you will end up with an unencrypted root filesystem. This way you'll get an encrypted one.






Step 3: Boot your new system

Insert the SD card and hold the volume down button while powering up the phone. You should see a blue LED and an absurdly long vibration. Seriously, the phone will vibrate full strength for like 15 seconds. I can't find the code that's making it do that (tow-boot says 200ms!) but it's ludicrous and should be changed. After the vibration you'll be prompted for the disk unlock and you now have a working Linux microcomputer.



That was easy, right? We're not nearly done yet though because the state you'll end up in will be only 95% functional. Still, it's a working Arch with an encrypted rootfs and a nice sxmo for us!

Why? Booting the OS checks we did the earlier steps correctly, and lets us use the phone to build further software instead of cross-compiling.






Step 4: OSS the modem and its firmware



Important note: it's up to you to ensure this step is legal where you reside. I'm not your supervisor.



Visit https://github.com/Biktorgj/pinephone_mo...k/releases and download modem 0.6.3 . Follow the given steps (flashall) on the device to image the modem to 0.6.3 . After doing that, visit https://github.com/Biktorgj/pinephone_mo...1097540652 and follow the directions from that comment too.

Why? The stock modem doesn't perform well in calls and also contributes to poor battery life. I have had much better performance with this combination. If you like, you can also update the firmware to *.003.* following the steps on the modem SDK page, but you don't 100% need to.







Step 5: Fix keyboard charging

Set up and enable a systemd unit file to allow the keyboard to charge the phone while it's on:

Code:
# cat /etc/systemd/system/kbcharge.service
[Install]
WantedBy=graphical.target

[Service]
ExecStart=/root/bin/kbcharge.sh
Type=oneshot
RemainAfterExit=yes

# cat /root/bin/kbcharge.sh
#!/usr/bin/bash
echo 1500000 > /sys/class/power_supply/rk818-usb/input_current_limit


Why? The default values will result in the phone battery depleting even when the keyboard battery is enabled.





Step 6: Enjoy

Bask in your working system. Refrain from saying the software is in an entirely unusable state, and instead focus on complaining about how you had to follow ten steps taking approximately a day to go from zero to a working phone. Help with upstreaming these changes and contribute back further improvements.



Enjoy your device, and feel good about helping to bring control back to the person who OWNS the hardware.
  Reply
#2
Thanks for this guide. I will try your suggestions on mobian in the next few days.
  Reply
#3
In Step 2, when I run build.sh, I encounter this error:

Code:
2022-04-27 13:34:59 (2.57 MB/s) - ‘build/tmp.oWwpDEUW9y/usr/share/pacman/keyrings/danctnix-trusted’ saved [44/44]

chroot: failed to run command ‘/second-phase’: Exec format error
ERROR: Failed to run the second phase rootfs build!

How to troubleshoot it?
  Reply
#4
The script uses /bin/bash.

Does your host system have /bin/bash?

You can see what it tries to run at https://github.com/dreemurrs-embedded/ar...ld.sh#L195 .

If you want, you can run the build on a pinephone - I think it tries to run systemctl inside the chroot, which means it should be done on an arm host. You can do that with qemu or by running the image build on a (probably unencrypted) pinephone or other arm64 host.
  Reply
#5
This looks like the system is still running from an sd card and not the installed eMMC memory from the factory.  Am I correct?

tom kosvic
  Reply
#6
That is correct. Running from the SD does work fine though.

If you want to move the install to flash afterwards that's possible, just make sure to edit the bootloader config for it.
  Reply
#7
(04-28-2022, 04:10 PM)Borealid Wrote: That is correct. Running from the SD does work fine though.

If you want to move the install to flash afterwards that's possible, just make sure to edit the bootloader config for it.

Add some description of what is meant by and how to edit the bootloader.  Provide a reference.

MMS is not listed as running. That is an essential for any daily business driver. Do you have it running?

As an aside, I have alot of problems with a cell phone that you need to run from an sd card and not the built in memory (that runs significantly faster). This is not the basic way to use a cell phone. The sd card is to be optional and for extra storage. This is so throughout the entire cell phone world except PPP.

tom kosvic
  Reply
#8
If I were you, I'd use the SD card. You can replace the SD without needing to get a new phone, so why would you want to write flash and shorten the device lifetime? With a good SD the speed doesn't make a significant difference in responsiveness of the phone interface, and what you're using comes from RAM either way.

The MicroSD card slot in the PPP is not positioned in a way that you can readily remove a card while the phone is powered on, so practically speaking the card lives in the phone long term.

You're welcome to do what you want with your device, but I don't think "most phones work this other way" is a good argument for why it should be that way. Most modern high-end phones don't even HAVE removable storage - likely because selling more internal flash is an easy way to get customers to pay as much as they are able for devices (aka perfect price discrimination).

You can find the settings for the bootloader in /boot.
  Reply
#9
(04-29-2022, 10:34 AM)Borealid Wrote: If I were you, I'd use the SD card. You can replace the SD without needing to get a new phone, so why would you want to write flash and shorten the device lifetime? With a good SD the speed doesn't make a significant difference in responsiveness of the phone interface, and what you're using comes from RAM either way.

The MicroSD card slot in the PPP is not positioned in a way that you can readily remove a card while the phone is powered on, so practically speaking the card lives in the phone long term.

You're welcome to do what you want with your device, but I don't think "most phones work this other way" is a good argument for why it should be that way. Most modern high-end phones don't even HAVE removable storage - likely because selling more internal flash is an easy way to get customers to pay as much as they are able for devices (aka perfect price discrimination).

You can find the settings for the bootloader in /boot.

My PPP is borked right now because my sim/sd card holder needs to be replaced that I think is due to excessive uses, i.e., insert/remove sd card.   I can't get a replacement sim/sd holder part as i have posted several times on hardware forum.  Doesn't read my sim card so no calls.  Used to read sim, call and get both sms and mms messages until it stopped.  My sim card is good because it works in PP phone fine.  I can start PPP phone from sd but can't make calls so I have no use for it.  I must have changed sd card a hundred times testing various OS/desktop combinations until sim/sd holder doesn't work anymore.

I was really into this effort.  But now i am getting burned out.  Posted 125 messages here over last few mionths.

Do you get mms messages with arch/sxmo?  I hadn't heard of sxmo before but I'll look into it.
  Reply
#10
Sorry your SD card slot is broken. As a tip for the future, you don't have to remove the SD card from the phone to write it.

If you want you should be able to put the phone bootloader into USB Mass Storage mode. See the bottom of https://tow-boot.org/devices/pine64-pinephonePro.html - if you have tow-boot on your SPI flash, holding volume up will make the LED turn "blue" instead of "aqua".

You should then be able to use the directions in Step 3 to install directly to flash.

I have no idea if MMS works. Plain SMS does. If your SIM slot is broken you're not going to be using either with the phone's built-in modem.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pine Phone Pro audio on phone calls: discussion, support and tips apink 42 11,425 12-26-2023, 02:14 PM
Last Post: apink
  Phone Attitude(Device orientation) lurkadillian 2 991 06-22-2023, 08:12 PM
Last Post: lurkadillian
  Pine Phone won't boot into recovery mode ninjapig26@gmail.com 3 1,674 02-18-2023, 06:14 PM
Last Post: fxc
  [Mobian] No return from locked phone arno_nuehm 1 975 02-06-2023, 07:57 AM
Last Post: arno_nuehm
  Phone shuts down unexpectedly Hobgoblin 3 1,520 12-20-2022, 01:11 PM
Last Post: Fish
  Sound completely gone with Mobian in Phone Call configuration EwigeBlumenkraft 2 1,688 11-11-2022, 09:18 PM
Last Post: apink
  PinePhone Pro Manjaro Plasma Mobile Beta 13 & No Audio with Phone Calls X0X0X0X0X0 0 1,049 11-02-2022, 02:09 PM
Last Post: X0X0X0X0X0
  Outgoing audio in phone calls gone linuxfreedom 6 3,163 10-25-2022, 08:40 PM
Last Post: apink
  Phone wont turn on with any SD Card inserted Ausfaller 3 2,304 07-21-2022, 10:20 AM
Last Post: Ausfaller
  PPP Phone rings with constant vibrate - turn off vibrate henrythemouse 0 801 05-16-2022, 03:59 PM
Last Post: henrythemouse

Forum Jump:


Users browsing this thread: 1 Guest(s)