Ubuntu

M4A89GTD_PRO_USB3/Realtek ALC892, Green Headphone Out, Front] Playback problem

Reported by Alvaro Leal (Effenberg0x0) on 2011-10-10
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Undecided
Unassigned

Bug Description

The motherboard is an ASUS for AM3 with ALC892. The specs are here: http://www.asus.com/Motherboards/AMD_AM3/M4A89GTD_PROUSB3/#specifications . According to specs, it supports sense and "retasking" in all jacks. Sense works in Windows 7. I could never find a way to make it work in Ubuntu. Same sound goes out from rear green jack and front (headphone) green jack. They do have independent sliders on AlsaMixer - one can change volume of "Front" Slider (controls rear green jack) or Headphone Slider (Front Green Jack). However, muting any of them on AlsaMixer mutes both. Other sliders (jmiddle, bass, center) slide together with front, although nothing is connected to them.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: alsa-base 1.0.24+dfsg-0ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: al 23208 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'SB'/'HDA ATI SB at 0xfbff4000 irq 16'
   Mixer name : 'Realtek ALC892'
   Components : 'HDA:10ec0892,104383c0,00100302'
   Controls : 35
   Simple ctrls : 20
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xfe77c000 irq 19'
   Mixer name : 'Nvidia GPU 11 HDMI/DP'
   Components : 'HDA:10de0011,10de0101,00100100'
   Controls : 16
   Simple ctrls : 4
Date: Mon Oct 10 01:42:46 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110803.1)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaPlaybackTest: ALSA playback test through plughw:SB successful
Symptom_Card: Internal Audio - HDA ATI SB
Symptom_Jack: Green Headphone Out, Front
Symptom_PulsePlaybackTest: PulseAudio playback test successful
Symptom_Type: None of the above
Title: [System Product Name, Realtek ALC892, Green Headphone Out, Front] Playback problem
UpgradeStatus: Upgraded to oneiric on 2011-09-06 (33 days ago)
dmi.bios.date: 07/18/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 2301
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: M4A89GTD-PRO/USB3
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr2301:bd07/18/2011:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnM4A89GTD-PRO/USB3:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
modified.conffile..etc.modprobe.d.alsa.base.conf: [modified]
mtime.conffile..etc.modprobe.d.alsa.base.conf: 2011-10-05T15:46:37.376324

David Henningsson (diwic) wrote :

Hi Effenberg, I've been trying your codec in an emulator with the latest upstream code, and it seems to work there, so can you please try the following:

1) Make sure you have no alsa overrides installed (make sure "modinfo snd-hda-codec" returns /lib/modules/<kernel version>/sound/pci/hda/snd-hda-codec.ko)
2) Your logs indicate a modified /etc/modprobe.d/alsa-base.conf, make sure it is unmodified
3) Install latest upstream code: https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS
4) Reboot and test.

This should make automute work.

 > However, muting any of them on AlsaMixer mutes both.

Hmm, this is probably PulseAudio playing some tricks after a workaround I added for another bug. I guess we'll have to live with that for the time being.

Changed in alsa-driver (Ubuntu):
status: New → Incomplete

Hi David, I have tried to document all the procedure here, so you can have a look at it. The attachments have the various steps in the procedure of fully uninstalling alsa/pulse, reinstalling, dkms, alsa-base.conf, modingo snd-hda-intel, etc.

The results (things changes a bit from previous behavior). Testing with media player (Clementine):

1) Plugging / Unplugging Headphone to Front Green Connector:
Sound on External Speakers (Rear Green Jack) AND Headphone. No Speaker muting. No changes to volumes. No moves on alsamixer sliders.

2) Alsamixer MASTER Slider
Controls Speakers and Headphone volumes.

3) Alsamixer HEADPHONE Slider
Controls Nothing. No changes when moving slider up/down to Speaker or Headphone.

4) Alsamixer PCM Slider
Controls Speakers and Headphone volumes.

5) Alsamixer FRONT Slider
Controls Speakers and Headphone volumes

So although things are indeed different now, we can't actually say that it works as we were expecting it to. But thank you so much for your efforts.

Regards,
EFfenberg

David Henningsson (diwic) wrote :

Still something must be different on your setup compared to in my emulator. In my emulator, FRONT does not control headphones, and automute works. I'm attaching the emulator log, mostly for my own reference.

David Henningsson (diwic) wrote :
David Henningsson (diwic) wrote :

Hmm, actually the headphones goes to dac 0x25 as well.
Could you attach an alsa-info with the headphones plugged in? http://wiki.ubuntu.com/Audio/AlsaInfo

Hey, here's the alsa-info file. Let me know of anything else you need.
Thanks,
Effenberg

David Henningsson (diwic) wrote :

Hmm. In the latest alsa-info posted there is a different error:

Node 0x1b [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
  Control: name="Headphone Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals: [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0001373e: IN OUT HP EAPD Detect Trigger
    Vref caps: HIZ 50 GRD 80 100
  EAPD 0x2: EAPD
  Pin Default 0x02214120: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x2, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0xc0: OUT HP VREF_HIZ
  Unsolicited: tag=04, enabled=1
  Power states: D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
  Connection: 5
     0x0c* 0x0d 0x0e 0x0f 0x26 <--- This should point to 0x26 instead of 0x0c

I don't understand why though, as it works in my emulator :-/

I don't know if it is of any interest to you, but I found a weird behavior. On pavucontrol output devices I have two options: Analog Output and Headphones. Both keep sound in speakers and headphone all the tiome. The thing is that if I select the headphone option, sound in speakers get incredibly louder (doesn't change in headphone). The when I switch the back to the analog output, speaker volume gets normal. Headphone volume stays the same all the time.

Does it make any sense to you?

Regards,
Effenberg

David Henningsson (diwic) wrote :

Thanks to you, I've found a bug in the kernel driver. It's an obvious typo. I'm not sure that it fixes the problem completely, but I have good hopes. I'm sending it upstream, hopefully it'll be in the DKMS packages either Thursday or Friday.

This typo caused headphone pins not to be initialized correctly.

BugLink: https://bugs.launchpad.net/bugs/871582
Reported-by: Effenberg
Signed-off-by: David Henningsson <email address hidden>
---
 sound/pci/hda/patch_realtek.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bf53663..6a4128d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3263,7 +3263,7 @@ static void alc_auto_init_extra_out(struct hda_codec *codec)
  int i;
  hda_nid_t pin, dac;

- for (i = 0; i < spec->autocfg.speaker_outs; i++) {
+ for (i = 0; i < spec->autocfg.hp_outs; i++) {
   pin = spec->autocfg.hp_pins[i];
   if (!pin)
    break;
--
1.7.5.4

That's great, I can't wait to try it out.
Thanks David.

Hi Effenberg,

I believe my fix has now reached the dkms packages, so can you please
test today's DKMS package (according to
http://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS ) and see if it resolves
the problem? Thanks in advance!

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

Hi David, I have just tried with a fresh install of Oneiric and see no difference. Maybe the dkms package available there is still outdated? (alsa-hda-dkms_0.201110141211~oneiric1_all.deb).

David Henningsson (diwic) wrote :

I have now manually verified that the fix above is actually in the 2011-10-14 version of the package.

In addition, last week I was working on a bug in pulseaudio causing volumes not to update the hw on port change. I haven't yet released that fix into ubuntu - maybe that is something affecting you as well?

We're out of luck, sorry. I have reinstalled once again Oneiric in another machine with the same ASUS Motherboard and ALC892 (just to make sure) and the patched dkms didn't fix the jack sense problem. I see absolutely no change, looking to alsamixer, plugging/unplugging the headphone to front green port. The changes I can see now is that, on Alsamixer, the headphone slider does control the headphone volume, being able to completely mute it if set to zero.
Also a good change is that the Front slider is controlling only the external speaker, being able to completely mute it if set to zero. Headphone volume is not affected by the front slider anymore.

Another info: On pavucontrol output screen I have two output options: Analog and Headphones. If I select Headphone, I see on alsamixer that channels Surround, Center, LFE, Side and Line are Muted and the Master Slider is reduced about 20%. The exact oposite happens as I switch from headphones to analog.

Regarding this new bug you mention, I can't really say. Let me give it a try when you have the patched dkms.

David Henningsson (diwic) wrote :

Ok, so there is indeed some improvement. That's good. Now for the automute - which I understand is the remaining problem? - here's what *should* be happening:

Look at /proc/asound/SB/codec#0

Node 0x14 is the front line out. Whenever you plug headphones in, the "OUT" status should turn off, and then it should be turned on again when you unplug. That should then mute/unmute the line out. Like this:

Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0001003e: IN OUT HP EAPD Detect Trigger
  EAPD 0x2: EAPD
  Pin Default 0x01014010: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT <----------------------------------------- Headphones not plugged in, OUT present
  Unsolicited: tag=00, enabled=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x0c

Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Front Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x0001003e: IN OUT HP EAPD Detect Trigger
  EAPD 0x2: EAPD
  Pin Default 0x01014010: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Green
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x00: <------------------------------------------------------- Headphones plugged in, "OUT" is now disabled from line out
  Unsolicited: tag=00, enabled=0
  Power states: D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x0c

Also ensure "Automute mode" is set to "Enabled" in alsamixer.

Here's what I did:

TEST #1 - No sound Playing
No headphones plugged in:
$sudo cat /proc/asound/SB/codec#0 > ~/alsa/codec#0.NoHeadphones.Test1.txt

Plug Headphones:
$sudo cat /proc/asound/SB/codec#0 > ~/alsa/codec#0.WithHeadphones.Test1.txt

$ ls -lha ~/alsa/codec#0.*
-rw-rw-r-- 1 al al 16K 2011-10-17 14:42 /home/al/alsa/codec#0.NoHeadphones.Test1.txt
-rw-rw-r-- 1 al al 16K 2011-10-17 14:44 /home/al/alsa/codec#0.WithHeadphones.Test1.txt

$ diff ~/alsa/codec#0.NoHeadphones.Test1.txt ~/alsa/codec#0.WithHeadphones.Test1.txt
$

TEST #2 - Sound Playing
No headphones plugged in:
$ sudo cat /proc/asound/SB/codec#0 > ~/alsa/codec#0.NoHeadphones.Test2.txt

Plug Headphones:
$ sudo cat /proc/asound/SB/codec#0 > ~/alsa/codec#0.WithHeadphones.Test2.txt

$ ls -lha ~/alsa/codec#0.*
-rw-rw-r-- 1 al al 16K 2011-10-17 14:54 /home/al/alsa/codec#0.NoHeadphones.Test2.txt
-rw-rw-r-- 1 al al 16K 2011-10-17 14:42 /home/al/alsa/codec#0.NoHeadphones.txt
-rw-rw-r-- 1 al al 16K 2011-10-17 14:54 /home/al/alsa/codec#0.WithHeadphones.Test2.txt
-rw-rw-r-- 1 al al 16K 2011-10-17 14:44 /home/al/alsa/codec#0.WithHeadphones.txt

$ diff ~/alsa/codec#0.NoHeadphones.Test2.txt ~/alsa/codec#0.WithHeadphones.Test2.txt
$

$ diff ~/alsa/codec#0*
$

Auto-mute is enabled in Alsamixer. There's no change in the file when headphone is plugged in or not, playing music or not.
I have attached the files if you want to have a look at them.

Changed in alsa-driver (Ubuntu):
status: Incomplete → Confirmed

David, I have tested the dkms in one more machine based on the same motherboard using first a fresh install of Natty, and then updated it to Oneiric. In both cases, there really is no change to /proc/asound/SB/codec#0 when headphone is plugged / unplugged to front jack. Just to make sure it is working, I installed Windows 7 later and verified that in fact Jack sense works on that OS.

I verified a new information (don't know if it makes any difference in this case). In the BIOS of this motherboard, the user can choose between HD and AC'97 for the front panel connectors. I verified that I have sound in headphone and mic working in both cases and that sense does not work for headphone in any.

What method (HD or AC'97) is preferable for Alsa /hda? Or is your code independent of that choice?

David Henningsson (diwic) wrote :

So the crazy thing here, is when I run the code in the emulator, the "OUT" is successfully removed when headphones are plugged in. I don't understand why the same thing does not happen on the real hw, maybe the signal is not getting in? Could you try downloading snd-hda-tools from ppa:diwic/ppa and then execute "sudo hda-jack-sense-test -a" both with hp plugged and unplugged to see if there's any difference?

David Henningsson (diwic) wrote :

Your BIOS setting for front panel connector should match the chassis.

Raymond (superquad-vortex2) wrote :

Misc[3:0] is a bit field used to indicate other information about the jack. Currently, only bit 0 is
defined. If bit 0 is set, it indicates that the jack has no presence detect capability, so even if a Pin
Complex indicates that the codec hardware supports the presence detect functionality on the jack,
the external circuitry is not capable of supporting the functionality.

  Pin Default 0x02214120: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x2, Sequence = 0x0
    Misc = NO_PRESENCE <---- This mean that your set the front panel type to ac97 in BIOS

 Unsolicited: tag=00, enabled=0

The driver did not enable the unsolicited event of the headphone pin

Hey David, I just did the test with hda-jack-sense from your ppa. Pin 0x1b (Green HP Out): present = No, in both cases (HP plugged and unplugged). There's no change to the output pasted below.

$ sudo hda-jack-sense-test -a
Pin 0x11 (Black Digital Out): present = No
Pin 0x12 (Not connected): present = No
Pin 0x14 (Green Line Out): present = Yes
Pin 0x15 (Black Line Out): present = No
Pin 0x16 (Orange Line Out): present = No
Pin 0x17 (Grey Line Out): present = No
Pin 0x18 (Pink Mic): present = No
Pin 0x19 (Pink Mic): present = No
Pin 0x1a (Blue Line In): present = No
Pin 0x1b (Green HP Out): present = No
Pin 0x1c (Not connected): present = No
Pin 0x1d (Not connected): present = No
Pin 0x1e (Orange SPDIF Out): present = No
Pin 0x1f (Not connected): present = No

@Raymond, what I don't get is that it does work when booting to Win 7 32-Bits partition... You plug a HP, speakers mute immediately. This is the only reason why I think it could work on Linux, otherwise, wouldn't be wasting David time with that. Initially I thought it could be a problem with the fronts jacks, but as I had another m4A89GTD motherboard, I tried on another case (Cooler Master Haf) and it worked there too (on Windows).

@David

I have verified that some users claim that Jack Sense for Front MicIn in ASUS motherboards with Realtek audio sometimes only work if they DISABLE it in the RealTeck systray software, as shown in these screenshots: http://www.rm.com/Support/TechnicalArticle.asp?cref=TEC949416 . This is on the Windows platform, but I was wondering if these information is in any way helpful for you.

David Henningsson (diwic) wrote :

Realtek's drivers for Windows often set undocumented things on the codec. We have no way (except reverse engineering) to figure those things out.
A more fair comparison would be to compare against Windows 7 without those drivers installed.

Raymond (superquad-vortex2) wrote :

http://www.intel.com/support/motherboards/desktop/sb/CS-020642.htm

How to identify your front panel audio solution codec
To identify your front panel audio solution’s audio codec, refer to the specifications or documentation for your PC chassis or front panel module. Note that AC’97 and HD Audio front panel solutions are different and may
not be directly compatible or interchangeable.

You can also physically check the audio cable of the front panel audio solution. If there is a cable connected to Pin 4, you have an HD Audio module; if there is no cable to Pin 4, you have an AC97 module.

Hi, both panels I tried have two cables: AC'97 and HD. You can choose which one to use. In the HD one, there's a wire in pin4.
I bought another panel, model FP32 from Silverstone, in order to test (http://www.silverstonetek.com/product.php?pid=43&area=). This one is known to work reliably in jack sensing. I'll report back as soon as I receive this hardware and do the tests using it.

Andy Whitcroft (apw) on 2012-01-16
Changed in alsa-driver (Ubuntu):
status: Confirmed → Fix Released
Timothy G. Rundle (tgrundle) wrote :

What package/version will the fix be in? I have the latest updates installed, but I still am experiencing the issue. having said that the patch mention in comment #11 and release in alsa-hda-dkms_0.201110190030~oneiric1_all solves the issue for me

David Henningsson (diwic) wrote :

@tgrundle, probably in an updated 12.04 (the development version) installation.

It took me a while to get my hands on this specific hardware again. Current installs of PP seem to work perfectly out of the box with Realtek ALC892, incuding the Front Output jack sense and auto muting. I had to make sure the BIOS was set to SPDIF and not ac97 for the Front Panel at every boot (not sure why this setting is not saved sometimes).

I had purchased a better audio front panel, but it was not necessary (default one had presence detect capabilty). The patch plus BIOS settings worked perfectly.

Thanks for all the help.

bash321 (bash321) wrote :

DKMS Fix has fixed my audio problems with ubuntu.
bash321

bash321 (bash321) wrote :

ubuntu 12.04

To post a comment you must log in.