summaryrefslogtreecommitdiffstats
path: root/36c3/Replicant_sustainability/Replicant_sustainability.tex
blob: 4c44c2a4bf1bf29141ada959bc99e2a6abb58a30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
\documentclass{beamer}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{xtab}
\usepackage{pdfpages}

%% Based on:
%% https://tex.stackexchange.com/questions/136900/insert-a-full-page-image
\newcommand{\pictureframe}[1] {
  {
    \begin{frame}
      \noindent
      \resizebox{\textwidth}{\textheight}
                {\includegraphics{#1}}
                \hspace*{-\textwidth}
    \end{frame}
  }
}

\newcommand{\devicespictureframe}[3] {
  {
    \begin{frame}
      \center{#1}
             {\includegraphics[scale=0.5]{../../external_resources/replicant_website/images/supported-devices/#2.png}}
             {\includegraphics[scale=0.5]{../../external_resources/replicant_website/images/supported-devices/#3.png}}
             \hspace*{-\textwidth}
    \end{frame}
  }
}

\newcommand{\shrpictureframe}[2] {
  {
    \begin{frame}
      \noindent
          {\includegraphics[scale=0.25]{#1}}
          {\includegraphics[scale=0.25]{#2}}
    \end{frame}
  }
}

\newcommand{\devicepicture}[2] {
  {\includegraphics[scale=#1]{../../external_resources/replicant_website/images/supported-devices/#2.png}}
}

\usetheme{Singapore}

\title{Extending the lifetime of smartphones with Replicant, a fully free Android distribution}
\author{Denis 'GNUtoo' Carikli and David 'dllud' Ludovino}
\date{\today}

\begin{document}

\maketitle

%% \begin{frame}
%%   \begin{itemize}
%%   \item Context
%%   \end{itemize}
%% \end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
  \center{Replicant:}
  \begin{itemize}
  \item Fully free Android distribution approved by the FSF
  \item But the hardware it runs on is not...
  \item More details on hardware related freedom issues later %% TODO
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Quick Facts}
  \begin{itemize}
  \item Website: replicant.us
  \item Exists since September 2009
  \item Currently based on LineageOS
  \item Android versions:
    \begin{itemize}
    \item Replicant 6: Android 6, last security update: October 2017\cite{last-android-6-update}
    \item Replicant 9: Android 9, work in progress\cite{porting-to-android-9}
    \end{itemize}
  \item Supports $\sim$ 10 devices (smartphones and tablets)
  \item $\sim$ 2 full time equivalent contributors and a big community
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Minimum feature set required to support a device:}
  \begin{itemize}
  \item Display working and graphics fast enough
  \item sound working
  \item Be able to make calls
  \item etc
  \item GPS, Camera, and other non crucial hardware may not work, or work in later releases
  \end{itemize}
\end{frame}

%% \begin{frame}
%%   \center{A very short introduction on hardware}
%%   \begin{itemize}
%%   \item System on a chip
%%   \item Smartphones and the modem
%%   \end{itemize}
%% \end{frame}

\pictureframe{output/i9300_hardware.png}


\begin{frame}
  \center{Why Android?}
  \begin{itemize}
  \item Advantages:
    \begin{itemize}
    \item GUI and applications adapted to big fingers
    \item $\rightarrow$ run on devices that:
      \begin{itemize}
      \item lack keyboard
      \item have capacitve touchscreen and no stylus
      \item Have very small displays with very high number of pixel
      \end{itemize}
    \end{itemize}
  \item Issues
    \begin{itemize}
    \item Part of the GNU/Linux software architecture is light years away: Package management and build system, Graphics, audio, etc
    \item Huge unknown code from google
    \item Meant to run proprietary software
    \item Not meant to empower users
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Android: From time to market driven architecture to substainability}
  \begin{itemize}
  \item SOCs, WiFi chips, smartphones and tablets
    \begin{itemize}
    \item Write the code that work as fast as possible
    \item Support as many hardware features as possible
    \item $\rightarrow$ Varying code quality
    \item $\rightarrow$ Example: One driver rewritten 3 times %% TODO: reference
    \end{itemize}
  \item Breaking Kernel API and ABI
    \begin{itemize}
    \item It can take time (years) to bring in a new framework in Linux
    \item Example of API breakage: HTC dream audio driver
    \item Solution: Apps$\leftarrow$ $\rightarrow$ Android framework $\leftarrow$ $\rightarrow$ HAL $\leftarrow$ $\rightarrow$  Kernel
    \item Getting better in Android: Trebble and Generic Kernel images
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Ugly code is good (for freedom):}
  %% TODO: replace with [blobby from OpenBSD] VS [dirty tux] -> [freedo]
  \begin{itemize}
  \item Having the source code under free software licenses, even if the code quality is bad is crucial for freedom:
    \begin{itemize}
    \item Hardware bringup is often made that way anyway
    \item Things can be improved later:
      always be cleaned up later or if the code quality is too bad, rewritten from scratch
    \item Having the source code under a free software license is very important
    \item Worst case: use the source code as documentation or reverse engineer it (add prints)
    \end{itemize}
  \item $\rightarrow$ We depend on that source code
  \end{itemize}
\end{frame}

%% \begin{frame}
%%   \center{What affect a device lifetime in Replicant?}
%%   \begin{itemize}
%%   \item Upstream support $\leftarrow$ We're working on it
%%   \item Android RAM consumption VS device RAM size $\leftarrow$ Very little leverage from Replicant
%%   \item Removable batteries and developers being able to get the device $\leftarrow$ We don't support devices without removable batteries
%%   \item Freedom issues (Chinese whispers) $\leftarrow$ Conflicting interests
%%   \end{itemize}
%% \end{frame}

\begin{frame}[plain,allowframebreaks]{title}
  \begin{xtabular}{ll}
    \hline
    Device dropping cause & Replicant leverage \\
    \hline
    Upstream support & We're working to improve it \\
    \hline
    Android RAM consumption & negligeable \\
    %% Most device we want to support have similar-ish RAM size
    %% Cannot increase much the device lifetime by choosing devices with bigger RAM size
    %% => We have no impact on it and have to endure it
    \hline
    Lack of removable batteries & don't support devices with non-replacable batteries \\
    \hline
    Freedom issues & Conflicting interests \\
    %% Chinese whispers => Better keeping it simple
    %% We drop the least free devices
    %% Conflicting interest
    \hline
  \end{xtabular}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\devicespictureframe{Replicant phase 1: Quick and dirty hacks}{dream_sapphire}{passion}


\begin{frame}
  %%  \center{Replicant phase 1: Quick and dirty hacks}
  \devicepicture{0.5}{dream_sapphire}
  \hspace*{-\textwidth}
\end{frame}

{
  %% TODO:
  %% - Split the images and the text
  %% - HTC Dream: Make an image with the slider open
  %% - Add both the HTC Dream and passion
  \usebackgroundtemplate{
    \includegraphics[scale=0.5]{../../external_resources/replicant_website/images/supported-devices/dream_sapphire.png}
    \includegraphics[scale=0.5]{../../external_resources/replicant_website/images/supported-devices/passion.png}
  }

  \begin{frame}
    \setbeamercolor{block body}{fg=red}
    \begin{block}
      \center Replicant phase 1: Quick and dirty hacks
      \begin{itemize}
      \item Context: [Replicant 1.5 $\rightarrow$ Replicant 2.2]
      \item Qualcomm:
        \begin{itemize}
        \item MSM7K: The modem controlled:
          \begin{itemize}
          \item The boot, RAM and storage of the device
          \item The audio (and most probably the microphone)
          \end{itemize}
        \item QSD8K: issues:
          \begin{itemize}
          \item Nexus one required nonfree audio firmware for having working calls
          \item The audio (and most probably the microphone)
          \item No strong guarantee about the modem isolation
          \item Too much nonfreee libs
          \item Mainline status
          \item Too much proprietary libs nowadays
          \end{itemize}
        \item We leanred about all that while working on Replicant.
        \end{itemize}
      \end{itemize}
    \end{block}
  \end{frame}
}

%% TODO: Backup slide with list of proprietary libs of a modern qualcomm SOC
\begin{frame}
  \center{Code substainability}
  \begin{itemize}
  \item Required very little maintenance and time (quick and dirty hacks)
  \item Porting to a new Android version:
    \begin{itemize}
    \item 3D acceleration:
      \begin{itemize}
      \item No free driver at the time
      \item We needed to to make graphics fast without 3D acceleration
      \item Lack of 3D acceleration gets less and less supported by Android source code over time
      \item Example: Nexus One
      \end{itemize}
    \item Linux code not upstream $\rightarrow$ Total dependency on Android upstream
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Devices substainability}
  \begin{itemize}
  \item Removable batteries
  \item Little RAM
  \item Nightmare-like freedom issues:
    \begin{itemize}
    \item $\rightarrow$ Very strong incentive to discontinue support for them
    \item $\rightarrow$ negligeable freedom gained by installing Replicant
    \item $\rightarrow$ Replicant was still useful as support when better devices were added later
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Replicant phase 2: Replicant 2.3 $\rightarrow$ Replicant 4.0}
  \begin{itemize}
  \item More freedom but required more work
    \begin{itemize}
    \item Required to continue reverse engineering the modem protocol (easy but long)
    \item Nonfree libraries to replace varies across devices. Examples: Camera, audio, etc
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Devices substainability and freedom blockers}
  \begin{itemize}
  \item Nonfree and signed bootloaders that are very hard or impossible to replace
  \item Devices without modem isolation guarantees %% Have been dropped later
  \item WiFi, Bluetooth, GPS
  \item Enough RAM (1GB or more) on all the supported devices %% TODO: check with tablets
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Code substainability}
  \begin{itemize}
  \item Porting to a new Android version can take quite some time:
    \begin{itemize}
    \item Still need to make it fast without 3D acceleration
    \item Still have Total dependency on Android upstream (Linux code not upstream)
    \end{itemize}
  \end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
  \center{Replicant phase 3: GNU/Linux devices on Replicant 4.2}
  \begin{itemize}
  \item The GTA04 from Golden Delicious has a free software bootloader
  \item The Optimus black (p970) from LG has a bootloader that is not signed
  \end{itemize}
\end{frame}

\begin{frame}
  \center{GTA04}
  \begin{itemize}
  \item Some limited Replicant 4.2 support (based on Android 4.2)
  \item Got suspend issues with Replicant 6 (kernel)
  \item Too much work
  \item unfinished
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Optimus black (p970)}
  \begin{itemize}
  \item Required a lot of work by Paul Kocialkowski\cite{freeing-a-phone-from-the-ground-up}
  \item Bootloader: The code is now upstream in u-boot
  \item Linux: Very minimal support upstream
    \begin{itemize}
    \item working: microSD, USB
    \item lacking: No display driver, sound etc
    \end{itemize}
  \item Also unfinished
  \end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
  \center{Replicant phase 4: Back to supported devices}
  \begin{itemize}
  \item Android 6 outdated
  \item Samsung devices still supported
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Samsung devices that are or can be supported by Replicant 6.0}
  \begin{itemize}
  \item Exynos or OMAP System on a chip
  \item The modems in it have been customized by samsung use the same vendor-specific protocol
  \item Very large number of unit sold:
    \begin{itemize}
    \item 70 million units for the Galaxy SIII
    \item Easy to find second hand
    \end{itemize}
  \item Isolated modem for currently supported devices
  \item Removable battery for smartphones and somewhat removable for tablets
  \item Nonfree and signed bootloader
  \item WiFi doesn't work out of the box
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Android requirements}
  \begin{itemize}
  \item RAM $\leftarrow$ $\rightarrow$ Display
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Supported Tablets (Replicant 6.0)}
  \begin{itemize}
  \item All have internal batteries (still possible to remove them)
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Images of removable batteries}
\end{frame}

\begin{frame}[plain,allowframebreaks]{title}
  \begin{xtabular}{cccccc}
    \hline
    Device & Unit solds & Launch date & RAM & GPU driver\\
    \hline
    Galaxy S II (I1300) & 40 Millions & 2011 & 1GB & Lima \\
    \hline
    Galaxy S III (I9300) & 70 Millions & 2012 & 1GB & Lima \\
    \hline
    Galaxy Note (N7000)  & 10 Millions & October 2011 & 1GB & Lima \\
    \hline
    Galaxy Note II (N7100)  & 30 Millions & October 2012 & 2GB & Lima \\
    \hline
    Galaxy Nexus (I9250) & ? & October 2011 & 1GB & PowerVR \\
    \hline
  \end{xtabular}
\end{frame}

\begin{frame}
  \center{Supported Tablets (Replicant 6.0)}
  \begin{itemize}
  \item All have removable batteries
  \end{itemize}
\end{frame}

\begin{frame}[plain,allowframebreaks]{title}
  \begin{xtabular}{cccccc}
    \hline
    Device & Unit solds & Launch date & RAM & GPU driver\\
    \hline
    Galaxy Tab 2 7.0 (P3100) & ? & ? & ? & PowerVR \\
    \hline
    Galaxy Tab 2 7.0 WiFi (P3110) & ? & ? & ? & PowerVR \\
    \hline
    Galaxy Tab 2 10.1 (P5100) & ? & ? & ? & PowerVR \\
    \hline
    Galaxy Tab 2 10.1 WiFi (P5110) & ? & ? & ? & PowerVR \\
    \hline
    Galaxy Note 8.0 (N5100) & ? & ? & ? & ? \\
    \hline
    Galaxy Note 8.0 Wi-Fi (N5110) & ? & ? & ? & ? \\
    \hline
  \end{xtabular}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
  \center{Replicant phase 5: Making Replicant substainable: second attempt}
\end{frame}

\begin{frame}
  \center{Making Replicant substainable}
  \begin{itemize}
  \item Got some funding from Handshake and NlNet
  \item $\rightarrow$ Spend the money on making Replicant substainable
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Not out yet:}
  \begin{itemize}
  \item Librem5 from Puri.sm
  \item Pine Phone from Pine64
  \item NC-1 from Necunos
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Other devices}
  \begin{itemize}
  \item GTA04: Not produced anymore
  \item Neo900: Would have needed more funding to start the production
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Let's continue supporting the devices we already support}
  \begin{itemize}
  \item Galaxy SIII (I9300), Galaxy Note II(N7100)
    \begin{itemize}
    \item Good but uncomplete upstream support $\rightarrow$ Let's finish it
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Replicant 9}
  \begin{itemize}
  \item Work in progress
  \item Using a kernel closely based on upstream (0 Android patches in it so far)
  \item Modem drivers upstreaming not started yet
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Let's keep 2D acceleration working}
  \begin{itemize}
  \item Let's be caucious and future proof:
    \begin{itemize}
    \item No free drivers for PowerVR GPUs
    \item Free drivers might go away as hardware change
    \item $\rightarrow$ Lima doesn't support
    \end{itemize}
  \item It payed off:
    \begin{itemize}
    \item Good enough speed with 2D acceleration
    \item Mali 400 $\rightarrow$ Lima is not ready yet but accept bugreports
    \item Lima and even Panfrost don't support vulkan yet
    \item Vulkan will be required for new devices shipping with Android 10, unless the device has a low amount of memory
    \item $\rightarrow$ Vulkan will be more and more required
    \end{itemize}
  \end{itemize}
\end{frame}

\pictureframe{output/virtuous_circle.png}

\begin{frame}
  \center{Effects of using Linux upstream}
  \begin{itemize}
  \item Require more time
  \item $\rightarrow$ We cannot support devices with non-replacable batteries
  \item Uses upstream kernel
  \item $\rightarrow$ Not tied to hardware specific vendor libraries
  \item $\rightarrow$ We can share the work with GNU/Linux
  \item $\rightarrow$ We will be able to more easily add support for devices running GNU/Linux    
  \end{itemize}
\end{frame}

\begin{frame}
  \center{We also want to use GNU/Linux userspace hardware support projects}
  \begin{itemize}
  \item Easier to add support for GNU/Linux devices in Replicant
  \item Or to add support for Replicant supported devices in GNU/Linux
  \item Share the maintenance with communities more interested in freedom
  \item GNU/Linux tools and distributions can be used for testing too
  \item People buying GNU/Linux smartphones could also run Android if GNU/Linux is not ready yet for them
  \item People having Replicant compatibles smartphones could also run GNU/Linux on it if it's ready for them
  \end{itemize}
\end{frame}

\begin{frame}
  \center{Fully GNU/Linux free distributions for ARM}
  \begin{itemize}
  \item Guix: armv7h, arm64
  \item Parabola: armv7h, based on Archlinux
  \item PureOS: arm64, based on Debian
  \end{itemize}
\end{frame}

\begin{frame}
  \center{How to not drop devices:}
  \begin{itemize}
  \item Get to the same freedom than future devices:
    \begin{itemize}
    \item Free software bootloader
    \item Free WiFi and Bluetooth firmwares
    \item GPS (library + firmware)
    \end{itemize}
  \item Enough RAM or obtimisations
  \item Hardware documentation and repair guides under a free license
  \end{itemize}
\end{frame}

\begin{frame}
  Licenses:
  \begin{itemize}
  \item The SIM card and BTS pictures comes from \url{https://en.wikipedia.org/wiki/File:Gsm_network.png} and are under the GFDL 1.2 or the Creative commons Attributions-Share ALike 3.0 Unported.
    \begin{itemize}
    \item GSM: \url{http://wiki.openmoko.org/wiki/QtMoko}
    \item SHR pictures: \url{http://wiki.openmoko.org/wiki/SHR_User_Manual}
    \end{itemize}
  \item HTC Dream: \url{https://commons.wikimedia.org/wiki/File:HTC_Dream_opened.jpg}
    Creative Commons Attribution 3.0 Unported
  \item \url{https://creativecommons.org/licenses/by-sa/4.0/} for the rest.
  \end{itemize}
\end{frame}

\begin{thebibliography}{99}
\bibitem{freeing-a-phone-from-the-ground-up}
  \url{https://code.paulk.fr/article20/a-hacker-s-journey-freeing-a-phone-from-the-ground-up-first-part}
  \url{https://code.paulk.fr/article21/a-hacker-s-journey-freeing-a-phone-from-the-ground-up-second-part}
  \url{https://code.paulk.fr/article22/a-hacker-s-journey-freeing-a-phone-from-the-ground-up-third-part}
  \url{https://code.paulk.fr/article23/a-hacker-s-journey-freeing-a-phone-from-the-ground-up-fourth-part}
\bibitem{last-android-6-update}
  \url{https://en.wikipedia.org/wiki/Android Marshmallow}
\bibitem{porting-to-android-9}
  \url{https://redmine.replicant.us/projects/replicant/wiki/PortingToAndroid9}
\end{thebibliography}
\end{document}