summaryrefslogtreecommitdiff
path: root/posts/librem5:crimson-daily-driver.md
blob: 2de3cba70ac2139cb8dacd852700f103fe989693 (plain)
    1 Librem5: Crimson Daily Driver
    2 =============================
    3 
    4 If you have a Librem 5 phone and are like me, you are eagerly anticipating the
    5 release of Crimson, because you're stuck on Byzantium which has a super old
    6 version of just about every package, but most notably, phosh and chatty.
    7 
    8 A few weeks ago, I finally decided to try Crimson as a daily driver, and that
    9 caused me some great headache a couple of times. I am still using it as a daily
   10 driver however, but there are still some pretty sizeable issues which I have
   11 accepted for the tie being. The issues:
   12 
   13 The issues
   14 ----------
   15 
   16 ### No camera support yet
   17 
   18 Pretty self explanatory here. I imagine this has something to do with the
   19 libcamera api that is being worked on.
   20 
   21 ### No SD card support yet
   22 
   23 ...so if you use your SD card for your home directory, you'll have to rsync to
   24 internal storage and use that. In my case, I have too much on my card, so I had
   25 to be selective about what I put on internal storage.
   26 
   27 ### You can have bluetooth audio, or phone call audio, but not both
   28 
   29 Essentially, the current config for _pulseaudio_ doesn't work with bluetooth,
   30 but audio generally works fine everywhere else. If you try switching to
   31 _pipewire_, bluetooth audio works mostly well (switching audio outputs has to
   32 be done manually from the settings), but you won't have any audio, microphone
   33 or earpiece, on phone calls. This is because of [a
   34 bug](https://gitlab.com/mobian1/callaudiod/-/issues/35) in _callaudiod_. This
   35 issue is fixed in version `1.1.10`, but Crimson currently releases with
   36 `0.1.9`, so pipewire support is broken as of 2024.10.22.
   37 
   38 
   39 ### Installing upgrades is too perilous
   40 
   41 ![Monty Python No, it's too perilous](/files/monty-python-peril.jpg)
   42 
   43 This actually isn't strictly true for me anymore. You just have to be diligent
   44 when installing updates. Currently, the package `libgl1-mesa-dri` wants to
   45 upgrade `24.2.4-1`, which breaks `phosh`, causing a crash loop. The only way to
   46 fix it is to plug in a keyboard, `ctrl + alt + f2`, then `sudo apt install -y
   47 libgl1-mesa-dri=22.3.6-1+deb12u1` to downgrade to `22.3.6-1`. Of course, while
   48 you're doing this, phosh is continuing to launch and crash every 5 seconds, so
   49 you have to keep doing the `ctrl + alt + f2` sequence as systemd takes you back
   50 to `tty1`. `<sarcasm>Isn't systemd great?</sarcasm>`
   51 
   52 To avoid the above shenanigans, every time you run `sudo apt upgrade`, _be
   53 absolutely sure_ to also run `sudo apt install
   54 libgl1-mesa-dri=22.3.6-1+deb12u1` before you reboot the phone, or you'll end up
   55 in a crash loop of phosh.
   56 
   57 
   58 Updates
   59 -------
   60 
   61 ### Update 2024.10.26
   62 
   63 In rather frustrating timing, an important phone call came in today while I
   64 wasn't home and the phone completely crashed and boot looped.  When I got home
   65 and could troubleshoot, I discovered an update of libseat1 to 0.9.0 had broken
   66 the phone, and it needs to stay at version `libseat1=0.7.0-6` for now.
   67 
   68 Here's an all-in-one command to keep your crimson phone working.
   69 
   70 ```
   71 sudo apt install libgl1-mesa-dri=22.3.6-1+deb12u1 libseat1=0.7.0-6
   72 ```
   73 
   74 And a couple of pieces of related advice:
   75 1. Only install crimson updates when you are at home with a keyboard handy to recover with
   76 2. Always reboot your phone after installing said updates so you don't discover
   77    your phone is broken when you're away from said keyboard.
   78 
   79 I'll update this post with other caveats as they come to me. If you're fine
   80 with the above issues though, 
   81 
   82 
   83 ### Update 2024.11.21
   84 
   85 I removed the `alsa-ucm-conf` piece of the below script, as that version of the
   86 package is now available in the crimson repos. Woo!
   87 
   88 Additionally, still no SDcard support and the libseat and libgl1-mesa-dri
   89 downgrades is still required, despite _many_ updates having come in from
   90 upstream. It's moving right along! At this point, we're seeing somewhere
   91 between 2 and 30 package updates per day.
   92 
   93 
   94 ### Update 2025.01.04
   95 
   96 Well, it's been a little over a month, I figure it's time for another update.
   97 This is gonna be a big one because, get this, I ran `sudo apt full-upgrade`.
   98 Brace yourselves. :)
   99 
  100 A few weeks ago, I saw a huge list of package upgrades come in through the
  101 `landing` and `crimson` repos this past month - over 500. I assume this is
  102 related to what Purism wrote in the [October 2024 Crimson Development
  103 report](https://puri.sm/posts/pureos-crimson-development-report-october-2024/)
  104 about package synchronization. Almost all of the package upgrades were blocked
  105 for various reasons, so I _very_ hesitantly tried upgrading with `sudo apt
  106 full-upgrade` (the replacement for the old school deprecated `sudo apt
  107 dist-upgrade`). I got most of the package upgrades, and I now routinely have
  108 blocked upgrades for about 40 packages, all of which I want: upgrades to phosh,
  109 phoc, gnome-\*, etc.
  110 
  111 Now, _what did that `full-upgrade` do exactly?_
  112 
  113 It broke mostly everything. I now have the latest mmsd-tng, which is nice,
  114 except [a bug was introduced](https://gitlab.com/kop316/mmsd/-/issues/101) in
  115 the most recent 2.6.2 release which breaks MMS attachment receiving (group
  116 texts still work, just not images).
  117 
  118 It also seems to have broken the audio stack. To be clear, it all still works,
  119 it's just fully manual to switch between outputs. I tried the full upgrade,
  120 hoping the updates to callaudiod and pipewire would allow me to switch over to
  121 pipewire fully, but pulseaudio barely works and I now have to manually switch
  122 between headset, speaker, and headphones audio whenever I want to use the
  123 phone, have an alarm clock in the morning, or listen to music, respectively. I
  124 haven't even tried bluetooth audio yet.
  125 
  126 Some apps now scale much worse than before the full upgrade. I suspect that's
  127 because we've gone from the purism modified versions of things like
  128 gnome-calendar to the official gnome-calendar, which is waiting on the
  129 libadwaita and gtk4 changes to bake in UI mobile scaling support. I could be
  130 wrong though, as I haven't taken the time to investigate if this is actually
  131 the case or not.
  132 
  133 The full-upgrade also removed some packages, like `phosh-mobile-settings`, so
  134 you'll want to manually reinstall that each time if you want to be able to use
  135 the calendar. The upgrades also (like above) pulls in non-purism-modified app
  136 updates, like with Documents Viewer. It is more up-to-date, but no longer has
  137 the purism mobile modifications, so it shows up as a non-mobile form-factor
  138 app, so you have to press "show all apps" on the app tray to see it, and it
  139 lacks mobile UI scaling. There are also some odd pinch-to-zoom glitches that
  140 cause it to jitter all over and highlight random text. I <del>assume</del> hope
  141 further libadwaita and GTK 4 updates will resolve many of these issues.
  142 
  143 **Battery life** is marginally better from after the initial upgrade, and still
  144 is worse than before. I get about 7-8 hours out of the phone right now before
  145 it dies. Turning off the wifi card seems to add a few hours to that.
  146 
  147 Regardless though, phone functionality still works. Strictly SMS text messaging
  148 still works, along with matrix (though that has been a little anemic since
  149 byzantium anyways).
  150 
  151 I might give a try later today if I have time, to remove the landing repo and
  152 see what another full-upgrade does, since I expect that to do a number of
  153 downgrades, since landing is the development repo and should be notably further
  154 ahead than crimson. I will of course post back on how that goes if I get to it,
  155 but it's Saturday and I've got errands to run, coffee to brew, and birds to
  156 watch!
  157 
  158 
  159 I know that list is a lot of negatives. To be clear, I'm not saying devs
  160 working on this are bad or anything remotely like that. I'm just providing
  161 status updates. Crimson isn't even recommended for alpha testing right now, so
  162 let's give Purism time and patience and politeness to work on this and keep in
  163 mind, this is the first real linux phone we've ever seen. The first Apple
  164 iPhone and Google G1 also had terrible battery life and stability issues for a
  165 long time. We've just gotta catch up with an industry that has an 18 year head
  166 start and billions of dollars of funding. Let's be sure in our discourse that
  167 we are patient and respectful, and moreover, helpful! Keeping perspective is
  168 essential.
  169 
  170 Enjoy the weekend folks!
  171 
  172 
  173 Hacks to get running
  174 --------------------
  175 
  176 Because I want to easily rebuild this phone if I need to, without following a
  177 long checklist of shell commands, I put all this in a clean shell script which
  178 handles everything for me/you.
  179 
  180 I do recommend putting this in its own directory, as it has to download and
  181 extract some of its own artifacts (alsa-ucm-conf) to complete.
  182 
  183 In short, the following script:
  184 
  185 * Overrides the system alsa-ucm-conf ucm2 directories with those from upstream
  186   latest.
  187 
  188 * Adds a few additional apt repos to bring in "unstable" packages so the phone
  189   can actually be updated.
  190 
  191 
  192 **~/crimson/fixup.sh**
  193 
  194 ```
  195 #!/usr/bin/env bash
  196 
  197 set -euo pipefail
  198 export IFS=$'\n\t'
  199 
  200 # By default Crimson comes with the crimson repos, which is very broken last I
  201 # checked.
  202 # This adds landing, crimson-security, crimson-updates, and
  203 # crimson-updates-proposed repos. These might make things unstable in the long
  204 # run, but for now this is required to get things up and running.
  205 #
  206 apt_set_repos() {
  207   sudo tee /etc/apt/sources.list <<EOF
  208 deb http://repo.pureos.net/pureos landing main
  209 deb http://repo.pureos.net/pureos crimson main
  210 deb http://repo.pureos.net/pureos crimson-security main
  211 deb http://repo.pureos.net/pureos crimson-updates main
  212 deb http://repo.pureos.net/pureos crimson-updates-proposed main
  213 EOF
  214 }
  215 
  216 apt_set_repos
  217 ```
  218 
  219 Run that and most of the issues should be resolved.

Generated by cgit