You are not logged in.

#1 2011-08-29 15:20:04

DarkOtter
Member
Registered: 2011-08-29
Posts: 10

Headphone Sensing Problems on Acer Aspire 722

I recently bought an Acer Aspire 722 laptop, but have had some issues with sound through the headphones. Although sound mainly works straight away, the headphone jack does not work by default, if headphones are plugged in sound continues to play through the speakers, and no sound plays through the headphones. However, it is possible to get sound to play though the headphones (and not through the speakers) by tweaking some settings using hda_analyzer. However, I have not found any tweaks that actually make the headphone sensing work - just that allow you to manually switch between speakers and headphones.

Firstly, some extracts from lspci -k in case they are helpful:

$ lspci -k
[snip]
00:01.1 Audio device: ATI Technologies Inc Device 1314
	Subsystem: Acer Incorporated [ALI] Device 0598
	Kernel driver in use: HDA Intel
	Kernel modules: snd-hda-intel
[snip]
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)
	Subsystem: Acer Incorporated [ALI] Device 0598
	Kernel driver in use: HDA Intel
	Kernel modules: snd-hda-intel
[snip]

The first device seems to be the audio output for an HDMI port, the second seems to be the main sound card. As mentioned, by performing some tweaks in hda analyzer I can switch sound to being just through headphones (temporarily). The diff of which is shown below:

Diff for codec 1/0 (0x14f1506c):
--- 
+++ 
@@ -102,16 +102,17 @@
   Power: setting=D0, actual=D0
   Connection: 4
      0x1a* 0x1b 0x1d 0x1e
 Node 0x19 [Pin Complex] wcaps 0x400581: Stereo
   Pincap 0x0000001c: OUT HP Detect
   Pin Default 0x03211040: [Jack] HP Out at Ext Left
     Conn = 1/8, Color = Black
     DefAssociation = 0x4, Sequence = 0x0
+  Pin-ctls: 0xc0: OUT HP
   Unsolicited: tag=0x00, enabled=0
   Power: setting=D0, actual=D0
   Connection: 2
      0x10* 0x11
 Node 0x1a [Pin Complex] wcaps 0x400481: Stereo
   Pincap 0x00001324: IN Detect
     Vref caps: HIZ 50 80
   Pin Default 0x03a1103e: [Jack] Mic at Ext Left
@@ -164,17 +165,16 @@
   Unsolicited: tag=0x00, enabled=0
   Power: setting=D0, actual=D0
 Node 0x1f [Pin Complex] wcaps 0x400501: Stereo
   Pincap 0x00000010: OUT
   Pin Default 0x92170110: [Fixed] Speaker at Int Front
     Conn = Analog, Color = Unknown
     DefAssociation = 0x1, Sequence = 0x0
     Misc = NO_PRESENCE
-  Pin-ctls: 0x40: OUT
   Power: setting=D0, actual=D0
   Connection: 2
      0x10* 0x11
 Node 0x20 [Pin Complex] wcaps 0x400781: Stereo Digital
   Pincap 0x00000010: OUT
   Pin Default 0x400001f0: [N/A] Line Out at Ext N/A
     Conn = Unknown, Color = Unknown
     DefAssociation = 0xf, Sequence = 0x

I would greatly appreciate any help on how to either get headphone jack sensing working, or to disable speakers and use headphones by default (to save me having to switch it after ever boot. If there is any other information needed (I am afraid I am not much of a linux expert and even less of a sound and/or ALSA expert) please let me know.

Offline

#2 2011-08-29 16:41:34

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Headphone Sensing Problems on Acer Aspire 722

See http://ubuntuforums.org/showthread.php?t=1811178 and https://bugs.launchpad.net/ubuntu/+sour … omments/91

You should Google for "ALSA" with the hardware model, to see how other people are doing with the same hardware.

Offline

#3 2011-08-29 21:30:41

DarkOtter
Member
Registered: 2011-08-29
Posts: 10

Re: Headphone Sensing Problems on Acer Aspire 722

Thank you very much for the help, I had already read the first thread, but the fix offered there was only in the form of a .deb package, and I am unaware how to install these on Arch Linux (or if it is even possible, sorry, Arch newbie). The thread linked to from there suggested tweaking an EAPD flag in hda-analyzer (which is why I had been messing around with it to start with), but the flag mentioned in the thread was actually already set on my machine when I looked.

I have also tried the same fix as mentioned in the second thread of compiling the latest alsa modules snapshot (with the enable dynamic minors option, whatever that means) and this did not work either (I don't know why), although I had found those instructions somewhere else originally (fedora forums iirc). The sound still works exactly as before, with no headphone sensing (but the ability to switch manually with hda-analyzer).

I shall try further googling concentrating on the hardware model, I had been mainly googling for sound problems specific to the aspire 722 before. So far my searches by hardware model have not turned up much apart from turning on model=laptop in the options for the snd-hda-intel module, which I had already tried (as well as the auto, acer, and acer-aspire models) and did not fix the problem.

Thanks for your reply, if you have any other hints of where to look or what might fix the problem they would be greatly appreciated.

Offline

#4 2011-08-29 22:10:03

DarkOtter
Member
Registered: 2011-08-29
Posts: 10

Re: Headphone Sensing Problems on Acer Aspire 722

I have a reasonable workaround for the time being using the hda-verb utility from ftp://ftp.suse.com/pub/people/tiwai/misc/. I just wrote a small bash script to allow me to easily switch between headphones and speakers (shown below). I have found some mention of there being flags available through hda verb that may get the sensing working properly, I will experiment further with hda analyzer to see what I can find.

The script if anyone wants it, 0x19 is the node/pin/whatever ID of the headphone jack (found using hda analyzer) and 0x1f that of the speakers.

#!/bin/bash

if [[ "${UID}" -ne "0" ]]; then
  echo "!! Must be root"
  exit 1
fi

# Change hda_verb to the path of hda-verb on your system
hda_verb="${HOME}/Tmp/alsa/hda-verb"
# Change these to the pins of the headphones and speakers, can be found using hda analyzer
pin_headphones="0x19"
pin_speakers="0x1f"

case "$1" in
  [Hh]*)
    ${hda_verb} /dev/snd/hwC1D0 "${pin_headphones}" \
      set_pin_wid 0xc0
    ${hda_verb} /dev/snd/hwC1D0 "${pin_speakers}" \
      set_pin_wid 0x00
    ;;
  [Ss]*)
    ${hda_verb} /dev/snd/hwC1D0 "${pin_headphones}" \
      set_pin_wid 0x00
    ${hda_verb} /dev/snd/hwC1D0 "${pin_speakers}" \
      set_pin_wid 0x40
    ;;
esac

Offline

#5 2011-08-29 22:57:20

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Headphone Sensing Problems on Acer Aspire 722

ALSA "verbs" aren't distro-specific. It would be better to put such stuff on ALSA's own bugzilla, so that support in ALSA can be added for your card eventually.

Offline

#6 2011-09-06 16:59:29

insecticider
Banned
Registered: 2011-06-16
Posts: 29

Re: Headphone Sensing Problems on Acer Aspire 722

DarkOtter, can you explain how to use the bash script.  I have the exact same laptop as you and using that script would make my life easier instead of manually checking/unchecking things in hda_analyzer.  Thanks,.

Offline

#7 2011-09-06 17:22:23

DarkOtter
Member
Registered: 2011-08-29
Posts: 10

Re: Headphone Sensing Problems on Acer Aspire 722

Sure, I'm afraid I haven't had a chance to report the bug at ALSA yet (impending deadlines at Uni, urgh), so there won't be a proper solution for us yet I imagine, but here's as best I can explain how to use the work around.

The first thing you'll need to do is to get the 'hda-verb' utility program. Head on over to ftp://ftp.suse.com/pub/people/tiwai/misc/ and download a tarball of it from there, I went for the 0.4 version because it was the newest (and still is as of this writing). Download it to somewhere (I made a directory ${HOME}/Tmp/alsa to put all this stuff in, but the choice is up to you).

Then you need to untar it and compile it, I don't know exactly which packages you will need for this (I am a total newbie at Arch still, I used to use Ubuntu), but I'm pretty sure you'll need at least base-devel. Having compiled it with make, you should get a little hda-verb binary somewhere, which is what you need to put in the path of hda-verb in the script.

Then you should be able to simply run the script as root (you can do this using sudo bash {script path} if you have sudo installed) and give it either h or s as an argument, to switch to headphones or speakers.

Assuming you have sudo installed, and you're happy to use the same as me, you should be able to do all of this in a terminal like so:

mkdir -p "${HOME}/Tmp/alsa" # Make a neat directory for all these things
cd "${HOME}/Tmp/alsa"
wget --trust-server-names 'ftp://ftp.suse.com/pub/people/tiwai/misc/hda-verb-0.4.tar.gz' # This should download to 'hda-verb-0.4.tar.gz'
tar xf hda-verb-0.4.tar.gz
cd hda-verb-0.4/ # Change into the source directory
sudo pacman -S base-devel # This should install everything you need to build I hope, you may already have it (may prompt for password)
make # This should then do the compilation and create 'hda-verb'
cd .. # Change back up to the parent dir
ln -s "${HOME}/Tmp/alsa/hda-verb-0.4/hda-verb" hda-verb # I chose to make a symlink outside of the source dir

This should do most of the installation process. The next thing is to save the script in a text file (may I suggest "${HOME}/Tmp/alsa/change.sh" ?).

Then, to change to headphones:

sudo bash "${HOME}/Tmp/alsa/change.sh" h

Or to speakers:

sudo bash "${HOME}/Tmp/alsa/change.sh" s

I have noticed recently that occassionally I have to run the command again if I start a new audio program, otherwise sound starts on the speakers again. Further investigation is needed on my part. My apologies for any typos etc.

Offline

#8 2011-09-06 17:53:58

insecticider
Banned
Registered: 2011-06-16
Posts: 29

Re: Headphone Sensing Problems on Acer Aspire 722

DarkOtter,


Thank you so much for the post and instructions.  Everything worked perfectly.  I really appreciate all your help and time.

Offline

#9 2011-09-06 17:56:22

DarkOtter
Member
Registered: 2011-08-29
Posts: 10

Re: Headphone Sensing Problems on Acer Aspire 722

No problem, I shall be posting here once I get a chance to familiarise myself with everything enough to get things rolling over at the ALSA bug tracker, so hopefully there will be a fix sooner or later. Glad the workaround is working for the time being smile

Offline

#10 2011-11-13 18:14:35

Jarek75
Member
Registered: 2011-11-13
Posts: 2

Re: Headphone Sensing Problems on Acer Aspire 722

DarkOtter, thanks a lot for your article. With it managing headphones on this netbook was like a walk in a park. I'd like to suggest putting a script into /etc/rc.local which detects whether headphones are in. It automatically adjusts output pins.

Here is my script, but please correct the paths yourselves:

#!/bin/bash
while [[ 1 ]]; do
  v=`/d/instal/hda-verb-0.4/hda-verb /dev/snd/hwC1D0 0x19 get_pin_sen 0 2>&1|grep value`
  if [[ X$v == X"value = 0xffffffff" ]]; then
    echo headphones
    /d/instal/hda-verb-0.4/hda-verb /dev/snd/hwC1D0 0x19 set_pin_wid 0xc0
    /d/instal/hda-verb-0.4/hda-verb /dev/snd/hwC1D0 0x1f set_pin_wid 0x00
  else
    echo speaker
    /d/instal/hda-verb-0.4/hda-verb /dev/snd/hwC1D0 0x19 set_pin_wid 0x00
    /d/instal/hda-verb-0.4/hda-verb /dev/snd/hwC1D0 0x1f set_pin_wid 0xc0
  fi
  sleep 1
done

And 1 line of my rc.local:

/d/jarek/sluchawki.sh &

Offline

#11 2011-11-18 00:25:46

coolbooks2
Member
Registered: 2009-02-12
Posts: 19

Re: Headphone Sensing Problems on Acer Aspire 722

I have the same laptop. I had the same problem with sound on the 3.0 kernel but the 3.1 kernel fixes the problem. So with that upgrade are you still having the issue?

Offline

#12 2011-11-18 08:08:21

Jarek75
Member
Registered: 2011-11-13
Posts: 2

Re: Headphone Sensing Problems on Acer Aspire 722

Actually I'm not using Arch Linux at all. But since DarkOtters's solution worked on my Ubuntu 11.04 (N), I posted an enhancement to it. A week ago they released a new version (O), but I haven't upgraded yet.

Offline

#13 2011-11-20 02:37:26

coolbooks2
Member
Registered: 2009-02-12
Posts: 19

Re: Headphone Sensing Problems on Acer Aspire 722

If you upgrade you probably won't need the solution. I had issues with this laptop as soon as I got it with 3.0. I then compiled 3.1 rc myself using the linux-mainline package from the aur. But since 3.1 hit the repos that hasn't been necessary anymore. Good to know it's working though.

Offline

Board footer

Powered by FluxBB