No headphone jack detection (ASUS Zephyrus)

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
iancmx

Re: No headphone jack detection (ASUS Zephyrus)

Post by iancmx »

Code: Select all

➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x20 0x500 0x0f

[sudo] password for iancmx: 
nid = 0x20, verb = 0x500, param = 0xf
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x20 0x477 0x74

nid = 0x20, verb = 0x477, param = 0x74
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x01

nid = 0x1, verb = 0x716, param = 0x1
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x01

nid = 0x1, verb = 0x717, param = 0x1
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x01

nid = 0x1, verb = 0x715, param = 0x1
value = 0x0
➜  ~ 
Still no audio from headphones..speakers still work after those lines tho.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Okay, now try this:

Code: Select all

sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x02
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x02
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x02
And if that doesn't work, try this:

Code: Select all

sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x04
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x04
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x04
iancmx

Re: No headphone jack detection (ASUS Zephyrus)

Post by iancmx »

Code: Select all

➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x02

[sudo] password for iancmx: 
nid = 0x1, verb = 0x716, param = 0x2
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x02

nid = 0x1, verb = 0x717, param = 0x2
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x02

nid = 0x1, verb = 0x715, param = 0x2
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x04

nid = 0x1, verb = 0x716, param = 0x4
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x04

nid = 0x1, verb = 0x717, param = 0x4
value = 0x0
➜  ~ sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x04

nid = 0x1, verb = 0x715, param = 0x4
value = 0x0
Still nothing :( Really appreciate the effort youre putting in though
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Okay, I had another idea, but I need to look things up first. You can reboot whenever you need to, as this one should probably be tried fresh. Shouldn't be more than 10 minutes.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Oh darn. What I was going to suggest was already done by HDAJackRetask.

Try this instead. Run HDAJackRetask, and tell me what the 8 boxes have for 0x21. The last box, Channel (in group), might need to be set to something else. Front might be a good one if it's not already that. The number pairs might also work. Mine is set to Channel 30 & 31, not that means anything for yours. Try changing those, and hitting Apply now before each sound test. As you're making changes, it might mute the headphones when it makes them active, so watch for that.

EDIT: Oops, you have to check the box for Advanced override to see the 8 boxes.
Last edited by MrEen on Wed Jul 01, 2020 1:27 am, edited 1 time in total.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Gotta head to bed. Will check back in the AM to see where we stand.
iancmx

Re: No headphone jack detection (ASUS Zephyrus)

Post by iancmx »

Currenttly for hdajackretask for 0x21, it is set to:
Connectivity: Jack
Location: Left
Device: Headphone
Jack: 3.5mm
Color: Green
Jack Detection: Present
Channel group: 3
Channel (in group): 30 & 31

So I tried changing it to front and pressed apply. However I got an error saying that tee:/sys/class/sound/hwC0D0/reconfig: Device or resource busy
I searched online and found out that its because pulseaudio is running. So I disabled it using commands

Code: Select all

systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
and apply and started pulseaudio. However, jack detection and speakers were not working. I did a install boot overide instead of apply and now jack detection is working but still no audio. Im not sure if the apply button works....
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Some get that stupid "Device or resource busy" thing and I've never figured out why. For Mint users, PulseAudio is always running but most users I've tried to help don't get that error. You didn't have that issue earlier when applying the changes to 0x21 and 0x19 originally. You did good trying to work around it!

Silly question; Is the Headphone port on the Left side of the machine? That's one thing I'd change if not. You could also try Channel 2 or 1 instead of 3.

This thread is very reminiscent of another one with mostly the same issue, but different hardware. This post shows what fixed most of it, not that that will necessarily help much here. Sort of just trying to spur some inspiration.

I'm rather strongly thinking this part of 0x21 is what is still an issue:

Code: Select all

  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
I'm pretty sure the name doesn't matter, but that pin default should have changed to the pincfg from the hdajackretask patch.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

And I just realized something else that is probably quite pertinent. You have no Microphone (external) control, other than the headset mic that you created on 0x19. I'm guessing you have a combo port, for headphone and/or microphone? And for whatever reason, the system completely ignored it.

If we can't get HDAJackRetask to make it work, you might want to post in the bug report showing the 0x21 output along with the pincfg section of the hdajackretask patch. That might give a hint to Takashi. I may be chasing a dead horse here, but if you look at this section of the alsa-info output, you'll see it should have changed:

Code: Select all

/sys/class/sound/hwC0D0/init_pin_configs:
0x12 0x90a60120
0x13 0x40000000
0x14 0x411111f0
0x15 0x411111f0
0x16 0x411111f0
0x17 0x90170110
0x18 0x411111f0
0x19 0x411111f0
0x1a 0x411111f0
0x1b 0x411111f0
0x1d 0x40600001
0x1e 0x411111f0
0x1f 0x411111f0
0x21 0x411111f0

/sys/class/sound/hwC0D0/driver_pin_configs:
0x19 0x01a1103c

/sys/class/sound/hwC0D0/user_pin_configs:
0x12 0x90a60120
0x13 0x40000000
0x14 0x411111f0
0x15 0x411111f0
0x16 0x411111f0
0x17 0x90170110
0x18 0x411111f0
0x19 0x01a1103c
0x1a 0x411111f0
0x1b 0x411111f0
0x1d 0x40600001
0x1e 0x411111f0
0x1f 0x411111f0
0x21 0x0321403f
Yet 0x21 still shows 0x411111f0.

Come to think of it, you had to change 0x19 yourself, yet the driver_pin_config section shows it being changed to the same thing, as if the driver_pin_config never worked. I'm starting to think we're on to something here. This stuff is still a bit over my head, but Takashi should understand it all, and hopefully know what to do with that info.
iancmx

Re: No headphone jack detection (ASUS Zephyrus)

Post by iancmx »

Previously when I applied 0x19 and 0x21, I did the same thing of installing boot overide for it to work. The apply button never worked for me. Before I applied Takashi Iwai patch, i needed to patch 0x19 to get microphone from the headset to work, but after the patch i didnt need to patch 0x19. but i needed to patch 0x21 to get the microphone and headphone detection to work. You are right, the jack is indeed a combo jack and its on the left side of the machine. There is another jack which is just a microphone jack, and it too doesnt work, but im more focused on getting the combo jack to work first.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Oh sure. Shoot down all my ideas! :D

I just realized I never actually looked at his patch to see what it was doing. Gonna take a peek now.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Damn, I forgot already that I did look at it, and that's why I suggested this way back when:

Code: Select all

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x0f
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x7774
As far as I could tell, that's all that quirk really does, although it's chained to others that may or may not do more.
iancmx

Re: No headphone jack detection (ASUS Zephyrus)

Post by iancmx »

I guess I can only wait for Takashi Iwai 's response. Really want to thank you for trying to help me out the past few dasy tho! Really appreciate it! :D
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

iancmx wrote: Thu Jul 02, 2020 8:56 pm I guess I can only wait for Takashi Iwai 's response. Really want to thank you for trying to help me out the past few dasy tho! Really appreciate it! :D
Please add this to your bug report; Even though you have that pincfg, the default for 0x21 isn't changing to what the pincfg has:

Code: Select all

Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Headphone 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 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Power states:  D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
  Connection: 2
     0x02* 0x03
This line is the offender:

Code: Select all

  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
That Pin Default should have changed, but didn't, and that's what I'm hoping someone like Takashi might know what to do about.
synapticjuice
Level 1
Level 1
Posts: 8
Joined: Sun Apr 23, 2017 1:34 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by synapticjuice »

I too have a Asus GX502GW and have the same problem. I have dual boot Linix Mint 20 and Windows 10. Sound works fine on headphones in Windows... but linux wont even detect headphones.

Real pain.
I'm using Asus Zephyrus GX502GW with dual boot Mint Cinnamon 20, Windows 10
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Hi synapticjuice,

I would strongly suggest you join in the bug report about this issue. That's the only place this is ever going to get fixed, and the more that join in, the better the chances of the kernel developers doing something about it.
flukejones

Re: No headphone jack detection (ASUS Zephyrus)

Post by flukejones »

MrEen wrote: Mon Aug 10, 2020 2:31 pm Hi synapticjuice,

I would strongly suggest you join in the bug report about this issue. That's the only place this is ever going to get fixed, and the more that join in, the better the chances of the kernel developers doing something about it.
For anyone subscribed to this forum post and not the linked bugtracker, I've posted an in progress patch on the tracker linked here. So far it seems to work very well, but could use someone testing the external mic with a proper AUX mic (not headset).
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Hi flukejones, and welcome to the forum.

Thanks for the great work on this! I know more than just the people that posted in this thread will benefit from your work. :D
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: No headphone jack detection (ASUS Zephyrus)

Post by MrEen »

Well, good news and potentially bad news.

The fix has been added to the kernel. The potentially bad news is they listed the wrong codec:

Code: Select all

    - ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series
      with ALC289
    - ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus
      G14(GA401) series with ALC289
Should be ALC294, not ALC289. Hopefully it's a typo and the newest kernel fixes (fixed?) this.
avonian
Level 1
Level 1
Posts: 6
Joined: Wed Jan 17, 2018 11:45 am

Re: No headphone jack detection (ASUS Zephyrus)

Post by avonian »

hey guys I have this exact same laptop and after months of being annoyed by the audio jack problem I have good news, I just updated my mint kernel to 5.4.0-74 and it's working like a charm :)
Locked

Return to “Hardware Support”