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 _Update 2024.10.26_ In rather frustrating timing, an important phone call came
58 in today while I wasn't home and the phone completely crashed and boot looped.
59 When I got home and could troubleshoot, I discovered an update of libseat1 to
60 0.9.0 had broken the phone, and it needs to stay at version `libseat1=0.7.0-6`
61 for now.
62
63 Here's an all-in-one command to keep your crimson phone working.
64
65 ```
66 sudo apt install libgl1-mesa-dri=22.3.6-1+deb12u1 libseat1=0.7.0-6
67 ```
68
69 And a couple of pieces of related advice:
70 1. Only install crimson updates when you are at home with a keyboard handy to recover with
71 2. Always reboot your phone after installing said updates so you don't discover
72 your phone is broken when you're away from said keyboard.
73
74 I'll update this post with other caveats as they come to me. If you're fine
75 with the above issues though,
76
77
78 Hacks to get running
79 --------------------
80
81 Because I want to easily rebuild this phone if I need to, without following a
82 long checklist of shell commands, I put all this in a clean shell script which
83 handles everything for me/you.
84
85 I do recommend putting this in its own directory, as it has to download and
86 extract some of its own artifacts (alsa-ucm-conf) to complete.
87
88 In short, the following script:
89
90 * Overrides the system alsa-ucm-conf ucm2 directories with those from upstream
91 latest.
92
93 * Adds a few additional apt repos to bring in "unstable" packages so the phone
94 can actually be updated.
95
96
97 **~/crimson/fixup.sh**
98
99 ```
100 #!/usr/bin/env bash
101
102 set -euo pipefail
103 export IFS=$'\n\t'
104
105 # Deploy updated alsa-ucm-conf profiles.
106 #
107 # Solution discovered by [Kyle Evans]
108 # https://source.puri.sm/Librem5/OS-issues/-/issues/346#note_264442)
109 #
110 fix_alsa_ucm() {
111 local name='alsa-ucm-conf'
112 local version='1.2.12'
113 local src="https://github.com/alsa-project/${name}/archive/refs/tags/v${version}.tar.gz"
114
115 if [ ! -f v${version}.tar.gz ]; then
116 printf 'Downloading %s version %s\n' "${name}" "${version}"
117 curl -o ".v${version}.tar.gz.tmp" -L -# "${src}"
118 mv ".v${version}.tar.gz.tmp" "v${version}.tar.gz"
119 fi
120 tar -xf "v${version}.tar.gz"
121
122 printf 'Deploying updated ucm2 profiles\n'
123 if [ -d /usr/share/alsa/ucm2 ]; then
124 sudo mv -v /usr/share/alsa/ucm2{,.$(date +%F)}
125 fi
126 sudo cp -r "${name}-${version}/ucm2" "/usr/share/alsa/ucm2"
127 }
128
129 # By default Crimson comes with the crimson repos, which is very broken last I
130 # checked.
131 # This adds landing, crimson-security, crimson-updates, and
132 # crimson-updates-proposed repos. These might make things unstable in the long
133 # run, but for now this is required to get things up and running.
134 #
135 apt_set_repos() {
136 sudo tee /etc/apt/sources.list <<EOF
137 deb http://repo.pureos.net/pureos landing main
138 deb http://repo.pureos.net/pureos crimson main
139 deb http://repo.pureos.net/pureos crimson-security main
140 deb http://repo.pureos.net/pureos crimson-updates main
141 deb http://repo.pureos.net/pureos crimson-updates-proposed main
142 EOF
143 }
144
145 fix_alsa_ucm
146 apt_set_repos
147 ```
148
149 Run that and most of the issues should be resolved.
|