Linux

Mistakes to Avoid With the PinePhone

As mentioned before by me and many, many others, the PinePhone Brave Heart edition is very much not road ready.  That’s fine, but it does mean you’ll probably find yourself reflashing your device’s image a few times.  What follows are the various mistakes that have led me to re-flash my phone.

Decreasing the Brightness

As soon as you move that slider, your brightness will go to nil. As in no image at all.  If you have SSH enabled, you can probably set that brightness back, but there’s a good chance that you’ll make the move prior to having SSH set up.  Whoopsie.

Applies To

  • Sailfish OS
  • Ubuntu Touch (only if you decrease it fully)
  • PostMarketOS (only if you decrease it fully)

Turning off WiFi

Under Ubuntu Touch, turning off WiFi somehow borks the radio, requiring you to toggle it off and back on.  Not a huge nuisance, but not nothing either.

Applies To

  • Ubuntu Touch

Following that modem.txt document

A lot of folk, myself included, have tried to enable voice calls by following this file.

Don’t. do. it.

The file relies on a custom kernel, and if you set your QDAI settings per this file, you will end up unable to make phone calls until you reset it to factory defaults – which you have to do manually.

Posted by Adam Labay, 1 comment

Ubuntu – The Most Stable PinePhone OS So Far

Of the four operating systems I’ve tried so far on the PinePhone, Ubuntu Touch (aka UBPorts) is the most stable, getting me nearest to actually placing a successful call.

Installation

The process starts by downloading the latest image, either from the Pine64 wiki or from the UBPorts Jenkins site. Flash the image onto a microSD card using Balena Etcher or your favorite flashing tool.

First Use

Initial startup works like a charm. You’ll want to attach to WiFi since the SIM won’t initially be read. Once you’re in, hop on the Interwebs and have some fun. Just nothing that requires audio, since that’s the next step.

Enable Mobile Data

Ironically, your fancy new phone won’t be able to use any mobile functions. You need to enable the modem, this time and every time you boot. There’s probably a way to turn the process into a startup script; I’ll report back if so.

At any rate, open the Terminal app and enter these commands (taken from this post):

sudo /usr/share/ofono/scripts/enable-modem
sudo /usr/share/ofono/scripts/online-modem

The sudo password is phablet

Once you’ve entered the first command, the second one is a piece of cake thanks to Ubuntu Touch’s nifty keyboard. Swiping up on the keyboard reveals the cursor, which is moved by swiping around. Nice touch, UBPorts.

Enable Audio

Much like enabling mobile data, you’ll have to do this every time you start the device.

Open the Terminal app and enter the following:

sudo modprobe snd_soc_simple_amplifier
sudo modprobe snd_soc_simple_card_utils
amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute
amixer -c 0 set 'Line Out' unmute

Optionally, add the line amixer sset 'Line Out' 100% to max out the volume (best I can tell, you’re setting the volume that 100% on the volume rocker corresponds to; i.e. if you leave this at 55% (the default), the loudest you can make your phone is 55% of its true potential).

Don’t Disable Wifi

If you do, it won’t come back. Rather, it will appear enabled, but no access points will appear and even saved APs won’t connect. To remedy, open Terminal and enter the following:

sudo nmcli radio wifi off
sudo nmcli radio wifi on

What Works

So far, I have successfully

  • Played YouTube videos
  • Surfed the web on mobile data
  • Rebooted the phone a bunch of times

What May Yet Work

It turns out that my cheapo FreedomPop SIM requires some proprietary app to do text and calls, so I can’t test that at present. But if the Reddits and the forums are any indication, I’ll be a lucky son of a gun if I manage to successfully place a call. Texts shouldn’t be a problem.

What Doesn’t Work

Taking a friggin screenshot. Maybe there’s another app required?

Updates to follow.

Posted by Adam Labay, 0 comments

PinePhone First Impressions

My PinePhone BraveHeart edition arrived yesterday, and the past few hours have been spent playing around with it and trying to place a basic call.  Findings so far:

For Developers and Maniacs Only

The folks at Pine64 make very clear that this phone is not a daily driver, but it bears repeating: this is not so much a phone as a fun Linux project with a SIM slot.  You have to install your own operating system, and none of the choices on offer claim to be even remotely road-ready.  In particular, the four I’ve installed so far have had one or more of these symptoms:

  • Unusably slow
  • Can’t find the SIM
  • Require a light to be shined on them to display anything
  • Lock you out without a password

Further, even the folks online who have managed to get past the above nuisances still generally can’t get the silly thing to successfully place calls – you know, the one thing a phone is supposed to do.  So again, not a daily driver.

But All Kinds of Fun to Play With

With all those caveats out of the way, the thing’s a hoot to mess with. If something goes pear-shaped, just pull out the microSD card and re-flash it. And at $150, the price point is great for a project.

What Lies Ahead

I’ll do my best to make the silly thing work, and will report back with whatever tips and tricks I come across.

Posted by Adam Labay, 0 comments

Raspberry Pi 4, Kodi, and Chrome – An Uncomfortable Alliance

For years, I have needed two devices in order to watch quality drinking-time programming in my bedroom:

  • A Chromebit, which runs Chromium, for those late-night binges of TVTropes.orgbut doesn’t run Kodi
  • A Nexus Player, which runs Kodi, among other things but doesn’t run Chromium
  • Two remotes and an HDMI switcher to make it work

Each component is fantastic at what it does – the Nexus Player, despite being largely mothballed, has a great interface, and the Chromebit is the easiest way to get Chrome on HDMI – but it sucks for the need to use two devices.

This summer, I decided to fix that mess.

What follows is a short list of things I tried, none of which could pull it off:

  • Raspberry Pi 3 running Kodi (too underpowered)
  • Raspberry Pi 3 running Emteria OS (see above)
  • Essential Phone running Android TV Launcher (mobile browser on a big screen is a wreck)
  • Raspberry Pi 4 running Emteria OS (not until Emteria releases a build for the Pi 4; I couldn’t properly hijack the Pi 3 build

Here’s what worked:

Here’s how to do it.

Step 1: Download and Install Raspbian

  1. Download Raspbian Buster. I wanted to customize my GUI, so I went with the Lite ISO, but ain’t nothing wrong with the Desktop version.
  2. Flash the image to your MicroSD card using your favorite flashing software. (I’m on Manjaro, so this meant BalenaEtcher, but Rufus is great for Windows.)
  3. If you’re on WiFi, you’ll need to connect. This is trivial if you downloaded Raspbian Desktop, since it happens on boot. If you’re using Raspbian lite, enter sudo raspi-config and choose Networking Options. Enter the SSID and password.
  4. Enable SSH. If you’re using Raspbian Desktop, then open a terminal window (if you’re using Lite, you’re already at one). Enter sudo raspi-config, choose Interface Options | SSH and enable.
  5. Reboot to make sure the change stuck. You can tell if the WiFi setup worked by typing ip address to confirm that you have a proper IP, and you can confirm that SSH is installed by ssh’ing into said IP.

Step 1b: Install a Desktop Environment

If you used Raspbian Lite, you’ll need to install a desktop environment. Everybody has their favorite and I’m not going to take that away from you. I went with XFCE because it has rather beefy window icons and ready support for changes to DPI. Both will be important since I’m watching this on a projector and navigating from my bed, so usability is paramount.

To install, just type sudo apt install xfce4 and let the magic – and about a million dependencies – happen.

I would also recommend sudo apt install network-manager-gnome. This could be unnecessary, but I found it stopped having the WiFi stop working after the first or second reboot. Admonish in the comments if this is unnecessary.

Step 2: Install Kodi and Chromium

Straightforward enough:
sudo apt install kodi chromium-browser seahorse

Kodi has the ability of starting as its own desktop environment. We will eschew this option, since the only advantage of doing so is that you don’t see the Applications bar when you hover over it. Meanwhile, the disadvantage is that you can’t run any other Gnome apps, which is irritating.

Step 3: Log into XFCE, make it the default, and suppress them password dialogs

Reboot (sudo reboot), and when logging in, make sure that XFCE4 is selected as your desktop environment (top-right corner). Logging in is annoying, so we will invoke auto-login.

Similarly, when opening Chromium, entering a password for the default keyring is a pain, so we will suppress it.

Both of these moves are strongly advised against by StackExchange pedants, and that’s fair enough. But this is a media center, not the NSA, and convenience is paramount. Further, we’re going to change the pi’s password so there’s at least one layer of security still present.

  1. Open a terminal window by clicking Applications | System | XTerm. Type passwd and follow the instructions to change the default password from raspberry to something else.
  2. Run sudo raspi-config to configure auto-login: Select Boot Options | Desktop / CLI | Desktop Autologin and then Finish.
  3. Exit the terminal. Open Seahorse password manager by clicking Applications | Accessories | Passwords and Keys
  4. Right-click on Login and choose Change Password. Change the password to <blank>. This will disable prompts to unlock the default keyring.

Step 3b: Optionally, Configure HiDPI Mode

Tiny buttons are hard to hit with a remote control, and tiny text is hard to read when projected across the room. The easiest way to uniformly scale everything on screen is to adjust the DPI settings. This is optional and depends on your use case.

  1. Open Applications | Settings | Appearance and under Fonts change the DPI to 120 – or whatever works for you.
  2. Open Applications | Settings | Window Manager and under Style select Default-hdpi
  3. Reboot to see the full effects.

Step 4: Configure Advanced Launcher

Advanced Launcher is a Kodi addon that creates icons for ordinary apps. We’ll use this, plus a shell script, to launch Chromium from within Kodi

  1. SSH into your pi
  2. Download Advanced Launcher by typing
    wget https://github.com/SpiralCut/plugin.program.advanced.launcher/archive/master.zip
  3. Type nano chromium.sh and enter the following file contents:
    #! /bin/bash
    chromium-browser --user-agent="Mozilla/5.0 (X11; CrOS armv7l 10895.56.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.102 Safari/537.36" --window-size=1920,1080 $1
  4. Return to the pi and open Kodi. Install Advanced Launcher.
  5. Navigate to Add-ons | Add-On Browser (the open box at the top next to the Settings gear)
  6. Choose Install from Zip file and navigate to Home Folder and select master.zip. You’ll likely have to answer a prompt to enable unknown sources.
  7. Advanced Launcher should now be under Program Addons in your Addons folder. Open it and navigate to Default. A dialog to create a new launcher should appear.
    1. Choose Standalone Launcher. Navigate to Home Folder and choose chromium.sh
    2. Leave arguments blank
    3. Keep the title as Chromium – or change it. Free country.
    4. Select Linux as the platform
    5. Skip Thumbnails and Fanart
  8. You now have a launcher that invokes Chromium from within Kodi. To make it more accessible, right-click on the launcher and choose Add to Favourites.

Step 5: Have a lovely beverage

There are additional steps if you want to use Netflix, Amazon Prime, or (heaven help you) Xfinity. But, at this point, you have a nice core setup, so lean back with a lovely beverage and celebrate your accomplishments. The rest can wait for later posts.

Posted by Adam Labay, 0 comments

Ubuntu Cosmic on Pixelbook – Possible!

The folks who use Crouton to run Linux on their Chromebooks tend to be an impatient bunch. Every time a new Ubuntu release comes out, they start peppering @dnscheid with questions about whether it’ll run.
 
As of this writing, Bionic is the most recent supported release.  But Cosmic and Disco both exist as well, and people want to install them. I haven’t made it as far as Disco, but I can answer these two questions:
 
Can Ubuntu 18.10 (Cosmic Cuttlefish) be installed on a Chromebook?
 
Yes.
 
Should you install Ubuntu 18.10 on a Chromebook?
 
So very much no.
 
Can I do it anyway?
 
Hold my beer. 

Step 1: Create a chroot with Xenial

Ubuntu 16.04 Xenial, despite being obsolesced years ago, is the most recent version of Ubuntu that can be installed directly with crouton.  To get to Cosmic, we’ll have to upgrade a few times. This first section is basically an excerpt from the official instructions at https://github.com/dnschneid/crouton

  1. If you haven’t already, download crouton from https://goo.gl/fd3zc
  2. Press ctrl-alt-t to open a crosh shell
  3. Make the installer by typing sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton
  4. Install by typing sudo crouton -t xfce -r xenial -n cosmic
  5. Follow the prompts

Congratulations! You now have Xenial installed. Enter by typing sudo startxfce4 -n cosmic

Step 2: Upgrade to Bionic

Now that you have a functioning chroot, it’s time to upgrade to Bionic – the most recent version of Ubuntu which is still fully functional on a Chromebook.

  1. Enter your choot by typing sudo startxfce4 -n cosmic
  2. Enter a terminal by typing ctrl-alt-t
  3. Install Release Upgrader by typing sudo apt install ubuntu-release-upgrader-core
  4. Initiate the upgrade with the following commands:
    sudo apt update
    sudo apt upgrade
    sudo apt dist-upgrade
    sudo do-release-upgrade
  5. Follow the various prompts
  6. Log out, restart your Chromebook, and enter your chroot to make sure everything worked.

If all went well, you have yourself a fancy new Bionic installation.

Step 3: Replace a bunch of drivers

If you try to reproduce the above steps to install Cosmic, you will discover that you can never get a clean apt upgrade. Instead, there’s a set of 5 packages that keep being held back:

The following packages have been kept back:
xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-intel
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

If you try to get rid of them, you’ll end up cutting off your display, which is sadness. Instead, we need to replace them with different versions, and then revert to these versions post-upgrade.

  1. Remove the troublesome drivers with
    sudo apt remove xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-intel
  2. Install the friendly drivers with
    sudo apt install xserver-xorg-core-hwe-18.04 xserver-xorg-input-evdev-hwe-18.04 xserver-xorg-input-wacom-hwe-18.04 xserver-xorg-video-intel-hwe-18.04
  3. Type sudo nano /etc/update-manager/release-upgrades and change prompt=lts to prompt=normal
  4. Execute the upgrade with
    sudo apt update
    sudo apt autoremove
    sudo apt dist-upgrade
    sudo do-release-upgrade
  5. Do not reboot after the upgrade! You will lose your video.
  6. Reverse steps 1-2:
    sudo apt remove xserver-xorg-core-hwe-18.04 xserver-xorg-input-evdev-hwe-18.04 xserver-xorg-input-wacom-hwe-18.04 xserver-xorg-video-intel-hwe-18.04
    sudo apt install xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-intel
  7. Put back the packages that were autoremove’d earlier:
    sudo apt install libcurl3 libegl1-mesa libglu1-mesa libgtop2-common libnih-dbus1 x11-apps x11-session-utils xfonts-base xfonts-encodings xfonts-scalable xfonts-utils xinit xinput xserver-common

Now you can exit, reboot, and log back in.

Congratulations! Also, your system is now unusably slow.

Good news: you upgraded to Cosmic. Good job, give yourself a hug.

Bad news: It’s gonna be slow. Mad slow. Unusably slow.

But it was a fun academic exercise, wasn’t it? Remember, we don’t upgrade software to use it, we upgrade because it’s there.

Posted by Adam Labay, 0 comments