Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crouton in a tab #1144

Merged
merged 90 commits into from Dec 24, 2014
Merged

Crouton in a tab #1144

merged 90 commits into from Dec 24, 2014

Conversation

drinkcat
Copy link
Collaborator

This PR adds support for crouton in a window (kiwi). A dummy Xorg server is started on the crouton side, and a NaCl module communicates with the dummy Xorg server (input events, cursors, frame requests) via Websocket. The framebuffer data is not transfered by Websocket, for performance reasons. Instead, data is written directly into shared memory between NaCl and Chrome.

Known issues (fix needed for merge):

Known issues (can be merged without a fix):

  • Switching away from the chroot using croutoncycle does not restore the window to maximum size
  • The extension does not start with focus (you need to click, this might be a Chromium OS bug)
  • IME events (place holder is there, needs implementation)
  • Caps lock is not synchronized (Crouton in a tab #1144 (comment))
  • Waiting for extension to connect before starting WM is potentially racy (the setres 1024 768 trick to provide xfce with a reasonable DPI fails as the extension starts too soon)... (actually, this is more of a xorg+dummy bug: we could get rid of that if dummy supported xrandr 1.2)
  • On stable channel (6158.70.0), the extension/Chrome sometimes crashes on disconnect (fairly frequently): clearly a Chrome bug. Never seen that problem on canary.

Fixed:

  • Pressing on "Unknown" hangs the system? => Do not allow switching to "X11" windows from the extension.
    • Pressing Ctrl+Shift+V is broken (sends SuperL?)
    • Clipboard handling might be broken (aura->cros change?)
    • Touch events (basic, single point only)
    • Window title should correspond to chroot name
    • A leftover FIXME in the code, we should force croutoncycle instead of removing files
    • Errors when loading NaCl module are not reported
    • Limit number of resolution changes when resizing (it's slow because we send far too many "R" requests)
    • Move the websocket functions into a common file
    • Rename Nacl module/target to Kiwi/xiwi.
    • "Error target STRING not available" sometimes appears during switch (harmless, probably due to old chroots running)
    • Logging: Crouton in a tab #1144 (comment)
    • Super_L: Crouton in a tab #1144 (comment)
    • Use patched xorg+dummy.
    • Add test for xiwi target.

@dnschneid
Copy link
Owner

The revolution: IT BEGINS NOW
...pending review of 4500 lines of changes :)

@picostove
Copy link
Collaborator

This is insanely awesome.

SHIPITNOW

@drinkcat
Copy link
Collaborator Author

@DennisLfromGA If you feel like breaking stuff, this is a good opportunity ,-)

@DennisLfromGA
Copy link
Collaborator

@drinkcat - You know I'll be on it ;-)

On Thu, Oct 23, 2014 at 6:44 PM, drinkcat notifications@github.com wrote:

@DennisLfromGA https://github.com/DennisLfromGA If you feel like
breaking stuff, this is a good opportunity ,-)


Reply to this email directly or view it on GitHub
#1144 (comment).

DennyL@GMail

@DennisLfromGA
Copy link
Collaborator

DennisLfromGA commented Oct 24, 2014

I installed a 'criat' branch chroot:

crouton: version 1-20141023203257
release: utopic
architecture: amd64
targets: audio,cli-extra,xiat,extension,gnome,kde,unity,chrome-beta
host: version 6310.14.0 (Official Build) beta-channel parrot

I'm having trouble with launching the tab, it seems to have a problem with the crouton extension server version.
I have a screenshot that may help in troubleshooting here.
I've 'enabled' the crouton extension a number of times but it keeps disabling itself.

@drinkcat
Copy link
Collaborator Author

Thanks, that's actually a good test ,-)

It's a bit tricky to build the extension (it requires the NaCl SDK), so I published it here:
[link removed, please use the official extension]
It will be available in <60 minutes (make sure the version looks like 2.0.1.2318, NOT 2.0.0). Also, you should disable the official crouton extension from chrome://extensions.

@DennisLfromGA
Copy link
Collaborator

DennisLfromGA commented Oct 24, 2014

Still seems stuck when trying to open in a tab. Another screenshot is here -
https://drive.google.com/file/d/0B7fJGoH3F0qDVkY3SDUxNmI2eDg/view?usp=sharing

I thought I may have to enable the Nacl flag so I did:

Native Client Mac, Windows, Linux, Chrome OS, Android
Enable Native Client for all web applications, even those that were not installed from the Chrome Web Store. #enable-nacl
Disable

Update: I disabled & re-enabled the crouton extension (test) and got a couple of links to show up but they don't respond when I click on them.
I've got another screenshot of this here -
https://drive.google.com/file/d/0B7fJGoH3F0qDR2t2WUZYMEd2dzQ/view?usp=sharing

@drinkcat
Copy link
Collaborator Author

You should not need to enable anything NaCl-wise (and even if you did, the window should still open).

I'm not sure why the extension keeps disconnecting... Do you have another chroot running?

@DennisLfromGA
Copy link
Collaborator

@drinkcat - Success!
Sorry but I couldn't get back to this until today but -
I don't know what I did differently, other than log the output of startgnome, but it is working wonderfully ;-)
The extension 'crouton integration TEST' disables itself from time to time but it doesn't seem to affect anything other than cut-n-paste - screenshot here -
https://drive.google.com/file/d/0B7fJGoH3F0qDSlktVE01WmJ0SGM/view?usp=sharing

I'll keep playing with it and other targets and releases when I can.
If there's anything specific you'd like me to test just let me know.

Thanx for this!,
-DennisL

@drinkcat
Copy link
Collaborator Author

@DennisLfromGA : Ah! I suspect you had a croutonclip from an old chroot running... Good to hear that Gnome is working!
For the error, that should not clearly happen, can you click on "Inspect view: background page" in chrome://extensions, under "crouton extension", and see if there is anything useful in the console tab?

I only tested xfce/trusty, so anything else would be good (I don't expect unity to work without 3D acceleration unfortunately... And unity/utopic is still broken at this stage, anyway...).

@DennisLfromGA
Copy link
Collaborator

Cool, cool, cool ;-)

utopic:Gnome - works great!
utopic:KDE - works great!
utopic:Unity - still broken (opens to a pretty purple blank screen with a
cursor)

I have run both gnome and kde simultaneously with no problems, it's cool
when you click on the 'crouton integration TEST' icon on the task bar and
it let's you select the window/session you want. They're both named the
same since the target/DE isn't pouplated but it works fine.

I'll add a utopic:xfce target and let you know how that works on this
platform too.

I plan to add a 'trusty' release also so stay tuned...

Thanx again,
-DennisL

P.S. For the last 2 days, since my AcerC7 updated from 6310.14.0
/ 39.0.2171.25 to 6310.23.0 / 39.0.2171.38, I've been fighting with making
the rootfs rw again.
If I run '/usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification
--partitions $CURRENTKERNEL' it doesn't do anything, just stays ro, if I
use the '--force' option I guess it works but it won't boot at all. Luckily
I have ChrUbuntu on a usb stick and a ChrUbuntu partition so I can boot the
alternate pair to regain control. I didn't see anything glaring in the log (
https://chromium.googlesource.com/chromium/src/+log/39.0.2171.25..39.0.2171.38?pretty=fuller&n=10000)
so hopefully it's just a glitch with this version and/or hardware.
I know this is not the forum for discussing this and I'll probably bring it
up in the chromebook-central forum but I wanted to vent - sorry ;-)

On Sat, Oct 25, 2014 at 6:36 PM, drinkcat notifications@github.com wrote:

@DennisLfromGA https://github.com/DennisLfromGA : Ah! Is suspect you
had a croutonclip from an old chroot running... Good to hear that Gnome is
working!
For the error, that should not clearly happen, can you click on "Inspect
view: background page" in chrome://extensions, under "crouton extension",
and see if there is anything useful in the console tab?

I only tested xfce/trusty, so anything else would be good (I don't expect
unity to work without 3D acceleration unfortunately... And unity/utopic is
still broken at this stage, anyway...).


Reply to this email directly or view it on GitHub
#1144 (comment).

DennyL@GMail

@DennisLfromGA
Copy link
Collaborator

I don't believe this is 'criat' related but when I tried to add the xfce target it failed with the following message:

...
Calculating upgrade... Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 indicator-network : Depends: unity8 (>= 8.00+14.10.20140806) but it is not going to be installed
 libgbm1 : Depends: libgl1-mesa-dri (= 10.3.0-0ubuntu3)
 libqt5multimedia5-plugins : Depends: libqgsttools-p1 (>= 5.3.0) but it is not going to be installed
 qtdeclarative5-ubuntu-settings-components : Depends: qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.1) or
                                                      qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.1) but it is not going to be installed
 ubuntu-keyboard-data : Depends: qtdeclarative5-ubuntu-ui-toolkit-plugin
 ubuntu-system-settings : Depends: qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.1.1239) or
                                   qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.1.1239) but it is not going to be installed
 ubuntu-system-settings-online-accounts : Depends: qtdeclarative5-ubuntu-ui-toolkit-plugin or
                                                   qtdeclarative5-ubuntu-ui-toolkit-plugin-gles but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
Failed to complete chroot setup.
Unmounting /var/crouton/chroots/utopic-criat...```

I entered the chroot and let the install finish but it's still broken, I get the following message:

You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libegl1-mesa-drivers : Depends: libwayland-egl1-mesa (= 10.3.0-0ubuntu3)
E: Unmet dependencies. Try using -f.
Failed to complete chroot setup.
The chroot setup script may be broken. Your chroot is not fully configured.```

apt-get install -f suggests to remove a ton of things so I stopped at that point.
The /etc/apt/preferences.d/precise-mesa-pin file is present so I'm not sure what's wrong.

If this needs to be handled in a new issue or elsewhere please just let me know.

Thanx,
-DennisL

@drinkcat
Copy link
Collaborator Author

They're both named the same since the target/DE isn't pouplated but it works fine.

Oh I didn't think about that. I don't think it's a good idea to run multiple DEs on the same chroot though (things might break if some config/temp files are shared...)

P.S. For the last 2 days, since my AcerC7 updated from 6310.14.0 / 39.0.2171.25 to 6310.23.0 / 39.0.2171.38, I've been fighting with making the rootfs rw again.

That probably deserves opening an issue on crbug.com .

If this needs to be handled in a new issue or elsewhere please just let me know.

Yes please open a new issue. Looks like the mesa downgrade thing is broken in utopic. However, the xorg target should not be pulled in if xiat is specified early in the target list. What's the output of croutonversion?

Thanks!

@DennisLfromGA
Copy link
Collaborator

I don't think it's a good idea to run multiple DEs on the same chroot

I do believe you are correct ;-)
I sometimes run multiple targets but on different chroots - normally.

@DennisLfromGA If you feel like breaking stuff, this is a good opportunity ,-)

Ha,ha, you know me too well...

Here's the croutonversion output:

name: utopic-criat
encrypted: no
Entering /var/crouton/chroots/utopic-criat...
crouton: version 1-20141023203257
release: utopic
architecture: amd64
targets: xfce,audio,cli-extra,xiat,extension,gnome,kde,unity,chrome-beta
host: version 6310.14.0 (Official Build) beta-channel parrot

I'll stop working on this utopic release for now, maybe re-install a new one later.
I'm gon'na install a 'trusty' release with gnome, kde, and unity next but most likely tomorrow.

Thanx,
-DennisL

@drinkcat
Copy link
Collaborator Author

targets: xfce,audio,cli-extra,xiat,extension,gnome,kde,unity,chrome-beta

Yeah. You should specify xiat before any other target, else xorg will be pulled in... (I only discovered that feature recently ,-)). Not quite just how/if we can handle this better...

@DennisLfromGA
Copy link
Collaborator

Just added a criat:trusty chroot - all targets work great!

name: trusty-criat
encrypted: no
Entering /var/crouton/chroots/trusty-criat...
crouton: version 1-20141023203257
release: trusty
architecture: amd64
targets: xiat,audio,cli-extra,extension,gnome,kde,unity,chrome-beta
host: version 6310.14.0 (Official Build) beta-channel parrot```

Not to get ahead of ourselved but...
Would there be a way to 'criat'ize our existing chroots? That would be so cool ;-)

exit 0
fi

if ! timeout 3 \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I didn't know about the timeout command. Maybe we should use it for exitswithin?

@drinkcat
Copy link
Collaborator Author

Would there be a way to 'criat'ize our existing chroots? That would be so cool ;-)

Yes. Just add the xiat target, then fix /etc/X11/xinit/xserverrc symlink to point to /etc/crouton/xserverrc-xiat. We might want to provide an easier way to do this...

@DennisLfromGA
Copy link
Collaborator

@drinkcat

RE: 'criat'ize existing chroot(s)

Yes. Just add the xiat target, then fix /etc/X11/xinit/xserverrc symlink

Just wondering if, when updating, we specify the '... -u -t xiat,x11-common' it would re-link the correct XMETHOD without manual intervention?

@drinkcat
Copy link
Collaborator Author

The crashing stopped happening after upgrading the chroot with the latest commit. But I have only tried it for once and I will continue doing that in the future. Thanks.

Great, thanks.

However, it still starts into the full-screen mode with a black screen and I need to exit and re-enter the full-screen mode to get the desktop shown.

Yeah I managed to reproduce here. It appears to be a unity-specific issue, I have no idea what is going on.

xrandr --rmmode "$name" 2>/dev/null || true
fi

# Setting a custom mode failed, fall back on best match
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this anymore? We're patching dummy and I think the code to add a bunch of resolutions is gone...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See fb8b49b

@tonyxue
Copy link
Contributor

tonyxue commented Nov 26, 2014

This seems like the issue of the tab:

I was doing word editing on Libreoffice in chroot, and I found that sometimes there will be a delay between pressing down and releasing the key so some letters were repeatedly sent into the chroot, causing a sequence of the same letter.

It even happens when I am pressing key combinations like Ctrl+V and I got the content I wanted to paste + vvvvvvvvvvvvvvvvvvvvvvvvvvvv

I am on a trusty chroot with unity

Well, I realized it's actually a problem of latency caused by high load of Chromium OS itself.

@tonyxue tonyxue mentioned this pull request Dec 4, 2014
@dnschneid
Copy link
Owner

Yeah, I'm not sure if there's anything we can do about high load impacting input.

@dnschneid dnschneid mentioned this pull request Dec 4, 2014
@tonyxue
Copy link
Contributor

tonyxue commented Dec 5, 2014

Is it possible that we get rid of some unnecessary components of the
desktops for crouton by ourselves?

2014-12-05 0:16 GMT+08:00 David Schneider notifications@github.com:

Yeah, I'm not sure if there's anything we can do about high load impacting
input.


Reply to this email directly or view it on GitHub
#1144 (comment).

@dnschneid
Copy link
Owner

crouton doesn't really install that much. You can manage what's installed with the distro's package manager (apt-get, aptitude, software center, etc).

@tonyxue
Copy link
Contributor

tonyxue commented Dec 9, 2014

@drinkcat :

Sometimes it remains as a blank screen at the startup of the tab, and if I exit the full-screen mode it would work normally again.

I think I've seen that... Not sure what's the cause.

Interestingly, it worked normally the first time I started the desktop(Unity) after powerwashing my chromebook and started to act in that way again on the second and later trials.

So it made me think that maybe whether something that was written into somewhere did not get deleted when logging out? So it caused the desktop fail to set the resolution later?

I am not familiar with the graphic part so I am just guessing a possible cause.

@nhendin
Copy link

nhendin commented Dec 19, 2014

WOW, just tried this and it's awesome. Well done drinkcat! Thank you!

@dnschneid
Copy link
Owner

Merged and applied minor cleanups and fixups on my xiwi branch. Will be merging into master as soon as the tests pass.

xiwi is now forced if crouton detects freon.

@drinkcat
Copy link
Collaborator Author

@dnschneid : Fixups look good to me. Thanks!

@DennisLfromGA
Copy link
Collaborator

Couple of questions:

  1. When installing and updating 'criat', should we use the 'chroagh' tarball or the croutoin 'xiwi' branch ?
  2. I guess I haven't been paying enough attention to this 'freon/frecon' thing but is it just for the Pixel and Acer C720 or will it migrate into other platforms, like my new HP Chromebook 14 (falco) and should I/we be concerned ?

Thanx in advance,
-DennisL

@dnschneid
Copy link
Owner

  1. xiwi branch is somehow ahead of chroagh for once :) so use that to upgrade your chroot. Merging into master will probably happen tomorrow because the tests take forever to run...
  2. It's being rolled out to dev in stages, but I believe all platforms will be getting it eventually. No need to be concerned; @drinkcat already has a proof-of-concept for getting a GPU-accelerated chroot running alongside Freon. The only stuff you'll lose is the xephyr target (ARM will be forced to use xiwi, unless the move to freon fixes the various issues with the ARM GPU drivers somehow), and some of the more esoteric host-x11 hacks (but xiwi-app may be a better solution for most of those use-cases anyway).

@DennisLfromGA
Copy link
Collaborator

@dnschneid, Thanx a bunch for the info. - and everything else. 👍
Have a Merry Christmas!

@dnschneid dnschneid merged commit 48d0fc7 into dnschneid:master Dec 24, 2014
@DennisLfromGA
Copy link
Collaborator

Yippee!

-DennyL
On Dec 24, 2014 3:53 PM, "David Schneider" notifications@github.com wrote:

Merged #1144 #1144.


Reply to this email directly or view it on GitHub
#1144 (comment).

@tonyxue
Copy link
Contributor

tonyxue commented Dec 25, 2014

Great to see this one merged!!!
A very good Christmas present!

@drinkcat
Copy link
Collaborator Author

@DennisLfromGA @tonyxue : Thanks to both of you for the extensive testing!

@DennisLfromGA
Copy link
Collaborator

It was my pleasure.
These are exciting times in croutonland!

Thanx to you and @dnschneid for making this all possible.

-DennyL
On Dec 28, 2014 5:22 AM, "drinkcat" notifications@github.com wrote:

@DennisLfromGA https://github.com/DennisLfromGA @tonyxue
https://github.com/tonyxue : Thanks to both of you for the extensive
testing!


Reply to this email directly or view it on GitHub
#1144 (comment).

@azenla
Copy link

azenla commented Jan 1, 2015

This thread should win the award for longest conversation on GitHub

@dnschneid
Copy link
Owner

There are some viral threads around GitHub that beat this by a longshot...

@azenla
Copy link

azenla commented Jan 1, 2015

Aww, I was hoping.... :P

@drinkcat drinkcat deleted the criat branch January 22, 2015 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants