linux on the hp envy 15

envy beats 15

Computer folks, especially Linux hackers, are a little weird when it comes to vacation. A lot of them look forward to a large uninterrupted block of time so they can focus on their personal programming projects. The reason this is weird is because to the observer, the form of what the hacker is doing remains unchanged from normal: hunched over a keyboard, drinking a beverage of dubious quality from a can, muttering to self, occasionally pausing to scratch.

But inside the mind, it’s more fun than no-pants day at EPCOT center. Personal projects are fun precisely because they’re personal. You’re creating (or fixing) something just for yourself, and in the end, you get to reap the benefit of your own work. And if you can share the results with others, so much the better. It’s like you got to eat 10 funnel cakes by yourself and everyone else grows fat with you. Can’t beat that with a stick.

I’ve spent the past week or so playing with the HP Envy, which apparently is one of the jawesomest laptops on the market right now. Unfortunately, Linux wasn’t working that well on it and folks started complaining. Via some internal HP magic, I managed to get my hands on one to try and improve the situation (in my own time, as a volunteer, hence the lead-in to this post).

So here’s the sitch. I’ll update this page as I learn more.

First off, you need to be sure you have the latest BIOS. As of this writing, the latest revision is F.07.

I’ve been doing all my testing with a combination of Ubuntu (Karmic Koala) and upstream Linus kernels. If I get the time, I may play with some other distros, but for now, it’s all I’ve done.

what works

  • Thermal controls — fans, CPU throttling, thermal zones etc. All that stuff is good to go; you won’t end up with a pool of dripping silicon and plastic burning into your crotch
  • TurboBoost — the Intel Core i7 chip has a TurboBoost feature; I’ve confirmed that it works on the Envy
  • just about everything else: wifi, sound, media card reader, etc.

fixes in-flight

  • I submitted a patch series upstream to resolve an ACPI issue that some people were seeing in dmesg. The message was obtuse, but it was indicating that we couldn’t initialize the ambient light sensor. My patch re-enables it. Update: (12/22) patch set applied to acpi-test. (12/25) patches in 2.6.33-rc2
  • Takashi Iwai wrote a patch to enable the clickpad. Alternatively, you can workaround the lack of right-click by using the keyboard’s right-click button (next to the right control key) or use an external mouse.
  • Update: (1/20) Fixed how Linux handles C states, machine now idles much cooler in AC mode. patches will be in 2.6.33 (when released) Update: (2/9) backported to Ubuntu Karmic; more details below

workarounds

  • Update: (2/14) Verified a workaround for screen corruption after suspend/resume. You need to create a minimal xorg.conf in /etc/X11/ that has the following contents:

    Section "Screen"
    Identifier "Default Screen"
    DefaultDepth 24
    EndSection


    Section "Device"
    Identifier "Default Device"
    Driver "ati"
    Option "EXANoDownloadFromScreen" "true"
    EndSection

Copy and save the above into /etc/X11/xorg.conf, then issue sudo /etc/init.d/gdm restart and you’re good to go.

distro watch

Ubuntu Karmic

ugly warts

  • corrupt screen after resume. haven’t had time to work on this one yet. You can workaround this by issuing /etc/init.d/gdm restart after resume, but of course that will restart the X server and you’ll lose your work. Still, it may be faster than a full reboot. Update: (2/14) Discovered Launchpad bug screen corruption with Radeon 4770 and verified that the fix in comment #5 works on the Envy 15. The workaround makes the screen corruption after suspend/resume go away. Yay!

topics of extreme confusion

TurboBoost
TurboBoost requires support from the BIOS and hardly any involvement from the OS (whether it’s Windows or Linux). The Envy BIOS does indeed turn TurboBoost on. Yet, when you look in /proc/cpuinfo and look for “Hz”, you may only see 1.6GHz or 1.7GHz.

What is going on?

The issue is the way that the Linux kernel calculates the speed of the CPU. In summary, it does not display the speed 100% accurately all the time on CPUs with TurboBoost, and it probably never will. The reason I say it probably never will is because in order to calculate the speed of a TurboBoost CPU, the kernel would have to poll the hardware once every second. This is a pretty wasteful thing to do; your machine could be doing something useful instead of figuring out exactly how fast the CPU is running.

So you cannot simply look at the Hz output from the kernel in order to determine if TurboBoost is on. In fact, the way you do so is by looking at another place in /proc/cpuinfo — the ‘flags’ field.

$ cat /proc/cpuinfo | grep flags | grep ida | uniq
 

If you get output from this command, it tells you that the Linux kernel detected the ‘ida’ feature. ‘ida’ is simply the acronym for Intel Dynamic Acceleration, which is the official name for TurboBoost. I verified that the Envy has this feature turned on.

C states
The Envy BIOS presents cc1/cc6 (advertised as C1/C2) to the OS when the AC adapter is plugged in during boot (call this AC mode) and presents cc1/cc3/cc6 (advertised as C1/C2/C3) if it is running on battery during boot (call this DC mode).

I’ve noticed that the machine idles at around 30C when in DC mode, and idles around 55C in AC mode. This happens in both Windows and Linux, and is likely to be a permanent behavior. So what I’ve been doing is booting the machine unplugged (DC mode) and then after logging in, plugging the power back in. Even after plugging the power in, the machine stays in DC mode, and will idle significantly cooler.

Currently, Linux has some issues with displaying the C state information in AC mode. That’s next on my list of things to investigate, but I just haven’t gotten around to it yet.

Update: (1/20) After some more debugging, we’ve discovered that the BIOS advertises a C2 latency of 245us, which Linux didn’t like. Linux refused to accept latencies > 100us, and that is why the machine idled so hot in AC mode. The fix was to patch Linux and remove the 100us limit for C2. After applying this patch, my machine now idles between 30C and 40C, even in AC mode.

summary
With the most recent BIOS updates, Linux works fairly well on the Envy. The most serious outstanding issue is the screen corruption during suspend/resume, and I hope to get to that after vacation.

If folks out there want to report other issues, drop me a comment and I’ll see what I can do.

Finally, this sucker is hard to photograph because it’s so darn shiny. My first few attempts in using my ghetto-fab lightbox kept on revealing the crappy cardboard interior reflected on the machine’s surface. I figured out that I could use another piece of posterboard to prevent stray reflections of the lightbox and ended up shooting from the side so I didn’t show up in the shot. Still, you can see the reflection of the cardboard in the edge of the lid. Oh well.

This was my setup to get the photo above.

ghetto-envious