Bug 14078 - Headphone jack gives no sound (macbook pro 4.1)
Summary: Headphone jack gives no sound (macbook pro 4.1)
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Takashi Iwai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-28 08:04 UTC by sveina
Modified: 2009-08-31 10:51 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.30-rc2-00106-ga9fd4f3
Tree: Mainline
Regression: No


Attachments
alsa-info output on speakers (29.75 KB, text/plain)
2009-08-28 18:29 UTC, sveina
Details
alsa-info output on headphones (29.75 KB, text/plain)
2009-08-28 18:30 UTC, sveina
Details
Alsa-info output for last working version (on speakers) (27.99 KB, text/plain)
2009-08-29 10:20 UTC, sveina
Details
Alsa-info output for last working version (on headphones) (28.00 KB, text/plain)
2009-08-29 10:20 UTC, sveina
Details
alsa-info output, post hda-verb, with headphones plugged before running hda-verb (28.00 KB, text/plain)
2009-08-29 10:26 UTC, sveina
Details
alsa-info output for model=auto, triple hda-verb invocation (27.33 KB, text/plain)
2009-08-29 10:30 UTC, sveina
Details
Fix / improve ALC889A mbp3 quirk (3.43 KB, patch)
2009-08-30 10:09 UTC, Takashi Iwai
Details | Diff

Description sveina 2009-08-28 08:04:28 UTC
As of commit a9fd4f3fcdc7e5757424f7e5888f660cf34bb1a9 (git-bisected), on a macbook pro 4.1, when headphones are plugged in the speakers mute yet the headphones produce no sound whatsoever. It's possible to manually unmute the speakers while headphones are plugged in; no combination of settings gives sound on the headphones.

Prior to this, alsa correctly switched between headphone and speaker output.
Comment 1 sveina 2009-08-28 08:05:25 UTC
Note, git-bisection was completed using only patches that touch sound/pci/hda, and so may theoretically be inaccurate.
Comment 2 Takashi Iwai 2009-08-28 08:21:45 UTC
Does this still happen with 2.6.31-rc8 kernel?
If yes, please give alsa-info.sh output (run with --no-upload option).
Comment 3 sveina 2009-08-28 18:29:26 UTC
Created attachment 22890 [details]
alsa-info output on speakers

Output on 2.6.31-rc8; headphones still not working
Comment 4 sveina 2009-08-28 18:30:08 UTC
Created attachment 22891 [details]
alsa-info output on headphones
Comment 5 Takashi Iwai 2009-08-28 21:56:04 UTC
So, if I understand correctly, the speaker is correctly muted automatically via the headphone plugging (and I suppose unmute after unplugging).  But, the no sound comes from the headphone.  Right?

What happens if you raise "Line-Out Playback Volume"?  For example,
    % amixer -c0 set "Line-Out" 0dB
Comment 6 sveina 2009-08-28 21:59:57 UTC
You understand correctly.

The line-out control does nothing, on its own or in combination, nor do any others; I've tried unmuting and raising the volume using every control in alsamixer (including the input ones).
Comment 7 Takashi Iwai 2009-08-28 22:04:32 UTC
OK, then try to get hda-verb program from:
    http://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/hda-verb/

and run like below (as root):
    # hda-verb /dev/snd/hwC0D0 0x15 SET_PIN_WID 0xc0

(Note that this requires the hd-audio drivers built with CONFIG_SND_HDA_HWDEP=y.)

Does it give any change?
Comment 8 Takashi Iwai 2009-08-28 22:07:48 UTC
Also, try to load snd-hda-intel module with model=auto option, and adjust mixer again.  Does it work better?
Comment 9 sveina 2009-08-28 23:10:41 UTC
hda-verb did nothing, before or after reloading with model=auto.

Loading snd-hda-intel with model=auto caused alsamixer to show a number of new channels, including one for headphones; it looked quite promising. Unfortunately, it caused no sound to be emitted, period, in either headphone or speaker mode.
Comment 10 Takashi Iwai 2009-08-29 06:23:11 UTC
If this doesn't work, please give alsa-info.sh output at this state.
(In reply to comment #9)
> hda-verb did nothing, before or after reloading with model=auto.
 
That hda-verb command is for without model option.
Do load the driver without model=auto option, run hda-verb command, and give alsa-info.sh output again.

> Loading snd-hda-intel with model=auto caused alsamixer to show a number of
> new
> channels, including one for headphones; it looked quite promising.
> Unfortunately, it caused no sound to be emitted, period, in either headphone
> or
> speaker mode.

MacBookPro requires GPIO1 setup with model=auto.  Run the following sequence:
    # hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x01
    # hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x01
    # hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x01

Then try again.  If this doesn't work, give alsa-info.sh at this state, too.
Comment 11 Takashi Iwai 2009-08-29 08:17:24 UTC
Also, if you can have the old working version, please give alsa-info.sh output on that.  In that way, we can compare the difference what was actually changed.
Comment 12 sveina 2009-08-29 10:20:37 UTC
Created attachment 22894 [details]
Alsa-info output for last working version (on speakers)
Comment 13 sveina 2009-08-29 10:20:59 UTC
Created attachment 22895 [details]
Alsa-info output for last working version (on headphones)
Comment 14 sveina 2009-08-29 10:26:00 UTC
Created attachment 22896 [details]
alsa-info output, post hda-verb, with headphones plugged before running hda-verb
Comment 15 sveina 2009-08-29 10:30:24 UTC
Created attachment 22897 [details]
alsa-info output for model=auto, triple hda-verb invocation

Indeed, this didn't work either. No output, with speakers or without.
Comment 16 Takashi Iwai 2009-08-30 10:07:59 UTC
Could you try the patch below (without model option)?
This will add the individual Headphone and Speaker volumes, too.

Also, the Line-Out volume is renamed as Surround volume since it's the optional surround volume for 4ch mode.
Comment 17 Takashi Iwai 2009-08-30 10:09:13 UTC
Created attachment 22910 [details]
Fix / improve ALC889A mbp3 quirk
Comment 18 sveina 2009-08-30 10:50:06 UTC
That worked perfectly; thank you very much. Not only do the headphones work, but I can now control the headphone and speaker volume separately, the way I could in OS X back when I used it. I vote to apply it. ;)

One cosmetic flaw: The speaker volume shows up at the far right of alsamixer, instead of next to the headphone controls like they ought to. That is, it goes "master - headphones - pcm - (...lots of extra controls...) - speaker", while it ought to go "master - headphones - speaker - pcm".

I don't know if you have any control over the order they show up there, but if it's an easy fix, I'd appreciate fixing that.
Comment 19 Takashi Iwai 2009-08-31 10:50:40 UTC
Thanks for checking.  The patch is now in sound git tree and also submitted to Linus.

Regarding the speaker volume position; this has nothing to do with the kernel but an issue of alsa-lib.  I'm going to fix this later.

Note You need to log in before you can comment on or make changes to this bug.