Fixing Suspend in Xubuntu on the Acer C720 – A Simplified Guide

I am posting this guide as a point-in-time assist after the release of Ubuntu 14.04, to help those looking to fix suspend in Xubuntu on their C720s (and any Chromebook with Haswell architecture or similar hardware). I will do my utmost to keep this updated, but keep in mind that this post is not my first priority. Please remember that messing about with your system instructions can create horrible problems, for which you are responsible – no one is forcing you to make these changes. If they are very intimidating to you, do not take these steps and stick with crouton or ChrUbuntu! If you have anything to add, please let me know. I welcome help and criticism as it helps all of us with our knowledge.   Things to keep in mind:

  • I am not an experienced coder – I understand the instructions below because I have scripting/coding experience, but I am presenting this only to help those who have little to no experience.
  • I am only one person, so have a little patience – I am doing this only as a service to help you, and cannot do much in the way of troubleshooting. If you are having problems, make sure to present them on the G+ post.
  • As the Ubuntu kernel updates, (ie, 14.04.1) I will try to test if anything is broken – I may miss something, so let me know.

My article is derived from the following reddit post: http://www.reddit.com/r/chrubuntu/comments/1rsxkd/list_of_fixes_for_xubuntu_1310_on_the_acer_c720/ After you have followed the guide for installing Xubuntu, make sure to make corrections in order, as suggested in the reddit post. Specifically, you may have trouble with suspend (closing the lid will cause a lock-up requiring a cold start). Here is all the info you need: https://plus.google.com/113736371980021233804/posts/6CgQypQukMa However, after many responses and corrections, you may find the Google+ post by Pedro Larroy a bit confusing. Here’s a distilled version:

add the following to the kernel boot parameters in /etc/default/grub reload grub via update-grub

add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic

This fix was originally suggested for an earlier kernel – but it has been superseded/replaced by the following scripts, so you will have to make some fixes for Xubuntu 13.10 (stable) or Xubuntu 14.04 . Do not enter the lines above. Only use what I have posted in code below. After making the changes originally posted by Pedro, skip down to the Mike Lim response (I have added formatting to make it easier to read. Hopefully my formatting will work and terminal entries will appear properly):   1. Creating 05_Sound file under /etc/pm/sleep.d/

sudo gedit /etc/pm/sleep.d/05_sound
#####################
#!/bin/sh
# File: "/etc/pm/sleep.d/05_sound"
case "${1}" in
hibernate|suspend)
# Unbind ehci for preventing error
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
# Unbind snd_hda_intel for sound
echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
sleep 1
;;
resume|thaw)
# Bind ehci for preventing error
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
# Bind snd_hda_intel for sound
echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
sleep 1
;;
esac
#################
sudo chmod +x /etc/pm/sleep.d/05_sound

2. rc.local editing

sudo gedit /etc/rc.local
#############################
echo EHCI > /proc/acpi/wakeup
echo HDEF > /proc/acpi/wakeup
echo XHCI > /proc/acpi/wakeup
echo LID0 > /proc/acpi/wakeup
echo TPAD > /proc/acpi/wakeup
echo TSCR > /proc/acpi/wakeup
echo 300 > /sys/class/backlight/intel_backlight/brightness
rfkill block bluetooth
/etc/init.d/bluetooth stop
##############################

IMPORTANT: make sure that your script ends with “exit 0” – no quotes. Do not remove this line!   3. grub editing

sudo gedit /etc/default/grub
######################################
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash tpm_tis.force=1"
######################################

4. update grub

sudo update-grub
sudo update-grub2

IMPORTANT – for those with little to no programming/scripting experience: Hash marks (#) represent “commenting out” – anything following the hash mark on a line will be ignored. Be aware that the comment lines are not necessary, but should be included. Comments help you keep track of what changes you’ve made. This should work perfectly for 13.10, but if you find you have trouble, go back to the G+ post and read through some of the issues. For instance, I keep bluetooth shut off, and have never had the bluetooth issues described in the responses. For those of you using 14.04, the following response from Jimmy Capizzi should addresses additional issues found with suspend. Again, make sure to update grub after you are finished:   1. create sound suspend file in /systemd

sudo mkdir /usr/lib/systemd/system-sleep/
sudo gedit /usr/lib/systemd/system-sleep/cros-sound-suspend.sh
#####################################################
#/usr/lib/systemd/system-sleep/cros-sound-suspend.sh
#!/bin/bash
case $1/$2 in
pre/*)
# Unbind ehci for preventing error
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
# Unbind snd_hda_intel for sound
echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/unbind
;;
post/*)
# unBind ehci for preventing error
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
# bind snd_hda_intel for sound
echo -n "0000:00:1b.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
echo -n "0000:00:03.0" | tee /sys/bus/pci/drivers/snd_hda_intel/bind
;;
esac
#####################################################

Save the gedit file, and you are done. Restart your Chromebook and test suspend. Hopefully, this is helpful to you. It’s a lot to take in and digest through various links, but my intent is only to help clarify for beginners. I welcome all feedback! I really hope this helps simplify your Xubuntu installation on your Chromebook. Good luck!

EDIT (2014-06-11) – I have made a few formatting corrections to the code. I did not realize that I was getting leading spaces on the lines until I copied and pasted code from this article to a new Kubuntu installation on the C720. Also added a line to the Mike Lim fix (last bit of scripting) to make the appropriate directory (see comments for this article). I can confirm that, as of the writing of this edit, suspend works properly using Kubuntu 14.04 and the now current kernel, if you follow these steps. The ChruBuntu installation will default to Kubuntu 12.04 LTS, but I “upgraded” to 14.04 to avoid compiling random kernels.

EDIT (2014-08-12) – I have added the “sleep 1” statements from the G+ post referenced in this article to the “05_sound” script as suggested in the comment made by Michael Conner. I was aware of this fix when I originally wrote this post, but did not see much positive feedback on G+ (and it appeared to be superseded by later fixes), so I left it out of the original script. I can confirm that there are no more wonky responses to sleep/suspend regarding sound after minimal testing. Thanks to Michael for checking in and testing on his own!