Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ALC892 - Unable to get front panel audio working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
raidzero
n00b
n00b


Joined: 18 May 2012
Posts: 11

PostPosted: Fri May 18, 2012 6:58 pm    Post subject: [SOLVED] ALC892 - Unable to get front panel audio working Reply with quote

EDIT: This has been solved. As usual, once I post a question about something it motivates me to dig further. 9 times out of 10 I end up answering my own question, and thats what I have done here. This post is more of a worklog/brainstorm than anything else now... solution in post 2. :D

I am running an EVGA x58 FTW3 board, and I cannot make the front panel headphone port work. I have tried kernels 3.2.12, 3.34 & 3.3.5. I am running ALSA with pulseaudio. I have tried pulseaudio version 2.0 as well as 1.1-r1.

The headphone port is just dead. It works in windows (and auto-mutes speakers). In Gentoo it does nothing at all, no sound comes through it and the speakers continue to play sound.

Here is the output of alsa-info: http://www.alsa-project.org/db/?f=6adabb9026d3ce191cadea678cded0e4b8c1e154

Kernel 3.3.5 config (sound-related):
Code:

CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_PREALLOC_SIZE=64
CONFIG_SND_HDA_HWDEP=y
# CONFIG_SND_HDA_RECONFIG is not set
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=1
CONFIG_SND_HDA_INPUT_JACK=y
# CONFIG_SND_HDA_PATCH_LOADER is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y
# CONFIG_SND_HDA_CODEC_ANALOG is not set
# CONFIG_SND_HDA_CODEC_SIGMATEL is not set
# CONFIG_SND_HDA_CODEC_VIA is not set
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_CODEC_CIRRUS is not set
# CONFIG_SND_HDA_CODEC_CONEXANT is not set
# CONFIG_SND_HDA_CODEC_CA0110 is not set
# CONFIG_SND_HDA_CODEC_CA0132 is not set
# CONFIG_SND_HDA_CODEC_CMEDIA is not set
# CONFIG_SND_HDA_CODEC_SI3054 is not set
CONFIG_SND_HDA_GENERIC=y
# CONFIG_SND_HDA_POWER_SAVE is not set
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
# CONFIG_SOUND_PRIME is not set


I looked in /proc/asound/Intel/codec#2 and node 0x14 is indeed the front playback switch (so it is detected, or not?)... I am out of ideas. Any help would be greatly appreciated. THANKS!

I have also tried several model options in /etc/modprobe.d/alsa.conf (6stack, auto, etc)
Everything works as expected on my old EVGA X58 3xSLI board (ALC889). It wasn't until I switched boards (bent some cpu pins on the 3xsli and was forced to upgrade to ftw3) that this problem presented itself.

I decided to try out snd-hda-tools' hda-jack-sense from ubuntu. I downloaded the deb, used alien to convert to tgz, extracted, modified the scripts and ran it (I did not copy its contents to root, just ran it in its current dir):

(pin 0x14 seems to be rear speaker jack - snd-hda-intel running with model=6stack)
Headphones NOT plugged in:
Code:

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 Line Out): present = No

Headphones plugged in:
Code:

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 Line Out): present = Yes


So jack sensing does work! It just doesn't do anything... lol

I can provide more information if needed.


Last edited by raidzero on Fri May 18, 2012 8:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
raidzero
n00b
n00b


Joined: 18 May 2012
Posts: 11

PostPosted: Fri May 18, 2012 8:36 pm    Post subject: SOLUTION! (well, workaround is more like it) Reply with quote

So I decided to open up /usr/src/linux/sound/pci/hda/patch_realtek.c. I found the text ALC892 in it. It referenced ALC662. I already knew that node 0x1b was my headphone port. I looked in the alc_fixup alc662_fixups struct to find what seemed to be overrides for various pins. I found one with 0x1b as the node id and a comment of "HP out". I figured I would see what happened if I tried to add a quirk entry that attached the PCI ID of my sound card to this struct entry (ALC662_FIXUP_ASUS_MODE2):

Code:

static const struct snd_pci_quirk alc662_fixup_tbl[] = {
...
     SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
+    //added for alc892
+    SND_PCI_QUIRK(0x8086, 0x3a3e, "EVGA x58 FTW3", ALC662_FIXUP_ASUS_MODE2),

#if 0
...


I suppose if you wanted to waste a few lines and not just use the existing ALC662_FIXUP_ASUS_MODE2, you could use this patch on gentoo-sources-3.3.5 amd64:
Code:

--- patch_realtek.c   Fri May 18 14:53:21 2012
*************** enum {
*** 5935,5940 ****
--- 5935,5941 ----
     ALC662_FIXUP_ASUS_MODE6,
     ALC662_FIXUP_ASUS_MODE7,
     ALC662_FIXUP_ASUS_MODE8,
+    ALC892_FIXUP_EVGA_X58_FTW3,
  };
 
  static const struct alc_fixup alc662_fixups[] = {
*************** static const struct alc_fixup alc662_fix
*** 6080,6085 ****
--- 6081,6098 ----
        .chained = true,
        .chain_id = ALC662_FIXUP_SKU_IGNORE
     },
+    [ALC892_FIXUP_EVGA_X58_FTW3] = {
+       .type = ALC_FIXUP_PINS,
+       .v.pins = (const struct alc_pincfg[]) {
+          { 0x14, 0x99130110 }, /* speaker */
+          { 0x18, 0x01a19820 }, /* mic */
+          { 0x19, 0x99a3092f }, /* int-mic */
+          { 0x1b, 0x0121401f }, /* HP out */
+          { }
+       },
+       .chained = true,
+       .chain_id = ALC662_FIXUP_SKU_IGNORE
+    },
  };
 
  static const struct snd_pci_quirk alc662_fixup_tbl[] = {
*************** static const struct snd_pci_quirk alc662
*** 6093,6098 ****
--- 6106,6113 ----
     SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
     SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
     SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
+    //added for alc892
+    SND_PCI_QUIRK(0x8086, 0x3a3e, "EVGA x58 FTW3", ALC892_FIXUP_EVGA_X58_FTW3),
 
 
  #if 0


I rebuilt and reloaded the kernel module and voila! headphone port not only works, it auto mutes the rear speaker jack!
Back to top
View user's profile Send private message
sk3l
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 75
Location: CT USA

PostPosted: Thu Aug 09, 2012 1:24 am    Post subject: Reply with quote

raidzero,

Kudos for your investigation of this issue and the solution you posted. I have the same gear as you (i.e. EVGA x58 mobo w/ ALC892 audio) and I can confirm that the patch you outlined here does in fact work! I was going bonkers for a few days, trying all of the other suggestions you had pointed out in your first post, and with no results to show for it.

Having said that, there are a few drawbacks I seem to have encountered at the end of this exercise. Firstly, now I am now longer able to affect the master volume of the system from the audio controls in Gnome, i.e. pulseaudio. I can drop down to alsamixer and change the volume fine, just not through pulseaudio. Second, the sound quality of the headphones from the front jack are just atrocious. It sounds completely devoid of bass, and may be only output from either L or R channel. I know the headphones are solid, as I use them everyday. To be fair, this could very well be a fault attributable to the HDA header of the case (mine is an Antec 300) or even the mobo connection. Then again, it could be software related in the alsa driver, too. Last, while this patch does the job, I believe that it would need to be applied at each successive kernel upgrade, and this is indeed an onerous chore to need to keep tabs on.

My hope is that 1) a more robust fix that won't inflict collateral damage on pulseaudio and potentially might yield better sound quality could be achieved through a more permanent and tactical change to the kernel code and as a result 2) we wouldn't need to take ownership of patching the source upon each kernel make. In other words, there really ought to be a proper revision to code by "upstream" or whatever one calls the maintainers of the Gentoo kernel code so that it correctly handles the properties of the ALC892 audio codec Is there a way that this issue could be made known to "upstream", through a bug tracker or the like? I'd be happy to do this, it it hasn't yet been done. Pardon a newb's ignorance on the SOP for such a scenario.

Thanks
-Mike

BTW I'm currently running Gentoo kernel 3.3.8 and obviously any enhancements for ALC892 support that might be out there haven't yet made it to the kernel code.
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Thu Aug 09, 2012 4:31 pm    Post subject: Reply with quote

i have the same problem as you guys .can you help me to patch my kernel to please.
i dont know how to do it.
regards hedmo
Back to top
View user's profile Send private message
sk3l
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 75
Location: CT USA

PostPosted: Thu Aug 09, 2012 6:09 pm    Post subject: Reply with quote

Hi hedmo,

Frankly, I would think twice about patching the kernel to address this unless you are prepared to not be able to adjust volume from your desktop environment (unless that symptom I described is unique to my system) and you are willing to re-apply this patch upon every new kernel release. If you can accept those two cases, then read on.

First thing first, make a copy/backup of the file /usr/src/linux/sound/pci/hda/patch_realtek.c Always do this when modding system files so you can fall back to the original version of the file. I would even go so far as to copy your current kernel image and stash that away, although the risk of patching the sound driver should be somewhat low with regard to adversely impacting your system.

Next you need to apply the changes described by raidzero to the file patch_realtek.c. Basically, his changes have the affect of pairing up the characteristics of our sound codec (ALC892) to the layout of a similar chip configuration presented in the patch_realtek. There are two ways to do this. The easiest way, which is what I chose to do, would be to manually copy and paste these 2 lines from raidzero's first source example and paste them into the patch_realtek.c file. I think the line number you'd want to paste them at is 6617, but this will depend on which version of the file you have. I am away from my home pc right now and can't tell you the exact file number for the source in my kernel 3.3.8. Your best bet would be to search for the token "SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T)," and then put the 2 lines below directly after it.

Code:

    //added for alc892
    SND_PCI_QUIRK(0x8086, 0x3a3e, "EVGA x58 FTW3", ALC662_FIXUP_ASUS_MODE2),


The other safer but longer methodology is actually use the patch utility to programmatically apply the patch file(s) that raidzero applied. I'm not going to get into how to do that here; you can read here http://devmanual.gentoo.org/tools-reference/diff-and-patch/index.html to learn how to do this.

After you've finished applying either of the patches raidzero posted, then you need to re-compile your kernel. This should not be new information to you, but you'll need to, after backing up your current kernel image:

Code:

cd /usr/src/linux
make && make modules_install
mount /boot
cp arch/x86/boot/bzImage /boot/<name of your kernel here>


Reboot your machine, and you should then have sound from your front headphone jack. If you go through with the patch, please report back concerning the sound quality you get through your headphones, and whether or not you lose the ability to control the sound via your desktop engine, like I have.

-Mike
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Thu Aug 09, 2012 8:35 pm    Post subject: Reply with quote

sk3l

i still dont get any sound and found the lines i think :roll: :



SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
//added for alc892
SND_PCI_QUIRK(0x8086, 0x3a3e, "EVGA x58 FTW3", ALC662_FIXUP_ASUS_MODE2)$
#if 0


rebuild my kernel,reemerge alsa-driver and reboot.the only thing i can hear is when alsa is starting,a quick and short sound like my mid speaker is jumping one time.thats all

thank you for your post

regards hedmo
Back to top
View user's profile Send private message
sk3l
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 75
Location: CT USA

PostPosted: Thu Aug 09, 2012 10:57 pm    Post subject: Reply with quote

That looks like the appropriate line to paste on. I see a dollar sign "$" at the end of the second line you provided, but the final character needs to be a comma ",". I'm not sure if that's an artifact of your post on this site, or if that's really what was put into the source file, but I'm going to guess the former because the module shouldn't make successfully with a dollar sign there. Out of curiosity what is your motherboard?

I don't have any other suggestions, sorry. Maybe someone else can chime in. If you have a way to boot another distro or Windows on the same machine, I'd recommend checking that you get sound from the jack outside of Gentoo to make sure your case front panel header and motherboard connector are working fine.

-Mike
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Fri Aug 10, 2012 2:53 pm    Post subject: Reply with quote

sk3l wrote:
That looks like the appropriate line to paste on. I see a dollar sign "$" at the end of the second line you provided, but the final character needs to be a comma ",". I'm not sure if that's an artifact of your post on this site, or if that's really what was put into the source file, but I'm going to guess the former because the module shouldn't make successfully with a dollar sign there. Out of curiosity what is your motherboard?

I don't have any other suggestions, sorry. Maybe someone else can chime in. If you have a way to boot another distro or Windows on the same machine, I'd recommend checking that you get sound from the jack outside of Gentoo to make sure your case front panel header and motherboard connector are working fine.

-Mike


sk3l

i have put "," in the file and my motherboard is a M4A89TD PRO/USB3.it works on windows and i have had sound on it but after my bios update it stopped working .

thanks for the help any way

regards hedmo
Back to top
View user's profile Send private message
sk3l
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2012
Posts: 75
Location: CT USA

PostPosted: Fri Aug 10, 2012 7:00 pm    Post subject: Reply with quote

Well, in all likelihood that is your issue right there. radizero and myself both are running EVGA boards. The idea of this patch is to understand that the pin layout of our EVGA mobo's HDA connector resembles certain configurations presented for other similar mobo's in the patch_realtek module, and piggybacking our EVGA boards on that similar HDA pin layout. You cannot make that same assumption using a different board, ASUS in this case.

If you re-flashed your BIOS, then you should go back into the BIOS configuration and ensure that the HDA audio, specifically the front panel, is enabled. I am not familiar with your mobo's BIOS, but I know many of the modern boards have BIOS configuration options pertinent to audio.

-Mike
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Fri Aug 10, 2012 7:56 pm    Post subject: Reply with quote

sk3l wrote:
Well,
If you re-flashed your BIOS, then you should go back into the BIOS configuration and ensure that the HDA audio, specifically the front panel, is enabled. I am not familiar with your mobo's BIOS, but I know many of the modern boards have BIOS configuration options pertinent to audio.

-Mike


i had to flash my bios to get the fx-8150 to work and yes i have two options in my bios.

frontpanel=HD or AC97

SPDIF=HDMI or SPDIF

i have set HD and HDMI

regards hedmo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum