dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.56k stars 1.24k forks source link

Problems with graphics, switching between ChromeOS and Ubuntu. #23

Closed jpl888 closed 11 years ago

jpl888 commented 11 years ago

I have found every second or third time I try to switch between the two using the ctrl -> alt -> shift -> back arrow/front arrow combo, the screen doesn't update. If you move the mouse the bits of the Ubuntu screen under the pointer show, and if you go back and forth a few times it comes up correctly. Just wondering if there is a proper fix/workaround?

I would dearly like to use this setup as it's pretty simple (from my perspective), but issues like this and poor font display could become show stoppers forcing me to set up my own devserver to get the packages running on the device I need.

I'm getting the graphical issue on the Samsung ARM Chromebook.

dnschneid commented 11 years ago

Some background: on the ARM Chromebook, the Chromium OS X11 server has a performance hack: if the size of the Chromium OS window (the entire desktop) is the same size as the screen, instead of blitting (manually copying all of the pixels to the framebuffer), it will flip (switch the pointers so the display driver immediately starts reading from the new screen). This is great for both performance and quality (blitting on the Chromebook looks awful), but if you try to display another window, the flip causes whatever is shown on the screen to get overwritten.

crouton works around this by setting up ratpoison to grow the size of the Chromium OS window by one pixel before switching to the nested X server (Ubuntu), and then shrinking everything back to the original size. Since Chromium OS is hidden at this point, its size isn't reset until it is shown again, and so it no longer flips and overwrites the screen. If, however, for some reason the Chromium OS window size resets before it is hidden, or it gets hidden before ratpoison resizes it, Chromium OS will start overwriting the screen, which is the issue you are seeing.

I've seen this happen before, but usually it's pretty rare. It could be a race condition in ratpoison's handling of the "key" hook vs. the "switchwindow" hook, or it could be some inconsistency in the Chromium OS X11 server (which is pretty buggy). Try hitting "Ctrl+Alt+Shift+Esc" and then "enter" immediately before switching to the chroot (Ctrl+Alt+Shift+Back/Front) (each time), and let me know if you still get into that bad state. This will trigger the "grow" and "shrink" in totally different steps, perhaps giving us a clue into where it is failing.

jpl888 commented 11 years ago

Thanks for the info. I'm getting a picture of what's happening.

I am happy to report that Ctrl+Alt+Shift+Esc and then Enter immediately switches perfectly into the chroot. I have switched into the chroot with that and out with the standard Ctrl+Alt+Shift+BackArrow combi about 20 times now without issue. I'd call that a fix. Thanks for the help, I appreciate it. :)

dnschneid commented 11 years ago

Okay, sounds like I need to guarantee some kind of ordering during the switch. I'll look into it, but for now, that's the workaround...

DennisLfromGA commented 11 years ago

I have an Acer C7 therefore I don't use the Shift key when switching but I have also noticed some lag when switching in to or out of ChromeOS & Ubuntu. I've found that, whatever OS I'm using, if I first press Ctrl-Alt-F2(right-arrow) and then either Ctrl-Alt-F1(left-arrow) for ChromeOS or Ctrl-Alt-F3(referesh) for Ubuntu it will immediately switch into the desired OS.

Just my experience (& 2 cents)

dnschneid commented 11 years ago

On Acer and other x86 platforms, R25 disabled the shortcut to jump directly to VT3+, so you have to switch through VT2 to get there. I'm planning to add a shortcut key on those platforms similar to those on ARM (+shift) to make things more consistent, but for now, that's why you're seeing what you're seeing on the Acer.

It's a very different issue from this one on ARM, where the hardware acceleration disabling hack currently in there is being hampered by bad timing.

dnschneid commented 11 years ago

Also note: if you happen to get in the state where the chroot is in focus but is only gradually rendering over Chromium OS (e.g. you can "paint" the screen by moving the mouse everywhere), pop open a terminal in the chroot and run xrefresh. At some point I'll figure out a fix for the race condition.

samskillman commented 11 years ago

Thanks for the workaround. I can verify that this is a bug on my ARM chromebook as well. Somewhere around 1/4 times I seem to get hit by it.

RadioactiveMouse commented 11 years ago

I've been seeing this as well. In fact I was getting it so bad that I had to remove the chroot and go back to dual boot Ubuntu :( Unfortunately I didn't see the workaround in time so never got time to check it.

jpl888 commented 11 years ago

It wasn't happening on a Unity target for me until the last ChromeOS update but one.


John Lewis 089 9673630 051 643858

On 06/03/2013 23:22, samskillman wrote:

Thanks for the workaround. I can verify that this is a bug on my ARM chromebook as well. Somewhere around 1/4 times I seem to get hit by it.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14532943

jpl888 commented 11 years ago

I'm using the key combo to switch in and out of the chroot now. One extra key, no biggy.


John Lewis 089 9673630 051 643858

On 07/03/2013 09:31, Tom Townsend wrote:

I've been seeing this as well. In fact I was getting it so bad that I had to remove the chroot and go back to dual boot Ubuntu :( Unfortunately I didn't see the workaround in time so never got time to check it.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14550311

dnschneid commented 11 years ago

Upgrade your chroots and bask in the sanity of sane switching! ...or let me know if it doesn't work.

jpl888 commented 11 years ago

Well, on the plus side, the switching does seems to be better, if not perfect, and the fonts on the taskbar are an awful lot clearer and more readable, but I has no launcher bar, or icons. The pointer is the default "X" from xorg, or whatever it's called. B0rksville it is then. :(

On 07/03/2013 19:22, David Schneider wrote:

Upgrade your chroots and bask in the sanity of sane switching! ...or let me know if it doesn't work.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14580547

jpl888 commented 11 years ago

In Crosh I'm getting "(metacity:18832): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Failed to connect to socket /tmp/dbus-ojddH9FFVu: Connection refused Window manager warning: No D-BUS daemon running" and the temp file name changes every time it prints the message, which sounds like it can't create the file to me. Pointers?

On 08/03/2013 09:53, jlewis wrote:

Well, on the plus side, the switching does seems to be better, if not perfect, and the fonts on the taskbar are an awful lot clearer and more readable, but I has no launcher bar, or icons. The pointer is the default "X" from xorg, or whatever it's called. B0rksville it is then. :(

On 07/03/2013 19:22, David Schneider wrote:

Upgrade your chroots and bask in the sanity of sane switching! ...or let me know if it doesn't work.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14580547

jpl888 commented 11 years ago

Ignore me. My bad. I forgot the update would overwrite my change to the script to mount my sdcard on /home in the chroot.

And also my change to /usr/local/bin/startunity inside the chroot, which loads my xmodmap file ...

I would still like nicer fonts though. ;)

On 07/03/2013 19:22, David Schneider wrote:

Upgrade your chroots and bask in the sanity of sane switching! ...or let me know if it doesn't work.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14580547

jpl888 commented 11 years ago

Also, the mouse click won't work the first time you switch into the chroot, but I think I spied another bug with that name ...

On 07/03/2013 19:22, David Schneider wrote:

Upgrade your chroots and bask in the sanity of sane switching! ...or let me know if it doesn't work.

Reply to this email directly or view it on GitHub [1].

Links:

[1] https://github.com/dnschneid/crouton/issues/23#issuecomment-14580547

RadioactiveMouse commented 11 years ago

I can confirm this now works for me too. Thanks.