New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598480 link

Starred by 5 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Replace ply-image with frecon

Project Member Reported by rspangler@chromium.org, Mar 28 2016

Issue description

We'd like to get rid of the frame buffer, but ply-image uses it.  So, replace all remaining use of ply-image with frecon, then remove ply-image from chrome OS entirely.

Note that ply-image is used in initramfs, which is very space-limited.  This may require some refactoring of frecon (and/or creation of a frecon-tiny variant).  

It might also be nice if frecon could do screen scaling, so that recovery images don't need to carry around extra bitmaps.

 

Comment 1 by shchen@chromium.org, Mar 29 2016

Ongoing discussion on this CL:  https://chromium-review.googlesource.com/#/c/335463/.

Comment 2 by shchen@chromium.org, Mar 29 2016

Also, emailed Hung-Te, who originally attempted to get frecon into initramfs.  Here's his response:

- Currently frecon needs dbus, which we don't have in initramfs
 - Need API to open and configure VTs (which frecon supports now, but only via dbus) so we can write text to it
 - Need a more flexible way to dynamically render something on screen without destroying frecon context (just like ply-image) (this is for recovery mode - it tries to render a progress bar during execution)
 - Size and dependency. initramfs size is very limited. Frecon has too much dependency: libdrm, libtsm, libudev, libdbus, libpng12, libpthread that will run out of initramfs space in kernel partition
Cc: hungte@chromium.org

Comment 4 by hungte@chromium.org, Mar 29 2016

It would be really great if there can be a ply-image compatible executable, say freon-image, that will talk to frecon internally and do the right thing so we don't have  to write complicated dbus commands for just displaying an image on screen.

Comment 5 by shchen@chromium.org, Mar 29 2016

I've attached the recovery log.  You should be able to do a search for frecon to see where I've called it.  

RE: Domink's question in https://chromium-review.googlesource.com/#/c/335463/:

Frecon --clear was called once before I tried to display the boot_message.png file.  Does that keep running until I manually kill it?  Can you give me instructions on how to run frecon properly (I can't find much documentation searching on Moma)?  I just assumed that I could call it again and again much like ply-image.
recovery.log
193 KB View Download

Comment 6 by hungte@chromium.org, Mar 29 2016

No it doesn't. Try to find my discussion with dsodman in frecon related issues.

- If you kill frecon, anything on screen is destroyed and becomes black screen.
- You can't run it again and again since next session won't start (or automatically kill previous one).
- Depends on frecon settings, some option may leave it keep running and some may just terminate once the display is finished.

Frecon is totally different from ply-image (for now) - and that's why I added comment #4.


Labels: -Pri-3 Pri-2
Owner: marc...@chromium.org
Status: Assigned (was: Untriaged)
Please find an owner and estimated time to fix for these issues.

Thanks

Comment 8 by dbehr@google.com, Mar 29 2016

ply-image also needs libdrm and libpng12, how else would it talk to display or load png images?

libtsm and udev are necessary, libtsm provides console functionality and udev device discovery

we can work on a version of frecon for initramfs without dbus, it would be separate ebuild then.

Comment 9 by dbehr@google.com, Mar 29 2016

for now the only way to display images while frecon is running is to use dbus interface.

we could consider implementing something like console escape sequences, where one could write to frecon console escape seq with image path and location and frecon display it on screen?

Comment 10 by dbehr@chromium.org, Mar 29 2016

Owner: dbehr@chromium.org
Summary of design discussion with shchen and dbehr:

1. Make a frecon variant which doesn't use dbus, since that's not available in the recovery image and libdbus is huge compared with our size constraints in the initramfs.

2. We need persistent screen where we can overlay images.  So start frecon and keep it running (since when it exits, the screen goes black).  Add console output escape sequence to display an image.  For security, may want to have this capability enabled via a command line option.  (as suggested in comment#9)

3. Add support for simple scaling by an integer multiple (pixel-doubling/tripling).  This removes need for multiple images (keeps initramfs small) and will look good enough on a high-dpi screen.  No need to do fancier (bilinear/bicubic) scaling; code is small enough, but scaling low-stroke-width fonts doesn't look good.

4. If frecon + new *.so files are too big, explore static linking with libs only used by frecon.

5. Thanks, Dominik!
If we're going to support "console output escape sequence to display an image", does that mean it'll be something like

 # somewhere in system init
 terminals=$(frecon --daemon --enable-escape-sequence --create-terminals "1,2,3")

 # echo $terminals should give something like /dev/ttyS2 /dev/ttyS3 /dev/ttyS4 so we know where to access them

 # somewhere when we want to display something to first terminal...
 printf "\027[img:/usr/share/assets/boot_message.png,+100-200\027" >>/dev/ttyS2

Comment 13 by dbehr@chromium.org, Mar 31 2016

something like that, but frecon terms are under /dev/pts/0, 1, 2 etc
display_boot_message creates a link to /dev/pts/1 from /dev/tty1 for some backward compatibility.

Do you need multiple terminals? I'd rather disable terminal switching in this mode so it will not be possible to switch them.

I think we should support +X,+Y for left and top alignment, -X and -Y for right and bottom and "center" for automatic centering of the image. Also additional argument with integer scale?
Possibly extra commands like clear with color and box/rect for simple drawing?
> Do you need multiple terminals? 

 Currently the recovery image supports having debug messages on other terminals (VT2, VT3).
 It would be great if that can be still provided.

> I think we should support +X,+Y for left and top alignment, -X and -Y for right and bottom and "center" for automatic centering of the image
 Hmm, I think we need (1) absolute location like +x, +y, -x, -y (2) offset from center (or if we can get the screen dimension in other approach while the daemon is already running)

> Possibly extra commands like clear with color
I think "what ply-image supports" would be all what we need.

Project Member

Comment 15 by bugdroid1@chromium.org, Apr 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/f50c98fa671058a0bd5c33ad41b4b2de8ddd5155

commit f50c98fa671058a0bd5c33ad41b4b2de8ddd5155
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu Mar 31 21:05:29 2016

frecon: make dbus dependency in frecon optional

This change allows building frecon with dbus calls stubbed out.
So a light-weight version of frecon can be built for use in ramdisk.

BUG= chromium:598480 
TEST=export DBUS=0 emerge-$BOARD frecon, deploy it and verify it doesnt link\
with dbus with ldd /sbin/frecon

Change-Id: I03d46ebd7e1943edcb38ce40dbb406a1845cdf37
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336867
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/f50c98fa671058a0bd5c33ad41b4b2de8ddd5155/dbus.c
[modify] https://crrev.com/f50c98fa671058a0bd5c33ad41b4b2de8ddd5155/dbus.h
[modify] https://crrev.com/f50c98fa671058a0bd5c33ad41b4b2de8ddd5155/Makefile

Project Member

Comment 16 by bugdroid1@chromium.org, Apr 15 2016

Labels: merge-merged-release-R50-7978.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/563793266fc813dc2db3fee28414499bcf58880a

commit 563793266fc813dc2db3fee28414499bcf58880a
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu Mar 31 21:05:29 2016

frecon: make dbus dependency in frecon optional

This change allows building frecon with dbus calls stubbed out.
So a light-weight version of frecon can be built for use in ramdisk.

BUG= chromium:598480 
TEST=export DBUS=0 emerge-$BOARD frecon, deploy it and verify it doesnt link\
with dbus with ldd /sbin/frecon

Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336867
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit f50c98fa671058a0bd5c33ad41b4b2de8ddd5155)

Change-Id: If60cc4e64e97a6949a606ec36c2a8e57f899015b
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338612
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Dominik Behr <dbehr@google.com>

[modify] https://crrev.com/563793266fc813dc2db3fee28414499bcf58880a/dbus.c
[modify] https://crrev.com/563793266fc813dc2db3fee28414499bcf58880a/dbus.h
[modify] https://crrev.com/563793266fc813dc2db3fee28414499bcf58880a/Makefile

Project Member

Comment 17 by bugdroid1@chromium.org, May 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/f6d1779507e32a0928ba7b1e2d1f40447f22a33b

commit f6d1779507e32a0928ba7b1e2d1f40447f22a33b
Author: Dominik Behr <dbehr@chromium.org>
Date: Sat Apr 30 03:31:09 2016

libtsm: add a patch for OSC string callback

For frecon to be able to implement custom escape codes.
This change patches libtsm with functional OSC escape processing which
calls library user provided callback for every encountered OSC escape.
This allows terminals using libtsm to implement OSC escapes.

BUG= chromium:598480 
TEST=none, see frecon change that depends on it

Change-Id: Ia71f31dd69ed89454eb13d37ef4403a746391f1e
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341514
Reviewed-by: Haixia Shi <hshi@chromium.org>

[rename] https://crrev.com/f6d1779507e32a0928ba7b1e2d1f40447f22a33b/sys-apps/libtsm/libtsm-3-r1.ebuild
[add] https://crrev.com/f6d1779507e32a0928ba7b1e2d1f40447f22a33b/sys-apps/libtsm/files/0001-libtsm-add-OSC-string-callback.patch

Project Member

Comment 18 by bugdroid1@chromium.org, May 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/92d9e318350c5a8d493a3b32ef66138367db82e9

commit 92d9e318350c5a8d493a3b32ef66138367db82e9
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu May 05 03:10:48 2016

frecon: add image scaling functionality

All images displayed by frecon can be now scaled by integer factor. This
allows reuse of lower resolution assets on high resolution screen.

Added --scale=N (where N is positive integer) command line option to set
scaling of splash images. 0 is a special value which uses scale=1 for
framebuffers below 1920 pixels wide and scale=2 over 1920. Scale also
affects image offset.

As added bonus the image is now clipped to framebuffer size so trying to
display image which is too big or extending outside buffer does not cause
a crash.

BUG= chromium:598480 
TEST=edit /etc/init/boot-splash.conf and add --scale=4 to frecon command line

Change-Id: I7918d7257cb522bec2fd8f4940e026da11abe9c1
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342773
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/92d9e318350c5a8d493a3b32ef66138367db82e9/splash.c
[modify] https://crrev.com/92d9e318350c5a8d493a3b32ef66138367db82e9/splash.h
[modify] https://crrev.com/92d9e318350c5a8d493a3b32ef66138367db82e9/main.c
[modify] https://crrev.com/92d9e318350c5a8d493a3b32ef66138367db82e9/image.c
[modify] https://crrev.com/92d9e318350c5a8d493a3b32ef66138367db82e9/image.h

Project Member

Comment 19 by bugdroid1@chromium.org, May 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/222936d5eee2971482b68b09b04b781762e865a3

commit 222936d5eee2971482b68b09b04b781762e865a3
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu May 05 20:50:50 2016

frecon: add command line option to disable login on terminals

Ramdisk/recovery would like for frecon to provide extra terminals beside
splash screen to display debugging and diagnostic logs but they should not
allow login prompt for security reasons.

BUG= chromium:598480 
TEST=from shell, stop ui; killall -9 frecon; frecon --enable-vts --no-login;\
and there should be no login prompt on any terminal

Change-Id: I560f3f348f3bddbb9c12cdf27f893535a6d1c104
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342775
Reviewed-by: Haixia Shi <hshi@chromium.org>

[modify] https://crrev.com/222936d5eee2971482b68b09b04b781762e865a3/term.c
[modify] https://crrev.com/222936d5eee2971482b68b09b04b781762e865a3/main.c
[modify] https://crrev.com/222936d5eee2971482b68b09b04b781762e865a3/main.h

Project Member

Comment 20 by bugdroid1@chromium.org, May 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/d253090f71dfb6f7b8f379775d31277b40eec490

commit d253090f71dfb6f7b8f379775d31277b40eec490
Author: Dominik Behr <dbehr@chromium.org>
Date: Thu May 05 21:01:06 2016

frecon: add image/drawing escapes

This change adds OSC escapes image: and box: that allows anyone controlling
the terminal to display PNG images on it or draw single color boxes.

BUG= chromium:598480 
TEST=swith to frecon terminal, and from ssh window run
echo -ne "\033]image:file=/usr/share/chromeos-assets/images_100_percent/boot_splash_frame18.png\033\\" > /dev/pts/1
echo -ne "\033]box:color=0xFFFFFFFF;size=100,100\033\\" > /dev/pts/1
CQ-DEPEND=Ia71f31dd69ed89454eb13d37ef4403a746391f1e

Change-Id: Ie2332e7c96d969ac8b11083f6f393fc88a79ad10
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342774
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d253090f71dfb6f7b8f379775d31277b40eec490/term.c
[modify] https://crrev.com/d253090f71dfb6f7b8f379775d31277b40eec490/main.c
[modify] https://crrev.com/d253090f71dfb6f7b8f379775d31277b40eec490/fb.c
[modify] https://crrev.com/d253090f71dfb6f7b8f379775d31277b40eec490/main.h

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/frecon/+/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d

commit da6df41a4ba404c0ad0afe5d0f46a99e2be6164d
Author: Dominik Behr <dbehr@chromium.org>
Date: Tue Aug 02 19:56:42 2016

frecon: clean up terminal management

Increase number of possible terminals to 12 and make it configurable via
command line option.
Make splash term always term 0 to simplify terminals switching logic.
Fixed wait for child process for vt0.
Save pts file name for each frecon vt to /var/run/frecon/vtX.
Save frecon pid to /var/run/frecon/pid.
Add command line option to pre-create all the terminals so their pts names
can be read in advance.
Fix VT0 child exiting causing frecon to exit main loop.

BUG= chromium:598480 
TEST=boot daisy

Change-Id: I156882c2ecfe5e9c4437b2a187440026f6063813
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/365563
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>

[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/util.h
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/term.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/main.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/input.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/main.h
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/util.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/splash.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/splash.h
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/shl_pty.c
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/README
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/term.h
[modify] https://crrev.com/da6df41a4ba404c0ad0afe5d0f46a99e2be6164d/shl_pty.h

Comment 22 by dbehr@chromium.org, Sep 22 2016

Status: Fixed (was: Assigned)
Labels: VerifyIn-55

Comment 24 by dchan@google.com, Nov 19 2016

Labels: VerifyIn-56

Comment 25 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 26 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 27 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 28 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Project Member

Comment 29 by bugdroid1@chromium.org, Jun 27 2017

Labels: merge-merged-factory-reef-8811.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/assets/+/065cd391f5cd332d46fa87ab08ce4b2cbc55a6e1

commit 065cd391f5cd332d46fa87ab08ce4b2cbc55a6e1
Author: Stéphane Marchesin <marcheu@chromium.org>
Date: Tue Jun 27 06:33:20 2017

assets: display_boot_message: Remove x11 remnants

ply-image has been replaced by frecon, so remove ply-image.

BUG= chromium:655820 ,  chromium:598480 
TEST=trybots

Change-Id: Ib6ac26c8222204eef4bb45a0870945ffccc73eb7
Reviewed-on: https://chromium-review.googlesource.com/443585
Commit-Ready: Drew Davenport <ddavenport@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/549524
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Trybot-Ready: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/065cd391f5cd332d46fa87ab08ce4b2cbc55a6e1/text/display_boot_message

Project Member

Comment 30 by bugdroid1@chromium.org, Jul 5 2017

Labels: merge-merged-factory-gru-9017.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/assets/+/d0b647e93aa1c57afe88f9fc1394c72624ce5ad5

commit d0b647e93aa1c57afe88f9fc1394c72624ce5ad5
Author: Stéphane Marchesin <marcheu@chromium.org>
Date: Wed Jul 05 18:11:30 2017

assets: display_boot_message: Remove x11 remnants

ply-image has been replaced by frecon, so remove ply-image.

BUG= chromium:655820 ,  chromium:598480 
TEST=trybots

Change-Id: Ib6ac26c8222204eef4bb45a0870945ffccc73eb7
Reviewed-on: https://chromium-review.googlesource.com/443585
Commit-Ready: Drew Davenport <ddavenport@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/559911
Reviewed-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>

[modify] https://crrev.com/d0b647e93aa1c57afe88f9fc1394c72624ce5ad5/text/display_boot_message

Labels: VerifyIn-61

Comment 32 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment