Comment 0 for bug 1255370

Revision history for this message
Chun Li (lichun1668) wrote :

I installed Ubuntu 13.10 on a new MacBook Pro (Late 2013, 13-inch Haswell retina). The speakers did not work after installation, and after I fixed it, it would not work after suspend. It turns out some of the flags were not set correctly. I can fix these problems but it would be nice to have them fixed at installation.

The problem can be seen in the GPIO section in /proc/asound/card1/codec#0 (card0 is for HDMI). After boot, the GPIO flags for IO[0] were

GPIO: io=6, o=2, i=0, unsolicited=1, wake=1
  IO[0]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0

If data were set to 1, sound would work! I fixed this by installing alsa-tools and adding to /etc/rc.local a line:

hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1

After resuming from suspend, the GPIO flags for IO[0] became

GPIO: io=6, o=2, i=0, unsolicited=1, wake=1
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0

Here, three flags were set to 0. I fixed this by adding to /etc/pm/sleep.d/99_myfix a few lines:

#!/bin/sh
case "$1" in
 resume|thaw)
  hda-verb /dev/snd/hwC1D0 0x1 set_gpio_mask 1
  sleep 1
  hda-verb /dev/snd/hwC1D0 0x1 set_gpio_direction 1
  sleep 1
  hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1
  ;;
esac